本文整理汇总了PHP中vB::vbulletin方法的典型用法代码示例。如果您正苦于以下问题:PHP vB::vbulletin方法的具体用法?PHP vB::vbulletin怎么用?PHP vB::vbulletin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vB
的用法示例。
在下文中一共展示了vB::vbulletin方法的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;
}