public function __construct($params = null, $cacheType = kCacheManager::CACHE_TYPE_API_V3, $expiry = 0)
 {
     if ($expiry) {
         $this->_defaultExpiry = $this->_expiry = $expiry;
     }
     $this->_cacheKeyPrefix = 'cache_v3-';
     parent::__construct($cacheType, $params);
 }
 public function __construct()
 {
     $this->_cacheKeyPrefix = 'playManifest-';
     parent::__construct();
     if (!kConf::get('enable_cache')) {
         return;
     }
     $this->_params = requestUtils::getRequestParams();
     if (isset($this->_params['nocache'])) {
         return;
     }
     $this->calculateCacheKey();
     $this->enableCache();
 }
Example #3
0
 public function __construct()
 {
     $this->_cacheKeyPrefix = 'playManifest-';
     parent::__construct(kCacheManager::CACHE_TYPE_PLAY_MANIFEST);
 }
 public function __construct($params = null, $cacheType = kCacheManager::FS_API_V3, $expiry = 0)
 {
     $this->_cacheKeyPrefix = 'cache_v3-';
     parent::__construct();
     if ($expiry) {
         $this->_defaultExpiry = $this->_expiry = $expiry;
     }
     if (!kConf::get('enable_cache')) {
         return;
     }
     if (!$params) {
         $params = requestUtils::getRequestParams();
     }
     self::handleSessionStart($params);
     foreach (kConf::get('v3cache_ignore_params') as $name) {
         unset($params[$name]);
     }
     // check the clientTag parameter for a cache start time (cache_st:<time>) directive
     if (isset($params['clientTag'])) {
         $clientTag = $params['clientTag'];
         $matches = null;
         if (preg_match("/cache_st:(\\d+)/", $clientTag, $matches)) {
             if ($matches[1] > time()) {
                 self::disableCache();
                 return;
             }
         }
     }
     if (isset($params['nocache'])) {
         self::disableCache();
         return;
     }
     $this->_cacheStore = kCacheManager::getCache($cacheType);
     if (!$this->_cacheStore) {
         self::disableCache();
         return;
     }
     $ks = isset($params['ks']) ? $params['ks'] : '';
     foreach ($params as $key => $value) {
         if (!preg_match('/[\\d]+:ks/', $key)) {
             continue;
         }
         // not a ks
         if (strpos($value, ':result') !== false) {
             continue;
         }
         // the ks is the result of some sub request
         if ($ks && $ks != $value) {
             self::disableCache();
             // several different ks's in a multirequest - don't use cache
             return;
         }
         $ks = $value;
         unset($params[$key]);
     }
     unset($params['ks']);
     unset($params['kalsig']);
     unset($params['clientTag']);
     unset($params['callback']);
     $this->_params = $params;
     $this->setKS($ks);
     $this->enableCache();
 }