TorneLIB\Module\Config\WrapperConfig
Class WrapperConfig Configuration handler. All wrapper services that needs shared configuration like credentials, SSL setup, etc.
Synopsis
class WrapperConfig
{
- // members
- private string $requestUrl = '';
- private array $requestData = ;
- private $requestDataContainer;
- private int $requestMethod = requestMethod::METHOD_GET;
- private int $requestDataType = dataType::NORMAL;
- private array $options = ;
- private $currentWrapper;
- private bool $isNetWrapper = false;
- private static $userAgentSignature;
- private bool $identifierAgent = false;
- private bool $identifierAgentPhp = false;
- private bool $isCustomUserAgent = false;
- private string $proxyAddress = '';
- private integer $proxyType = 0;
- private array $streamOptions = ;
- private array $streamContextStatic = ;
- private array $storedHeaders = ;
- private array $authData = ;
- private $throwableHttpCodes;
- private array $configData = ;
- private WrapperSSL $SSL;
- private array $irreplacable = ;
- private bool $isSoapRequest = false;
- private bool $isStreamRequest = false;
- private $authSource;
- private bool $staging = false;
- // methods
- public void __construct()
- public void resetStreamData()
- public array getCompatibilityMethods()
- private $this setCurlDefaults()
- public WrapperConfig setThrowableHttpCodes()
- public void getHttpException()
- public array getThrowableHttpCodes()
- public array getCurlDefaults()
- private WrapperConfig setCurlConstants()
- public string getRequestUrl()
- public WrapperConfig setRequestUrl()
- public array getRequestData()
- public mixed getRequestDataContainer()
- private string getJsonData()
- public WrapperConfig setRequestData()
- public WrapperConfig setRequestMethod()
- public int getRequestMethod()
- public array getRequestFlags()
- public void setRequestFlags()
- public array getOptions()
- private void setHandledUserAgent()
- private string getUserAgentsMerged()
- private string getPhpString()
- private void getNetWrapperString()
- public WrapperConfig setStreamOptions()
- public WrapperConfig setStreamContext()
- private bool canOverwrite()
- public mixed getStreamContext()
- public array|null getContentFromStreamContext()
- public array getStreamOptions()
- private $this setRenderedStreamOptions()
- private $this setRenderedUserAgent()
- public WrapperConfig setOptions()
- private mixed|null getOptionCurl()
- public $this setOption()
- public WrapperConfig setProxy()
- public string getProxy()
- public int getProxyType()
- public mixed getOption()
- public void setSoapRequest()
- public void setStreamRequest()
- public bool getSoapRequest()
- public bool getStreamRequest()
- public $this setStreamOption()
- public $this setDualStreamHttp()
- public $this setHeader()
- public array getHeader()
- public array getStreamHeader()
- public mixed getStreamOption()
- public $this deleteOption()
- public $this replaceOption()
- public void setRequestDataType()
- public int getRequestDataType()
- public WrapperConfig setAuthentication()
- public $this setAuthStream()
- public array getAuthentication()
- private $this setTimeout()
- public $this setUserAgent()
- public bool getIsCustomUserAgent()
- public void setIdentifiers()
- public bool getIdentifiers()
- public mixed getUserAgent()
- public WrapperConfig setStaging()
- public bool getStaging()
- public $this setProduction()
- public bool getProduction()
- private array getTimeout()
- public WrapperConfig setWsdlCache()
- public mixed|null getWsdlCache()
- public bool getCompatibilityArguments()
- public $this setNetWrapper()
- public static void setSignature()
- public static void deleteSignature()
- public static string getSignature()
- public $this setUserAgentSignature()
- public string getUserAgentSignature()
- public string getCurrentWrapper()
- public WrapperConfig setCurrentWrapper()
- public string getCurrentWrapperClass()
- private mixed getShortWrapperClass()
- public $this request()
- public $this|mixed __call()
Members
private
- $SSL — TorneLIB\Module\Config\WrapperSSL
- $authData — array
- $authSource —
- $configData — array
- $currentWrapper — string
- $identifierAgent
—
TorneLIB\Module\Config\bool
Allow WrapperConfig to push out netcurl identification instead of a spoofed browser. - $identifierAgentPhp
—
TorneLIB\Module\Config\bool
If netcurl identification is allowed, also allow PHP version to be pushed into the useragent, unless it's already done somewhere else. - $irreplacable
—
array
User data that normally can not be overwritten more than once (when not exists). - $isCustomUserAgent — TorneLIB\Module\Config\bool
- $isNetWrapper — TorneLIB\Module\Config\bool
- $isSoapRequest
—
TorneLIB\Module\Config\bool
If discovered soaprequest. - $isStreamRequest
—
TorneLIB\Module\Config\bool
If discovered stream request. - $options — array
- $proxyAddress — string
- $proxyType — int
- $requestData — array
- $requestDataContainer —
- $requestDataType
—
int
Datatype to post in (default = uses ?key=value for GET and &key=value in body for POST). - $requestMethod — int
- $requestUrl — string
- $staging — TorneLIB\Module\Config\bool
- $storedHeaders
—
array
Stored headers, used to replicate through multiple instances when NetWrapper is in use. - $streamContextStatic
—
array
Static header content. Used to replicate through multiple instances but will never reset between requests. - $streamOptions — array
- $throwableHttpCodes — array
- $userAgentSignature — string
Methods
private
- canOverwrite()
- getJsonData() — Handle json. Legacy. Maybe.
- getNetWrapperString()
- getOptionCurl() — Find out if there is a predefined constant for CURL-options and if the curl library actually exists.
- getPhpString()
- getShortWrapperClass()
- getTimeout() — Returns internal information about the configured timeouts.
- getUserAgentsMerged()
- setCurlConstants() — While setting up curloptions, make sure no warnings leak from the setup if constants are missing in the system.
- setCurlDefaults() — Preparing curl defaults in a way we like.
- setHandledUserAgent()
- setRenderedStreamOptions() — Prepare streamoption array.
- setRenderedUserAgent() — Handle user-agent in streams.
- setTimeout()
public
- __construct() — WrapperConfig constructor.
- __call() — Internal configset magics.
- deleteOption()
- deleteSignature() — Remove static useragent.
- getAuthentication() — Get authdata.
- getCompatibilityArguments()
- getCompatibilityMethods() — Returns compatibility functions from for example NetCurl 6.0.
- getContentFromStreamContext()
- getCurlDefaults() — Get current list of curlopts, etc.
- getCurrentWrapper()
- getCurrentWrapperClass()
- getHeader() — If NetWrapper is the primary engine, we need to extract all headers from this section.
- getHttpException() — Throw on any code that matches the store throwableHttpCode (use with setThrowableHttpCodes())
- getIdentifiers() — Status of identifierAgent, if enable or not.
- getIsCustomUserAgent()
- getOption()
- getOptions()
- getProduction()
- getProxy()
- getProxyType()
- getRequestData() — Transform requested data into a proper format based on the content-type.
- getRequestDataContainer() — Entry point.
- getRequestDataType() — Datatype of request (json, etc).
- getRequestFlags() — Flags registered in the Flags class.
- getRequestMethod() — Get information about the current request method that is used: POST, GET, DELETE, etc
- getRequestUrl() — Which URL is the current requested?
- getSignature()
- getSoapRequest()
- getStaging()
- getStreamContext()
- getStreamHeader()
- getStreamOption()
- getStreamOptions() — Get current soapoptions.
- getStreamRequest()
- getThrowableHttpCodes() — Return the list of throwable http error codes (if set). For developers that needs to see which http codes that is normally thrown on errors.
- getUserAgent()
- getUserAgentSignature()
- getWsdlCache()
- replaceOption() — Replace an option with another.
- request()
- resetStreamData()
- setAuthStream() — Replace current authdata manually to stream source if the default is set by mistake.
- setAuthentication() — Set authdata.
- setCurrentWrapper()
- setDualStreamHttp()
- setHeader()
- setIdentifiers() — Allows strict identification in user-agent header.
- setNetWrapper()
- setOption()
- setOptions()
- setProduction()
- setProxy()
- setRequestData() — User input variables.
- setRequestDataType() — Datatype of request (json, etc).
- setRequestFlags()
- setRequestMethod() — Set up which method that should be used: POST, GET, DELETE, etc
- setRequestUrl() — Set up a new URL to be requested from the wrappers.
- setSignature() — Setting useragent statically and on global level.
- setSoapRequest()
- setStaging()
- setStreamContext()
- setStreamOption()
- setStreamOptions() — Update stream options (which transforms into stream_context).
- setStreamRequest()
- setThrowableHttpCodes() — Set up a list of which HTTP error codes that should be throwable (default: >= 400, <= 599).
- setUserAgent()
- setUserAgentSignature()
- setWsdlCache() — Quickset WSDL cache.