Added simple error/exception handler and logging

This commit is contained in:
Dmitry Khomutov 2014-03-18 01:10:47 +07:00
commit a4b33b97d9
4 changed files with 109 additions and 6 deletions

View file

@ -8,6 +8,9 @@
*/
// Let PHP take a guess as to the default timezone, if the user hasn't set one:
use PHPCI\Logging\Handler;
use PHPCI\Logging\LoggerConfig;
date_default_timezone_set(@date_default_timezone_get());
// Set up a basic autoloader for PHPCI:
@ -37,10 +40,12 @@ if (!file_exists(dirname(__FILE__) . '/vendor/autoload.php') && defined('PHPCI_I
exit(1);
}
// Load Composer autoloader:
require_once(dirname(__FILE__) . '/vendor/autoload.php');
$loggerConfig = LoggerConfig::newFromFile(__DIR__ . "/loggerconfig.php");
Handler::register($loggerConfig->getFor('Exceptions'));
// Load configuration if present:
$conf = array();
$conf['b8']['app']['namespace'] = 'PHPCI';