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).

}

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