Example #1
0
 private function DebugErrorHook()
 {
     global $g_config;
     static $errorListner = NULL;
     $path = dirname(__FILE__) . '/Debug/ErrorHook/';
     require_once $path . 'Listener.php';
     require_once $path . 'Catcher.php';
     require_once $path . 'INotifier.php';
     require_once $path . 'Util.php';
     require_once $path . 'TextNotifier.php';
     require_once $path . 'MailNotifier.php';
     require_once $path . 'RemoveDupsWrapper.php';
     require_once $path . 'my/MyDebug_ErrorHook_TextNotifier.php';
     $cfgLog = $g_config['logErrors'];
     FileSys::MakeDir(dirname($cfgLog['repeatTmp']));
     $errorListner = new Debug_ErrorHook_Listener();
     $errorListner->addNotifier(new MyDebug_ErrorHook_TextNotifier(MyDebug_ErrorHook_TextNotifier::LOG_ALL));
     if (!empty($cfgLog['email'])) {
         $errorListner->addNotifier(new Debug_ErrorHook_RemoveDupsWrapper(new Debug_ErrorHook_MailNotifier($cfgLog['email'], Debug_ErrorHook_TextNotifier::LOG_ALL), $cfgLog['repeatTmp'] . "/email/", $cfgLog['emailTimeRepeat']));
     }
 }
Example #2
0
<?php

error_reporting(E_ALL);
define('ROOT', __DIR__);
define('INCLUDE_ROOT', sprintf('%s/include', ROOT));
define('LIBRARY_ROOT', sprintf('%s/include/library', ROOT));
set_time_limit(0);
# Handle shitty configs
require sprintf('%s/config.php', ROOT);
$cfgDefault = $cfg;
require sprintf('%s/config.local.php', ROOT);
foreach ($cfgDefault as $k => $v) {
    if (!isset($cfg[$k])) {
        $cfg[$k] = $v;
    }
}
require sprintf('%s/include/functions/common.php', ROOT);
spl_autoload_register('autoload');
date_default_timezone_set(cfg()->timezone);
require_once sprintf('%s/Debug/ErrorHook/Listener.php', LIBRARY_ROOT);
$errorsToMail = new Debug_ErrorHook_Listener();
$errorsToMail->addNotifier(new Debug_ErrorHook_RemoveDupsWrapper(new Debug_ErrorHook_RssNotifier(Debug_ErrorHook_TextNotifier::LOG_ALL), cfg()->tmpDir, 300));