Exemplo n.º 1
0
 function __construct()
 {
     if (array_key_exists('debug_mode', Hybrid_Auth::$config)) {
         Hybrid_Logger::$enabled = Hybrid_Auth::$config['debug_mode'];
     }
     if (array_key_exists('debug_file', Hybrid_Auth::$config)) {
         Hybrid_Logger::$log_file = Hybrid_Auth::$config['debug_file'];
     }
     if (array_key_exists('debug_level', Hybrid_Auth::$config)) {
         Hybrid_Logger::$log_level = Hybrid_Auth::$config['debug_level'];
     }
     // if debug mode is set to true, then check for the writable log file
     if (Hybrid_Logger::$enabled) {
         if (!file_exists(Hybrid_Logger::$log_file)) {
             throw new Exception("'debug_mode' is set to 'true', but no log file path 'debug_file' given.", 1);
         }
         if (!is_writable(Hybrid_Logger::$log_file)) {
             throw new Exception("'debug_mode' is set to 'true', but the given log file path 'debug_file' is not a writable file.", 1);
         }
     }
 }