當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Armory::cache方法代碼示例

本文整理匯總了PHP中Armory::cache方法的典型用法代碼示例。如果您正苦於以下問題:PHP Armory::cache方法的具體用法?PHP Armory::cache怎麽用?PHP Armory::cache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Armory的用法示例。


在下文中一共展示了Armory::cache方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

    die('<b>Error:</b> unable to load cache interface!');
}
// We are forced to load APC cache, enabled or not
if (!(include __ARMORYDIRECTORY__ . '/includes/classes/cache/cache.apc.php')) {
    die('<b>Error:</b> unable to load apc cache class!');
}
if (Armory::$armoryconfig['useApc'] == true) {
    if (!(include __ARMORYDIRECTORY__ . '/includes/cache_config.php')) {
        die('<b>Error:</b> unable to load cache config!');
    }
    // Make sure APC is installed
    if (!function_exists('apc_fetch')) {
        die('<b>Error:</b> APC is enabled in configuation, but is not installed on php');
    }
}
Armory::$cache = new ApcCache();
Armory::$cacheconfig = $cacheConfig;
/* Check DbVersion */
$dbVersion = Armory::$aDB->selectCell("SELECT `version` FROM `ARMORYDBPREFIX_db_version`");
if ($dbVersion != DB_VERSION) {
    if (!$dbVersion) {
        if (isset(Armory::$armoryconfig['checkVersionType']) && Armory::$armoryconfig['checkVersionType'] == 'log') {
            Armory::Log()->writeError('ArmoryChecker: wrong Armory DB name!');
        } else {
            echo '<b>Fatal error</b>: wrong Armory DB name<br/>';
        }
    }
    $errorDBVersion = sprintf('Current version is %s but expected %s.<br />
    Apply all neccessary updates from \'sql/updates\' folder and refresh this page.', $dbVersion ? "'" . $dbVersion . "'" : 'not defined', "'" . DB_VERSION . "'");
    if (isset(Armory::$armoryconfig['checkVersionType']) && Armory::$armoryconfig['checkVersionType'] == 'log') {
        Armory::Log()->writeError('ArmoryChecker : DB_VERSION error: %s', defined('DB_VERSION') ? $errorDBVersion : 'DB_VERSION constant not defined!');
開發者ID:saqar,項目名稱:WoW-Armory,代碼行數:31,代碼來源:armory_loader.php


注:本文中的Armory::cache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。