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; }
public function __construct() { if (Config::has('developer_key')) { $this->setDeveloperKey(Config::get('developer_key')); } }
public function __construct() { $this->path = Config::get('ioFileCache_directory'); }
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 { $this->url = Config::get('basePath') . $url; } }