示例#1
0
function __shutdown__()
{
    global $application, $zone;
    if (class_exists('CProfiler')) {
        CProfiler::stop('API & Render');
        if (CProfiler::isEnabled()) {
            CTrace::dbg(CProfiler::getProfiler());
        }
        CProfiler::writeCSV();
    }
    if (class_exists('CCacheFactory')) {
        CCacheFactory::shutdown();
    }
    if (function_exists('error_get_last')) {
        $error = error_get_last();
        if (is_array($error) && in_array($error['type'], array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR))) {
            _fatal($error);
            //			CTrace::err($error);
            //			if(class_exists('EventsManager'))
            //				modApiFunc('EventsManager','throwEvent','ApplicationShutdown');
        }
    }
}
示例#2
0
loadClass('REST_Errors');
if ($application->getCurrentProtocol() !== "https") {
    $e = new REST_Errors();
    $e->IncorrectRestProtocol();
    $e->send();
    exit;
}
if (!isset($_GET['alogin']) || !isset($_GET['apassword'])) {
    $e = new REST_Errors();
    $e->UndefinedLoginPassword();
    $e->send();
    exit;
}
loadActionClass('SignIn');
$signin = new SignIn();
$acountInfo = null;
if ($signin->isValidAcount($_GET['alogin'], md5($_GET['apassword']), $acountInfo)) {
    modApiFunc("Users", "setCurrentUserID", $acountInfo['id']);
} else {
    $e = new REST_Errors();
    $e->IncorrectLoginPassword();
    $e->send();
    exit;
}
if ($usr->isUserSignedIn() == FALSE) {
}
$_GET['asc_action'] = 'REST_Request_Action';
CProfiler::start('processAction');
$application->processAction();
CProfiler::stop('processAction');
示例#3
0
            $r->rotate();
            $tw = new CTraceWriter($trace_cfg['file'], $trace_cfg['template'], new CTraceFilter($trace_cfg['filter']));
            CTrace::registerWriter($tw);
        }
    }
}
// must be defined after CTrace initialization.
// all php notices, warnings and errors will be logged, so we need to set E_ALL level
//error_reporting(E_ERROR);
//set_error_handler('__error_handler__', E_ERROR);
CTrace::inf('Request: ' . getCurrentURL());
CProfiler::start('init');
$bootstrap = new Bootstrap();
$bootstrap->preboot();
//CTrace::inf('Point 1 (after preboot)');
$bootstrap->preloadCorePHP();
do_action('init');
//CTrace::inf('Point 2 (after preloading core php)');
$bootstrap->preloadModulesPHP();
//CTrace::inf('Point 3 (after preloading modules php)');
global $zone;
if ($zone == 'CustomerZone') {
    $bootstrap->preloadModulesViewsCzPHP();
    //CTrace::inf('Point 3 (after preloading modules views php)');
}
$bootstrap->boot();
//CTrace::inf('Point 4 (after boot)');
$bootstrap->postboot();
//CTrace::inf('Point 5 (after postboot)');
CProfiler::stop('init');