PHP 클래스 AdsUser, googleads-php-lib

파일 보기 프로젝트 열기: googleads/googleads-php-lib 1 사용 예제들

공개 메소드들

메소드 설명
GetClientLibraryUserAgent ( ) : string Gets the user agent string that identifies this library for this user.
GetDefaultOAuth2Handler ( null | string $className = null ) : mixed Get the default OAuth2 Handler for this user.
GetDefaultServer ( ) : string Gets the default server.
GetDefaultVersion ( ) : string Gets the default version.
GetForceAddXsiTypes ( ) : boolean Gets the setting of whether or not to add XSI types in the SOAP payload.
GetForceHttpVersion ( ) : float Gets the version of the HTTP protocol to use regardless of PHP version.
GetHeaderNames ( ) : array Gets the names of all registered request header elements.
GetHeaderValue ( string $key ) : string Gets the value for a registered request header element.
GetLogsDirectory ( ) : string Gets the logs directory.
GetOAuth2Handler ( ) : OAuth2Handler Gets the OAuth2 handler for this user.
GetOAuth2Info ( ) : array Gets the OAuth2 info for this user.
GetServiceSoapClient ( string $serviceName, SoapClientFactory $serviceFactory ) : SoapClient Gets the service by its service name.
GetSoapCompressionLevel ( ) : integer Gets the SOAP compression level.
GetWsdlCacheType ( ) : integer Gets the type of WSDL caching in use.
IsSoapCompressionEnabled ( ) : boolean Is SOAP compression enabled.
LoadSettings ( string $settingsIniPath, string $defaultVersion, string $defaultServer, string $defaultLogsDir, string $logsRelativePathBase ) Loads the settings for this client library. If the settings INI file located at $settingsIniPath cannot be loaded, then the parameters passed into this method are used.
LogAll ( ) Configures the library to log all requests.
LogDefaults ( ) Configures the library to log basic information about all requests and the full SOAP XML request and response only when an error occurs.
LogErrors ( ) Configures the library to only log requests that return an error.
SetDefaultServer ( string $defaultServer ) Sets the default server.
SetDefaultVersion ( string $defaultVersion ) Sets the default version.
SetHeaderValue ( string $key, string $value ) Sets the value for a request header.
SetOAuth2Handler ( array $oauth2Handler ) Sets the OAuth2 handler for this user.
SetOAuth2Info ( array $oauth2Info ) Sets the OAuth2 info for this user.
getIsIncludeUtilitiesInUserAgent ( ) : boolean
setIncludeUtilitiesInUserAgent ( boolean $isIncludeUtilitiesInUserAgent )
updateClientLibraryUserAgent ( string $applicationName ) Sets the user agent string that identifies this library for this user.

보호된 메소드들

메소드 설명
GetAuthVarValue ( string | null $authVar, string $authVarName, array $authIni ) : string Gets the authenticaiton value for the $authVar supplied. If the $authVar is set, it is is used. Otherwise, the supplied $authenticationIni is queried for the variable. If none is found null is returned.
GetClientLibraryNameAndVersion ( ) : array Gets the name and version of this client library.
GetUserAgentHeaderName ( ) : string Gets the appropriate user agent header name for the API this client library is targeting.
InitLogs ( ) Initializes the logging mechanism used by services created by this user.
ValidateOAuth2Info ( ) Validates that the OAuth2 info is complete.
__construct ( ) Constructor for AdsUser.

비공개 메소드들

메소드 설명
Define ( string $name, string $value ) Define a constant if it isn't already defined. If it is defined but the value is different then attempt to redefine it, which will fail and throw the appropriate error.
GetAllClientLibraryUserAgentParts ( ) : array Gets all the user agent parts that identify this client library plus user agent parts from the ads utilities registry.
GetCommonClientLibraryUserAgentParts ( ) : array Gets common PHP user agent parts for ads client libraries such as PHP version, operating system, browser, or if compression is being used or not.
GetSetting ( array $settings, string $section, string $name, mixed $default = null ) : string Gets the value for a given setting based on the contents of the parsed INI file.

메소드 상세

GetAuthVarValue() 보호된 메소드

Gets the authenticaiton value for the $authVar supplied. If the $authVar is set, it is is used. Otherwise, the supplied $authenticationIni is queried for the variable. If none is found null is returned.
protected GetAuthVarValue ( string | null $authVar, string $authVarName, array $authIni ) : string
$authVar string | null the default value for the authentication variable
$authVarName string the name of the authentication variable
$authIni array the array of authentication variables from an INI file
리턴 string the authentication variable value

GetClientLibraryNameAndVersion() 추상적인 보호된 메소드

Gets the name and version of this client library.
abstract protected GetClientLibraryNameAndVersion ( ) : array
리턴 array An array containing the name and version of this client library, e.g.: ['DfpApi-PHP', '2.13.0'].

GetClientLibraryUserAgent() 공개 메소드

Gets the user agent string that identifies this library for this user.
public GetClientLibraryUserAgent ( ) : string
리턴 string A user agent string.

GetDefaultOAuth2Handler() 추상적인 공개 메소드

Get the default OAuth2 Handler for this user.
abstract public GetDefaultOAuth2Handler ( null | string $className = null ) : mixed
$className null | string the name of the oauth2Handler class or null
리턴 mixed the configured OAuth2Handler class

GetDefaultServer() 공개 메소드

Gets the default server.
public GetDefaultServer ( ) : string
리턴 string the default server

