index.php 1.34 KB
<?php
header("server: YHB-" . (getenv('APPLICATION_HOST') ? getenv('APPLICATION_HOST') : 'local'));
define('APPLICATION_PATH', dirname(__DIR__));
###########################################################################################
defined('Q_APPLICATION_ENV') || define('Q_APPLICATION_ENV', (ini_get('qin.environment') ? ini_get('qin.environment') : 'release'));
###########################################################################################
set_include_path(implode(PATH_SEPARATOR, array(get_include_path(), ini_get('qin.path'))));
//set_include_path(implode(PATH_SEPARATOR, array(get_include_path(),'/Data/code/QF1.1/Framework','/Data/code/bright.knight')));
include("/Data/code/QF1.1/Framework/Q/Autoloader.php");
if (!empty($_GET['_qdebug']) && $_GET['_qdebug'] == 'xhprof') {
    $_beginTime = microtime(true);
    $shprof = new Q_Debug_Xhprof_Stat();
    $shprof->setUrl('http://xhprof.debug.yohobuy.com')->start();
    echo (microtime(true) - $_beginTime) . ' Start Xhprof Time.<br />';
}
$application = new Yaf_Application(APPLICATION_PATH . "/configs/application.ini");
$application->bootstrap()->run();
if (!empty($_GET['_qdebug']) && $_GET['_qdebug'] == 'xhprof') {
    echo '<br />' . (microtime(true) - $_beginTime) . ' End Run Time.<br />';
    $shprof->end();
    echo '<br />' . (microtime(true) - $_beginTime) . ' End Xhprof Time.<br />';
}