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


PHP vB_Cache::getDefaults方法代碼示例

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


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

示例1: fetch_config

 /**
  * Fetches database/system configuration
  * Code extracted from vB_Registry::fetch_config (class_core)
  */
 private static function fetch_config()
 {
     // Set the default values here.
     $default['Cache']['class'] = vB_Cache::getDefaults();
     // parse the config file
     if (file_exists(CWD . '/' . self::$config_file)) {
         include CWD . '/' . self::$config_file;
     } else {
         if (defined('STDIN')) {
             exit(5);
         }
         die('<br /><br /><strong>Configuration</strong>: includes/config.php does not exist. For a new install click <a href="core/install/makeconfig.php">here</a>');
     }
     // TODO: this should be handled with an exception, the backend shouldn't produce output
     if (empty($config)) {
         // config.php exists, but does not define $config
         if (defined('STDIN')) {
             exit(5);
         }
         die('<br /><br /><strong>Configuration</strong>: includes/config.php exists, but is not in the 3.6+ format. Please convert your config file via the new config.php.new.');
     }
     self::$config = vB_Array::arrayReplaceRecursive($default, $config);
     // if a configuration exists for this exact HTTP host, use it
     if (isset($_SERVER['HTTP_HOST']) and isset(self::$config["{$_SERVER['HTTP_HOST']}"])) {
         self::$config['MasterServer'] = self::$config["{$_SERVER['HTTP_HOST']}"];
     }
     // define table and cookie prefix constants
     define('TABLE_PREFIX', trim(isset(self::$config['Database']['tableprefix']) ? self::$config['Database']['tableprefix'] : ''));
     define('COOKIE_PREFIX', empty(self::$config['Misc']['cookieprefix']) ? 'bb' : self::$config['Misc']['cookieprefix']);
     // Set debug mode, always default this to false unless it is explicitly set to true (see VBV-2948).
     self::$config['Misc']['debug'] = (isset(self::$config['Misc']['debug']) and self::$config['Misc']['debug'] === true) ? true : false;
     // This will not exist if a pre vB5 config file is still in use. @TODO, change the default when everything can cope with a blank setting.
     if (!isset(self::$config['SpecialUsers']['superadmins'])) {
         self::$config['SpecialUsers']['superadmins'] = '1';
         // Not ideal, but some areas (and the upgrader) choke on a blank setting atm.
     }
 }
開發者ID:cedwards-reisys,項目名稱:nexus-web,代碼行數:41,代碼來源:vb.php


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