BxDolCacheUtilities::size PHP Method

size() public method

public size ( $sCache, $isFormatted = false )
    function size($sCache, $isFormatted = false)
    {
        $iSize = $this->_action($sCache, 'size');
        return $isFormatted ? sprintf("%.2f", $iSize / 1024 / 1024) : $iSize;
    }

Usage Example

Exemplo n.º 1
0
        case 'template':
        case 'css':
        case 'js':
            $aResult = $oCacheUtilities->clear($_POST['clear_cache']);
            break;
        default:
            $aResult = array('code' => 1, 'message' => _t('_Error Occured'));
    }
    // add cache size data for chart in case of successful cache cleaning
    if ($aResult['code'] == 0) {
        $aResult['chart_data'] = array();
        foreach ($aCacheTypes as $r) {
            if ('all' == $r['action']) {
                continue;
            }
            $aResult['chart_data'][] = array('value' => round($oCacheUtilities->size($r['action']) / 1024, 2), 'color' => '#' . dechex(rand(0x0, 0xffffff)), 'highlight' => '', 'label' => bx_js_string($r['title'], BX_ESCAPE_STR_APOS));
        }
    }
    echo json_encode($aResult);
    exit;
}
$iNameIndex = 3;
$_page = array('name_index' => $iNameIndex, 'css_name' => array(), 'js_name' => array(), 'header' => _t('_adm_txt_cache'), 'header_text' => _t('_adm_txt_cache'));
$aPages = array('clear' => array('title' => _t('_adm_txt_clear_cache'), 'url' => BX_DOL_URL_ADMIN . 'cache.php?mode=clear', 'func' => 'PageCodeClear', 'func_params' => array()), 'engines' => array('title' => _t('_adm_admtools_cache_engines'), 'url' => BX_DOL_URL_ADMIN . 'cache.php?mode=engines', 'func' => 'PageCodeEngines', 'func_params' => array()), 'settings' => array('title' => _t('_Settings'), 'url' => BX_DOL_URL_ADMIN . 'cache.php?mode=settings', 'func' => 'PageCodeSettings', 'func_params' => array()));
if (!isset($_GET['mode']) || !isset($aPages[$_GET['mode']])) {
    $sMode = 'clear';
} else {
    $sMode = $_GET['mode'];
}
$aTopItems = array();
foreach ($aPages as $k => $r) {
All Usage Examples Of BxDolCacheUtilities::size