Try catching more errors into zendphp.log

This commit is contained in:
Martin Konecny 2012-09-06 14:01:54 -04:00
parent a941743ed7
commit acf06e289f
2 changed files with 20 additions and 23 deletions

View File

@ -1,14 +1,4 @@
<?php
//DateTime in PHP 5.3.0+ need a default timezone set. Set to UTC initially
//in case Application_Model_Preference::GetTimezone fails and creates needs to create
//a log entry. This log entry requires a call to date(), which then complains that
//timezone isn't set. Setting a default timezone allows us to create a a graceful log
//that getting the real timezone failed, without PHP complaining that it cannot log because
//there is no timezone :|.
date_default_timezone_set('UTC');
require_once __DIR__."/logging/Logging.php";
Logging::setLogPath('/var/log/airtime/zendphp.log');
require_once __DIR__."/configs/conf.php";
require_once __DIR__."/configs/ACL.php";
require_once 'propel/runtime/lib/Propel.php';
@ -37,6 +27,7 @@ Zend_Validate::setDefaultNamespaces("Zend");
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new RabbitMqPlugin());
/* The bootstrap class should only be used to initialize actions that return a view.
Actions that return JSON will not use the bootstrap class! */
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap

View File

@ -34,19 +34,25 @@ if (file_exists('/usr/share/php/libzend-framework-php')) {
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
date_default_timezone_set('UTC');
require_once (APPLICATION_PATH."/logging/Logging.php");
Logging::setLogPath('/var/log/airtime/zendphp.log');
$sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cli') {
set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path());
require_once("Bootstrap.php");
} else {
$application->bootstrap()
->run();
// Create application, bootstrap, and run
try {
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cli') {
set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path());
require_once("Bootstrap.php");
} else {
$application->bootstrap()->run();
}
} catch (Exception $e) {
Logging::info($e->getMessage());
}