Exemplo n.º 1
0
 public function testLogger()
 {
     Logger::init(__DIR__, 'wisphp');
     for ($i = 0; $i < 4; $i++) {
         Logger::warn(str_repeat($i, 1024));
     }
     //        Logger::flush();
 }
Exemplo n.º 2
0
 /**
  * Send output
  */
 public function send()
 {
     $this->setFrHeader();
     $data = $this->formatResponse();
     $this->sendHeaders();
     // fetch the output data
     $ob = ini_get('output_buffering');
     if ($ob && strtolower($ob) !== 'off') {
         $str = ob_get_clean();
         //trim data
         $data = trim($str) . $data;
     }
     if ($data) {
         $outhandler = Conf::get('wisphp.outputhandler', array());
         if ($outhandler && !is_array($outhandler)) {
             // support string
             $outhandler = array($outhandler);
         }
         if ($outhandler) {
             // call the global output handlers
             foreach ($outhandler as $handler) {
                 if (is_callable($handler)) {
                     $data = call_user_func($handler, $data);
                 } else {
                     Logger::warn("outouthandler:%s can't call", is_array($handler) ? $handler[1] : $handler);
                 }
             }
         }
         echo $data;
     }
     $this->runTasks();
 }