本文整理匯總了PHP中JCacheStorage::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCacheStorage::getAll方法的具體用法?PHP JCacheStorage::getAll怎麽用?PHP JCacheStorage::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCacheStorage
的用法示例。
在下文中一共展示了JCacheStorage::getAll方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAll
/**
* 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;
}
示例2: getAll
/**
* 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;
}
示例3: getAll
/**
* 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;
}
示例4: getAll
/**
* 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;
}
示例5: getAll
/**
* 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;
}
示例6: getAll
/**
* 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;
}
示例7: getAll
/**
* 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;
}
示例8: getAll
/**
* 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;
}
示例9: getAll
/**
* 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;
}
示例10: getAll
/**
* 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;
}