CacheEngine::AvailableEngines PHP Method

AvailableEngines() public static method

Returns an array of available engines containing engine name -> info pairs.
public static AvailableEngines ( $p_path = null ) : array
$p_path
return array
    public static function AvailableEngines($p_path = null)
    {
        if (is_null($p_path)) {
            $path = dirname(__FILE__);
        } else {
            $path = $p_path;
        }
        $includeFiles = glob(realpath($path) . '/CacheEngine_*.php');
        $engines = array();
        foreach ($includeFiles as $includeFile) {
            if (preg_match('/CacheEngine_([^.]+)\\.php/', $includeFile, $matches) == 0) {
                continue;
            }
            require_once $includeFile;
            $engineName = $matches[1];
            $className = "CacheEngine_{$engineName}";
            if (class_exists($className)) {
                $cacheEngine = new $className();
                $engines[$engineName] = array('is_supported' => $cacheEngine->isSupported(), 'page_caching_supported' => $cacheEngine->pageCachingSupported(), 'file' => "{$path}/CacheEngine_{$engineName}.php", 'description' => $cacheEngine->description());
            }
        }
        return $engines;
    }

Usage Example

Example #1
0
    exit;
}
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("System Preferences"), "");
echo camp_html_breadcrumbs($crumbs);
include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
$htmlFormData['SiteTitle'] = htmlspecialchars(SystemPref::Get("SiteTitle"));
$htmlFormData['SiteMetaKeywords'] = htmlspecialchars(SystemPref::Get("SiteMetaKeywords"));
$htmlFormData['SiteMetaDescription'] = htmlspecialchars(SystemPref::Get("SiteMetaDescription"));
$htmlFormData['SiteSecretKey'] = htmlspecialchars(SystemPref::Get("SiteSecretKey"));
$max_upload_filesize = SystemPref::Get("MaxUploadFileSize");
if (empty($max_upload_filesize) || $max_upload_filesize == 0) {
    SystemPref::Set("MaxUploadFileSize", ini_get('upload_max_filesize'));
}
$availableCacheEngines = CacheEngine::AvailableEngines();
$availableTemplateCacheHandlers = CampTemplateCache::availableHandlers();
?>
<p></p>

<?php 
camp_html_display_msgs();
?>

<form action="/<?php 
echo $ADMIN;
?>
/system_pref/do_edit.php" onsubmit="return <?php 
camp_html_fvalidate();
?>
;" method="POST">