Beispiel #1
0
 public function __construct()
 {
     $appPath = Days_Engine::appPath();
     if (0 == strcmp($appPath, self::$_appDir)) {
         return;
     }
     self::$_appDir = $appPath;
     if (DIRECTORY_SEPARATOR != substr(self::$_appDir, -1)) {
         self::$_appDir .= DIRECTORY_SEPARATOR;
     }
     self::$_templateDir = self::$_appDir . self::TEMPLATE_DIR;
     self::$_compileDir = self::$_appDir . self::COMPILE_DIR;
     self::$_cacheDir = self::$_appDir . self::CACHE_DIR;
     self::$_caching = Days_Config::load()->get('cache/lifetime', 0);
 }
Beispiel #2
0
 public static function save()
 {
     if (!empty(self::$_errors)) {
         // prepare data
         $sErrorFile = str_replace(':', '.', $_SERVER['HTTP_HOST']);
         $sLogDir = Days_Engine::appPath() . 'system/log/';
         // get current application error levels
         $level = Days_Config::load()->get('log/level');
         // save log
         if (Days_Config::load()->get('engine/debug', false)) {
             $messages = self::getMessages($level);
             if (count($messages) == 0) {
                 return;
             }
             switch (strtolower(Days_Config::load()->get('log/type', 'file'))) {
                 // save to SQLite
                 case 'sqlite':
                     self::logtoSqlite($messages, $sErrorFile, $sLogDir);
                     break;
                     //send to browser
                 //send to browser
                 case 'browser':
                     self::logtoBrowser($messages);
                     break;
                     // send to FirePHP
                 // send to FirePHP
                 case 'fb':
                 case 'firebug':
                 case 'firephp':
                     self::logtoFirephp($messages);
                     break;
                     // save to FILE
                 // save to FILE
                 case 'file':
                 default:
                     self::logtoFile($messages, $sErrorFile, $sLogDir);
             }
         }
         // clear saved errors
         self::$_errors = array();
     }
 }