GetDefaultVersion() 공개 메소드

Gets the default version.
public GetDefaultVersion ( ) : string
리턴 string the default version

GetForceAddXsiTypes() 공개 메소드

Gets the setting of whether or not to add XSI types in the SOAP payload.
public GetForceAddXsiTypes ( ) : boolean
리턴 boolean whether or not to add XSI types in the SOAP payload

GetForceHttpVersion() 공개 메소드

Gets the version of the HTTP protocol to use regardless of PHP version.
public GetForceHttpVersion ( ) : float
리턴 float the HTTP version that should be used

GetHeaderNames() 공개 메소드

Gets the names of all registered request header elements.
public GetHeaderNames ( ) : array
리턴 array the names of the request header elements

GetHeaderValue() 공개 메소드

Gets the value for a registered request header element.
public GetHeaderValue ( string $key ) : string
$key string the name of the request header element
리턴 string the value of the request header element or null if not found

GetLogsDirectory() 공개 메소드

Gets the logs directory.
public GetLogsDirectory ( ) : string
리턴 string the logs directory

GetOAuth2Handler() 공개 메소드

Gets the OAuth2 handler for this user.
public GetOAuth2Handler ( ) : OAuth2Handler
리턴 OAuth2Handler the OAuth2 handler for this user

GetOAuth2Info() 공개 메소드

Gets the OAuth2 info for this user.
public GetOAuth2Info ( ) : array
리턴 array the OAuth2 info for this user

GetServiceSoapClient() 공개 메소드

Gets the service by its service name.
public GetServiceSoapClient ( string $serviceName, SoapClientFactory $serviceFactory ) : SoapClient
$serviceName string the service name
$serviceFactory SoapClientFactory the service factory
리턴 SoapClient the instantiated service

GetSoapCompressionLevel() 공개 메소드

Gets the SOAP compression level.
public GetSoapCompressionLevel ( ) : integer
리턴 integer the SOAP compression level

GetUserAgentHeaderName() 추상적인 보호된 메소드

Gets the appropriate user agent header name for the API this client library is targeting.
abstract protected GetUserAgentHeaderName ( ) : string
리턴 string The user agent header name.

GetWsdlCacheType() 공개 메소드

Gets the type of WSDL caching in use.
public GetWsdlCacheType ( ) : integer
리턴 integer the type of WSDL caching in use

InitLogs() 보호된 메소드

HTTP headers and SOAP XML are logged to the soap_xml.log file and all request information is logged to the request_info.log file under the logs directory.
protected InitLogs ( )

IsSoapCompressionEnabled() 공개 메소드

Is SOAP compression enabled.
public IsSoapCompressionEnabled ( ) : boolean
리턴 boolean is SOAP compression enabled

LoadSettings() 공개 메소드

Loads the settings for this client library. If the settings INI file located at $settingsIniPath cannot be loaded, then the parameters passed into this method are used.
public LoadSettings ( string $settingsIniPath, string $defaultVersion, string $defaultServer, string $defaultLogsDir, string $logsRelativePathBase )
$settingsIniPath string the path to the settings INI file
$defaultVersion string the default version if the settings INI file cannot be loaded
$defaultServer string the default server if the settings INI file cannot be loaded
$defaultLogsDir string the default logs directory if the settings INI file cannot be loaded
$logsRelativePathBase string the relative path base for the logs directory

LogAll() 공개 메소드

Configures the library to log all requests.
public LogAll ( )

LogDefaults() 공개 메소드

Configures the library to log basic information about all requests and the full SOAP XML request and response only when an error occurs.
public LogDefaults ( )

LogErrors() 공개 메소드

Configures the library to only log requests that return an error.
public LogErrors ( )

SetDefaultServer() 공개 메소드

Sets the default server.
public SetDefaultServer ( string $defaultServer )
$defaultServer string the default server

SetDefaultVersion() 공개 메소드

Sets the default version.
public SetDefaultVersion ( string $defaultVersion )
$defaultVersion string the default version

SetHeaderValue() 공개 메소드

Sets the value for a request header.
public SetHeaderValue ( string $key, string $value )
$key string the name of the request header element
$value string the value for the request header element

SetOAuth2Handler() 공개 메소드

Sets the OAuth2 handler for this user.
public SetOAuth2Handler ( array $oauth2Handler )
$oauth2Handler array the OAuth2 handler for this user

SetOAuth2Info() 공개 메소드

Sets the OAuth2 info for this user.
public SetOAuth2Info ( array $oauth2Info )
$oauth2Info array the OAuth2 info for this user

ValidateOAuth2Info() 보호된 메소드

Validates that the OAuth2 info is complete.
protected ValidateOAuth2Info ( )

__construct() 보호된 메소드

Constructor for AdsUser.
protected __construct ( )

getIsIncludeUtilitiesInUserAgent() 공개 메소드

public getIsIncludeUtilitiesInUserAgent ( ) : boolean
리턴 boolean whether or not names of ads utilities being used will be included in the user agent

setIncludeUtilitiesInUserAgent() 공개 메소드

public setIncludeUtilitiesInUserAgent ( boolean $isIncludeUtilitiesInUserAgent )
$isIncludeUtilitiesInUserAgent boolean whether ads utilities being used will be included in the user agent

updateClientLibraryUserAgent() 공개 메소드

TODO(vtsao): The current contract requires that subclasses call this method in their constructor.
public updateClientLibraryUserAgent ( string $applicationName )
$applicationName string The application name that will appear in this header