Ejemplo n.º 1
0
include_once $_core_directory . 'functions.php';
error_reporting(E_ERROR);
set_error_handler('__error_handler__', E_ERROR);
register_shutdown_function('__shutdown__');
include_once $_core_directory . 'bootstrap.php';
include_once $_core_directory . 'const.php';
include_once $_core_directory . 'ctimer.php';
include_once $_core_directory . 'profiler.php';
include_once $_core_directory . 'cfile.php';
include_once $_core_directory . 'trace.php';
include_once $_core_directory . 'tracefilter.php';
include_once $_core_directory . 'tracelogrotation.php';
include_once $_core_directory . 'tracewriter.php';
include_once $_core_directory . 'upgrade.php';
CConf::init(dirname(__FILE__) . '/conf/');
CProfiler::init();
// init default trace loggers
$tracelog = CConf::get('tracelog');
if ($tracelog) {
    CTrace::startScript();
    CTrace::setId(getmypid());
    foreach ($tracelog as $trace_cfg) {
        if ($trace_cfg['enabled'] == 'yes') {
            $r = new CTraceLogRotation($trace_cfg['file'], $trace_cfg['rotation']['size'], $trace_cfg['rotation']['rotate']);
            $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.