Esempio n. 1
0
 /**
  * Get all cached data
  *
  * @return  array    data
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     $allinfo = wincache_ucache_info();
     $keys = $allinfo['cache_entries'];
     $secret = $this->_hash;
     $data = array();
     foreach ($keys as $key) {
         $name = $key['key_name'];
         $namearr = explode('-', $name);
         if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new JCacheStorageHelper($group);
             } else {
                 $item = $data[$group];
             }
             if (isset($key['value_size'])) {
                 $item->updateSize($key['value_size'] / 1024);
             } else {
                 // Dummy, WINCACHE version is too low
                 $item->updateSize(1);
             }
             $data[$group] = $item;
         }
     }
     return $data;
 }
Esempio n. 2
0
 /**
  * Get all cached data
  *
  * This requires the php.ini setting xcache.admin.enable_auth = Off.
  *
  * @return  array  data
  *
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     // Make sure XCache is configured properly
     if (self::isSupported() == false) {
         return array();
     }
     $allinfo = xcache_list(XC_TYPE_VAR, 0);
     $keys = $allinfo['cache_list'];
     $secret = $this->_hash;
     $data = array();
     foreach ($keys as $key) {
         $namearr = explode('-', $key['name']);
         if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new JCacheStorageHelper($group);
             } else {
                 $item = $data[$group];
             }
             $item->updateSize($key['size'] / 1024);
             $data[$group] = $item;
         }
     }
     return $data;
 }
Esempio n. 3
0
 /**
  * Get all cached data
  *
  * @return  array  The cached data
  *
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     $path = $this->_root;
     $folders = $this->_folders($path);
     $data = array();
     foreach ($folders as $folder) {
         $files = $this->_filesInFolder($path . '/' . $folder);
         $item = new JCacheStorageHelper($folder);
         foreach ($files as $file) {
             $item->updateSize(filesize($path . '/' . $folder . '/' . $file) / 1024);
         }
         $data[$folder] = $item;
     }
     return $data;
 }
Esempio n. 4
0
 /**
  * Get all cached data
  *
  * @return	array data
  * @since	1.6
  */
 public function getAll()
 {
     parent::getAll();
     $path = $this->_root;
     jimport('joomla.filesystem.folder');
     $folders = JFolder::folders($path);
     $data = array();
     foreach ($folders as $folder) {
         $files = JFolder::files($path . DS . $folder);
         $item = new JCacheStorageHelper($folder);
         foreach ($files as $file) {
             $item->updateSize(filesize($path . DS . $folder . DS . $file) / 1024);
         }
         $data[$folder] = $item;
     }
     return $data;
 }
Esempio n. 5
0
 /**
  * Get all cached data
  *
  * @return  array  data
  *
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     $allinfo = apc_cache_info('user');
     $keys = $allinfo['cache_list'];
     $secret = $this->_hash;
     $data = array();
     foreach ($keys as $key) {
         $name = $key['info'];
         $namearr = explode('-', $name);
         if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new JCacheStorageHelper($group);
             } else {
                 $item = $data[$group];
             }
             $item->updateSize($key['mem_size'] / 1024);
             $data[$group] = $item;
         }
     }
     return $data;
 }
Esempio n. 6
0
 /**
  * Get all cached data
  *
  * @return	array data
  * @since	1.6
  */
 public function getAll()
 {
     parent::getAll();
     $keys = eaccelerator_list_keys();
     $secret = $this->_hash;
     $data = array();
     foreach ($keys as $key) {
         /* Trim leading ":" to work around list_keys namespace bug in eAcc. This will still work when bug is fixed */
         $name = ltrim($key['name'], ':');
         $namearr = explode('-', $name);
         if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new JCacheStorageHelper($group);
             } else {
                 $item = $data[$group];
             }
             $item->updateSize($key['size'] / 1024);
             $data[$group] = $item;
         }
     }
     return $data;
 }
Esempio n. 7
0
 /**
  * Get all cached data
  *
  * @return  array  data
  *
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     $allinfo = apc_cache_info('user');
     $keys = $allinfo['cache_list'];
     $secret = $this->_hash;
     $data = array();
     foreach ($keys as $key) {
         // If APCu is being used for this adapter, the internal key name changed with APCu 4.0.7 from key to info
         $name = isset($key['info']) ? $key['info'] : $key['key'];
         $namearr = explode('-', $name);
         if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new JCacheStorageHelper($group);
             } else {
                 $item = $data[$group];
             }
             $item->updateSize($key['mem_size'] / 1024);
             $data[$group] = $item;
         }
     }
     return $data;
 }
Esempio n. 8
0
 /**
  * Get all cached data
  *
  * @return  array    data
  *
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     $keys = self::$_db->get($this->_hash . '-index');
     $secret = $this->_hash;
     $data = array();
     if (!empty($keys)) {
         foreach ($keys as $key) {
             if (empty($key)) {
                 continue;
             }
             $namearr = explode('-', $key->name);
             if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
                 $group = $namearr[2];
                 if (!isset($data[$group])) {
                     $item = new JCacheStorageHelper($group);
                 } else {
                     $item = $data[$group];
                 }
                 $item->updateSize($key->size / 1024);
                 $data[$group] = $item;
             }
         }
     }
     return $data;
 }
Esempio n. 9
0
 /**
  * Get all cached data
  *
  * @return  array
  *
  * @since   11.1
  */
 public function getAll()
 {
     parent::getAll();
     $path = $this->_root;
     $folders = new DirectoryIterator($path);
     $data = array();
     foreach ($folders as $folder) {
         if (!$folder->isDir() || $folder->isDot()) {
             continue;
         }
         $foldername = $folder->getFilename();
         $files = new DirectoryIterator($path . '/' . $foldername);
         $item = new JCacheStorageHelper($foldername);
         foreach ($files as $file) {
             if (!$file->isFile()) {
                 continue;
             }
             $filename = $file->getFilename();
             $item->updateSize(filesize($path . '/' . $foldername . '/' . $filename) / 1024);
         }
         $data[$foldername] = $item;
     }
     return $data;
 }
Esempio n. 10
0
 /**
  * Get all cached data
  *
  * @return  array  Array of cached data
  *
  * @since   3.4
  */
 public function getAll()
 {
     if (static::isConnected() == false) {
         return false;
     }
     parent::getAll();
     $allKeys = static::$_redis->keys('*');
     $data = array();
     $secret = $this->_hash;
     if (!empty($allKeys)) {
         foreach ($allKeys as $key) {
             $namearr = explode('-', $key);
             if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
                 $group = $namearr[2];
                 if (!isset($data[$group])) {
                     $item = new JCacheStorageHelper($group);
                 } else {
                     $item = $data[$group];
                 }
                 $item->updateSize(strlen($key) * 8 / 1024);
                 $data[$group] = $item;
             }
         }
     }
     return $data;
 }