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


PHP vB::db方法代碼示例

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


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

示例1: init

 /**
  * Initializes the vB framework.
  * All framework level objects and services are created so that they are available
  * throughout the application.  This is only done once per actual request.
  *
  * Note: If the framework is used this way then there are several limitations.
  *  - If no vB_Bootstrap was created (ie, the admincp), then you cannot render any
  *    views created by the framework.
  *  - VB_ENTRY must be defined to a valid request script that runs the framework
  *    with vB::Main()
  *  - If you are rendering views, try to create all of the views that will be
  *    used before rendering any of them.  This optimises template and phrase
  *    fetching.
  */
 public static function init($relative_path = false)
 {
     global $vbulletin, $vbphrase;
     if (self::$initialized) {
         return;
     }
     // Reference legacy registry
     self::$vbulletin = $vbulletin;
     // Legacy DB
     self::$db = $vbulletin->db;
     // Set a top level exception handler
     set_exception_handler(array('vB', 'handleException'));
     // Set unserializer to use spl registered autoloader
     ini_set('unserialize_callback_func', 'spl_autoload_call');
     // Set class autoloader
     spl_autoload_register(array('vB', 'autoload'));
     // Legacy language
     vB_Phrase::setLanguage(!empty(self::$vbulletin->session->vars['languageid']) ? self::$vbulletin->session->vars['languageid'] : intval(self::$vbulletin->options['languageid']));
     vB_Phrase::preCache($vbphrase, $GLOBALS['phrasegroups']);
     // Ensure we have friendly url class
     require_once DIR . '/includes/class_friendly_url.php';
     if ($relative_path) {
         vB_Router::setRelativePath($relative_path);
     }
     // Done
     self::$initialized = true;
 }
開發者ID:Kheros,項目名稱:MMOver,代碼行數:41,代碼來源:vb.php


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