本文整理汇总了PHP中midcom::_application方法的典型用法代码示例。如果您正苦于以下问题:PHP midcom::_application方法的具体用法?PHP midcom::_application怎么用?PHP midcom::_application使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类midcom
的用法示例。
在下文中一共展示了midcom::_application方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init()
{
///////////////////////////////////
// Try to be smart about the paths:
// Define default constants
if (!defined('MIDCOM_ROOT')) {
define('MIDCOM_ROOT', dirname(__FILE__));
}
require MIDCOM_ROOT . '/compat/environment.php';
midcom_compat_environment::initialize();
if (!defined('MIDCOM_STATIC_ROOT')) {
$pos = strrpos(MIDCOM_ROOT, '/');
if ($pos === false) {
// No slash, this is strange
_midcom_stop_request('MIDCOM_ROOT did not contain a slash, this should not happen and is most probably the cause of a configuration error.');
}
define('MIDCOM_STATIC_ROOT', substr(MIDCOM_ROOT, 0, $pos) . '/static');
}
if (!defined('MIDCOM_STATIC_URL')) {
define('MIDCOM_STATIC_URL', '/midcom-static');
}
if (!defined('MIDCOM_CONFIG_FILE_BEFORE')) {
define('MIDCOM_CONFIG_FILE_BEFORE', '/etc/midgard/midcom.conf');
}
if (!defined('MIDCOM_CONFIG_FILE_AFTER')) {
define('MIDCOM_CONFIG_FILE_AFTER', '/etc/midgard/midcom-after.conf');
}
///////////////////////////////////////
//Constants, Globals and Configuration
require MIDCOM_ROOT . '/constants.php';
require MIDCOM_ROOT . '/midcom/connection.php';
require MIDCOM_ROOT . '/midcom/config/midcom_config.php';
ini_set('track_errors', '1');
require MIDCOM_ROOT . '/errors.php';
// Register autoloader so we get all MidCOM classes loaded automatically
spl_autoload_register(array('midcom', 'autoload'));
if (file_exists(MIDCOM_ROOT . '/../vendor/autoload.php')) {
$loader = (require MIDCOM_ROOT . '/../vendor/autoload.php');
$loader->register();
}
/////////////////////
// Start the Debugger
require MIDCOM_ROOT . '/midcom/debug.php';
debug_add("Start of MidCOM run: {$_SERVER['REQUEST_URI']}");
self::$_services['auth'] = new midcom_services_auth();
self::$_services['auth']->initialize();
/* Load and start up the cache system, this might already end the request
* on a content cache hit. Note that the cache check hit depends on the i18n and auth code.
*/
self::$_services['cache'] = new midcom_services_cache();
/////////////////////////////////////
// Instantiate the MidCOM main class
self::$_application = new midcom_application();
if (!empty($GLOBALS['midcom_config']['midcom_use_superglobal'])) {
require_once MIDCOM_ROOT . '/compat/superglobal.php';
$_MIDCOM = new midcom_compat_superglobal();
}
self::$_application->initialize();
if (file_exists(MIDCOM_CONFIG_FILE_AFTER)) {
include MIDCOM_CONFIG_FILE_AFTER;
}
}