public function __construct() { if (!function_exists('memcache_connect')) { throw new Exception("Memcache functions not available"); } $this->host = Config::get('ioMemCacheCache_host'); $this->port = Config::get('ioMemCacheCache_port'); if (empty($this->host) || empty($this->port)) { throw new Exception("You need to supply a valid memcache host and port"); } }
public function execute() { $body = ''; /** @var HttpRequest $req */ foreach ($this->requests as $key => $req) { $body .= "--{$this->boundary}\n"; $body .= $req->toBatchString($key) . "\n"; } $body = rtrim($body); $body .= "\n--{$this->boundary}--"; $url = Config::get('basePath') . '/batch'; $httpRequest = new HttpRequest($url, 'POST'); $httpRequest->setRequestHeaders(array('Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)); $httpRequest->setPostBody($body); $response = Client::$io->makeRequest($httpRequest); $response = $this->parseResponse($response); return $response; }
/** * Instantiates the class, but does not initiate the login flow, leaving it * to the discretion of the caller (which is done by calling authenticate()). */ public function __construct() { if (Config::has('developer_key')) { $this->developerKey = Config::get('developer_key'); } if (Config::has('oauth2_client_id')) { $this->clientId = Config::get('oauth2_client_id'); } if (Config::has('oauth2_client_secret')) { $this->clientSecret = Config::get('oauth2_client_secret'); } if (Config::has('oauth2_redirect_uri')) { $this->redirectUri = Config::get('oauth2_redirect_uri'); } if (Config::has('oauth2_access_type')) { $this->accessType = Config::get('oauth2_access_type'); } if (Config::has('oauth2_approval_prompt')) { $this->approvalPrompt = Config::get('oauth2_approval_prompt'); } }
public function __construct() { $this->path = Config::get('ioFileCache_directory'); }
public function __construct() { if (Config::has('developer_key')) { $this->setDeveloperKey(Config::get('developer_key')); } }
protected function useObjects() { return Config::get('use_objects', false); }
/** * @param string $url the url to set */ public function setUrl($url) { if (substr($url, 0, 4) == 'http') { $this->url = $url; } else { // Force the path become relative. if (substr($url, 0, 1) !== '/') { $url = '/' . $url; } $this->url = Config::get('basePath') . $url; } }
public function useObjects() { return Config::get('use_objects', false); }
/** * @param string $url the url to set */ public function setUrl($url) { if (substr($url, 0, 4) == 'http') { $this->url = $url; } else { $this->url = Config::get('basePath') . $url; } }