コード例 #1
0
ファイル: Resources.class.php プロジェクト: davbfr/cf
 protected function append($filename, $origfilename = null)
 {
     if (substr($filename, -5) == ".less") {
         $script = Cache::Pub($filename, ".css");
         if ($script->check()) {
             Logger::info("Compile less file {$filename}");
             $less = new Less();
             $less->setOriginalDir(dirname($origfilename));
             $less->compileFile($filename, $script->getFilename());
         }
         $filename = $script->getFilename();
     }
     parent::append($filename, $origfilename);
 }
コード例 #2
0
ファイル: ErrorHandler.class.php プロジェクト: davbfr/cf
 public function send_error($code, $message = null, $body = null, $backtrace = 1)
 {
     if ($this->inerror) {
         Logger::critical("Already processing error (send_error) {$code} {$message} {$body}");
         return;
     }
     $this->inerror = true;
     $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
     if ($message == null) {
         if (isset(self::$messagecode[$code])) {
             $message = self::$messagecode[$code];
         } else {
             $message = "Error #{$code}";
         }
     }
     if ($body === null) {
         $body = $message;
     }
     if ($code >= 500) {
         Logger::critical("[{$code}] {$message}: {$body}");
     } else {
         Logger::info("[{$code}] {$message}: {$body}");
     }
     if ($this->raise_exception) {
         throw new Exception($body);
     }
     header("{$protocol} {$code} {$message}");
     if ($code < 500 && $code != 404) {
         echo $body;
         Output::finish($code);
     }
     IS_CLI && Output::finish($code);
     if ($backtrace !== false) {
         $this->debugBacktrace($backtrace);
     }
     $this->formatErrorBody($code, $message, $body, $this->backtrace, array_slice(Logger::getInstance()->getLog(), 0, -1));
 }