Google API Core Client - Class AgentHeader (1.35.0)

Reference documentation and code samples for the Google API Core Client class AgentHeader.

Class containing functions used to build the Agent header.

Namespace

Google \ ApiCore

Methods

static::buildAgentHeader

Parameters
Name Description
headerInfo array

Optional.

↳ phpVersion string

the PHP version.

↳ libName string

the name of the client application.

↳ libVersion string

the version of the client application.

↳ gapicVersion string

the code generator version of the GAPIC library.

↳ apiCoreVersion string

the ApiCore version.

↳ grpcVersion string

the gRPC version.

↳ restVersion string

the REST transport version (typically same as the ApiCore version).

↳ protobufVersion string

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

Returns
Type Description
array Agent header array

static::readGapicVersionFromFile

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
Parameter
Name Description
callingClass string
Returns
Type Description
string the gapic version

Constants

AGENT_HEADER_KEY

Value: 'x-goog-api-client'

UNKNOWN_VERSION

Value: ''