Exemplo n.º 1
0
    $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
    //Запомним время выполнения (index.php + new Zend_Application)
    $_startTime2 = microtime(1);
    $totalTime_StartApplication = $_startTime2 - $_startTime;
    // Obtain used memory at the beginning of the Application
    $memoryUsage_StartApplication = memory_get_usage();
    $memoryUsage_StartApplication = round($memoryUsage_StartApplication / 1024, 3);
    $memoryUsage_StartApplication = number_format($memoryUsage_StartApplication, 3, '.', ' ');
    // Perform bootstrap
    $application->bootstrap();
    //------------ An execution time Bootstrap -------------
    // Get total time of bootstrap
    $_startTime3 = microtime(1);
    $totalTime_Bootstrap = $_startTime3 - $_startTime2;
    // Get used memory after bootstrap
    $memoryUsage_Bootstrap = Default_Plugin_SysBox::showMemoryUsage('kb');
    // Save time performing different parts of the script in the register
    Zend_Registry::set("Duration_StartApplication", $totalTime_StartApplication);
    Zend_Registry::set("Duration_Bootstrap", $totalTime_Bootstrap);
    Zend_Registry::set("MemoryUsage_StartIndexPHP", $memoryUsage_StartIndexPHP);
    Zend_Registry::set("MemoryUsage_StartApplication", $memoryUsage_StartApplication);
    Zend_Registry::set("MemoryUsage_Bootstrap", $memoryUsage_Bootstrap);
    // Perform dispatch loop
    $application->run();
} catch (Zend_Exception $e) {
    // Intercept exceptions
    Default_Plugin_Error::catchException($e);
} catch (Exception $e) {
    // Intercept exceptions
    Default_Plugin_Error::catchException($e);
}