/** * Initializes the bootstrap and framework. */ public static function init($relative_path = false) { if (!self::$initialized) { global $vbulletin; // Check datastore // TODO: This should be redundant as all routes are accessed via vB_Router if (!sizeof($vbulletin->routes)) { $vbulletin->datastore->fetch(array('routes')); } // Notify includes they are ok to run if (!defined('VB_ENTRY')) { define('VB_ENTRY', 1); } // Mark the framework as loaded if (!defined('VB_FRAMEWORK')) { define('VB_FRAMEWORK', 1); } // Get the entry time if (!defined('VB_ENTRY_TIME')) { define('VB_ENTRY_TIME', microtime(true)); } // vB core path if (!defined('VB_PATH')) { define('VB_PATH', realpath(dirname(__FILE__) . '/../vb') . '/'); } // The package path if (!defined('VB_PKG_PATH')) { define('VB_PKG_PATH', realpath(VB_PATH . '../packages') . '/'); } // Bootstrap to the new system require_once(VB_PATH . 'vb.php'); vB::init($relative_path); } self::$initialized = true; }
/** * Initializes the bootstrap and framework. */ public static function init($relative_path = false) { if (!self::$initialized) { global $vbulletin; // Check datastore // Redundant, loaded by default when datastore is loaded // if (!sizeof($vbulletin->routes) AND VBINSTALL !== true) // { // $vbulletin->datastore->fetch(array('routes')); // } // Notify includes they are ok to run if (!defined('VB_ENTRY')) { define('VB_ENTRY', 1); } // Mark the framework as loaded if (!defined('VB_FRAMEWORK')) { define('VB_FRAMEWORK', true); } // Get the entry time if (!defined('VB_ENTRY_TIME')) { define('VB_ENTRY_TIME', microtime(true)); } // vB core path if (!defined('VB_PATH')) { define('VB_PATH', realpath(dirname(__FILE__) . '/../vb') . '/'); } // The package path if (!defined('VB_PKG_PATH')) { define('VB_PKG_PATH', realpath(VB_PATH . '../packages') . '/'); } // Bootstrap to the new system require_once VB_PATH . 'vb.php'; vB::init($relative_path); } self::$initialized = true; }