Exemplo n.º 1
0
 public function returnCustomRequestFromCache($url, $options)
 {
     $Cache = Ak::cache();
     $Cache->init(is_numeric($options['cache']) ? $options['cache'] : 86400, !isset($options['cache_type']) ? 1 : $options['cache_type']);
     if (!$data = $Cache->get('AkHttpClient_'.md5($url))) {
         $data = $this->sendRequest();
         $Cache->save($data);
     }
     return $data;
 }
Exemplo n.º 2
0
 public function _base64Body($content)
 {
     $Cache =& Ak::cache();
     $cache_id = md5($content);
     $Cache->init(3600);
     if (!($encoded_content = $Cache->get($cache_id))) {
         $encoded_content = trim(chunk_split(base64_encode($content)));
         unset($content);
         $Cache->save($encoded_content);
     }
     return $encoded_content;
 }
Exemplo n.º 3
0
 /**
  * @access private
  */
 function _loadPersistedColumnSetings()
 {
     if (!isset($_SESSION['__activeRecordColumnsSettingsCache'])) {
         $Cache =& Ak::cache();
         $Cache->init(AK_ACTIVE_RECORD_CACHE_DATABASE_SCHEMA_LIFE);
         if ($serialized_column_settings = $Cache->get('active_record_db_cache', 'AkActiveRecord') && !empty($serialized_column_settings)) {
             $_SESSION['__activeRecordColumnsSettingsCache'] = @unserialize($serialized_column_settings);
         } elseif (AK_ACTIVE_RECORD_CACHE_DATABASE_SCHEMA) {
             register_shutdown_function(array($this, '_savePersitedColumnSettings'));
         }
     } else {
         $_SESSION['__activeRecordColumnsSettingsCache'] = array();
     }
 }