Files
@ f43d1a4680a9
Branch filter:
Location: hot67beta/administrator/components/com_cache/cache.class.php - annotation
f43d1a4680a9
3.1 KiB
text/x-php
menubar 0 to 10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 | <?php
/**
* @version $Id: cache.class.php 11074 2008-10-13 04:54:12Z ian $
* @package Joomla
* @subpackage Cache
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
* Class used to hold Cache data
*
* @package Joomla
* @subpackage Cache
* @since 1.5
*/
class CacheData extends JObject
{
/**
* An Array of CacheItems indexed by cache group ID
*
* @access protected
* @var Array
*/
var $_items = null;
/**
* The cache path
*
* @access protected
* @var String
*/
var $_path = null;
/**
* Class constructor
*
* @access protected
*/
function __construct( $path )
{
$this->_path = $path;
$this->_parse();
}
/**
* Parse $path for cache file groups. Any files identifided as cache are logged
* in a group and stored in $this->items.
*
* @access private
* @param String $path
*/
function _parse()
{
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$folders = JFolder::folders($this->_path);
foreach ($folders as $folder)
{
$files = array();
$files = JFolder::files($this->_path.DS.$folder);
$this->_items[$folder] = new CacheItem( $folder );
foreach ($files as $file)
{
$this->_items[$folder]->updateSize( filesize( $this->_path.DS.$folder.DS.$file )/ 1024 );
}
}
}
/**
* Get the number of current Cache Groups
*
* @access public
* @return int
*/
function getGroupCount()
{
return count($this->_items);
}
/**
* Retrun an Array containing a sub set of the total
* number of Cache Groups as defined by the params.
*
* @access public
* @param Int $start
* @param Int $limit
* @return Array
*/
function getRows( $start, $limit )
{
$i = 0;
$rows = array();
if (!is_array($this->_items)) {
return null;
}
foreach ($this->_items as $item)
{
if ( (($i >= $start) && ($i < $start+$limit)) || ($limit == 0) ) {
$rows[] = $item;
}
$i++;
}
return $rows;
}
/**
* Clean out a cache group as named by param.
* If no param is passed clean all cache groups.
*
* @param String $group
*/
function cleanCache( $group='' )
{
$cache =& JFactory::getCache('', 'callback', 'file');
$cache->clean( $group );
}
function cleanCacheList( $array )
{
foreach ($array as $group) {
$this->cleanCache( $group );
}
}
}
/**
* This Class is used by CacheData to store group cache data.
*
* @package Joomla
* @subpackage Cache
* @since 1.5
*/
class CacheItem
{
var $group = "";
var $size = 0;
var $count = 0;
function CacheItem ( $group )
{
$this->group = $group;
}
function updateSize( $size )
{
$this->size = number_format( $this->size + $size, 2 );
$this->count++;
}
}
|