/** * Gernerates the signed Data * * @param string $url * @return string */ public static function signData($url) { //http://us.battle.net/api/wow/realm/status if (preg_match("/https/i", strtolower($url))) { $url = substr($url, 21); } else { $url = substr($url, 20); } return base64_encode(hash_hmac('sha1', utf8_encode(kernel::Configuration("authenticationPrivateKey")), self::stringToSign($url))); }
public static function curlRequest($url) { if (kernel::Configuration("apcSupport") || kernel::Configuration("memcachedSupport")) { if (process::check($url)) { return process::fetch($url); } else { return process::store($url, self::uncachedRequest($url)); } } else { return self::uncachedRequest($url); } }
public static function store($var, $value) { if (self::support() == "apc") { if (self::apcSupport()) { apc_store($var, $value, kernel::Configuration("cacheSaveTime")); return apc_fetch($var); } else { kernel::throwException("APC enabled but not available"); return false; } } elseif (self::support() == "memcached") { if (self::memcachedSupport) { memcached::set($var, $value); return memcached::get($var); } else { kernel::throwException("Memcached enabled but not available"); return false; } } }
/** * Sets the parameters after calling the getter * * If Get is called it sets basic parameters * * @return void */ private function requestParamsSet() { if (!isset($this->_options['region'])) { $this->_options['region'] = kernel::Configuration("standardRegion"); } if (!isset($this->_options['sslSupport'])) { $this->_options['sslSupport'] = kernel::Configuration("sslSupport"); } if (!isset($this->_options['apcCaching'])) { $this->_options['apcCaching'] = kernel::Configuration("apcSupport"); } if (!isset($this->_options['memCaching'])) { $this->_options['memCaching'] = kernel::Configuration("memcachedSupport"); } if (!isset($this->_options['softfail'])) { $this->_options['softfail'] = kernel::Configuration("softfail"); } $this->dynamicModules(); }
public static function set($key, $value) { self::connect()->set($key, $value, false, kernel::Configuration("cacheSaveTime")); }