class AgentHeader (View source)

Class containing functions used to build the Agent header.

Constants

AGENT_HEADER_KEY

UNKNOWN_VERSION

Methods

static array
buildAgentHeader(array $headerInfo)

No description

static string
readGapicVersionFromFile(string $callingClass)

Reads the gapic version string from a VERSION file. In order to determine the file location, this method follows this procedure:

  • accepts a class name $callingClass
  • identifies the file defining that class
  • searches up the directory structure for the 'src' directory
  • looks in the directory above 'src' for a file named VERSION

Details

static array buildAgentHeader(array $headerInfo)

No description

Parameters

array $headerInfo

{ Optional.

@type string $phpVersion the PHP version.
@type string $libName the name of the client application.
@type string $libVersion the version of the client application.
@type string $gapicVersion the code generator version of the GAPIC library.
@type string $apiCoreVersion the ApiCore version.
@type string $grpcVersion the gRPC version.
@type string $restVersion the REST transport version (typically same as the
      ApiCore version).
@type string $protobufVersion the protobuf version in format 'x.y.z+a' where both 'x.y.z'
      and '+a' are optional, and where 'a' is a single letter representing the
      implementation type of the protobuf runtime. It is recommended to use 'c' for a C
      implementation, and 'n' for the native language implementation (PHP).

}

Return Value

array

Agent header array

static string readGapicVersionFromFile(string $callingClass)

Reads the gapic version string from a VERSION file. In order to determine the file location, this method follows this procedure:

  • accepts a class name $callingClass
  • identifies the file defining that class
  • searches up the directory structure for the 'src' directory
  • looks in the directory above 'src' for a file named VERSION

Parameters

string $callingClass

Return Value

string

the gapic version

Exceptions

ReflectionException