예제 #1
0
파일: Transform.php 프로젝트: jasny/Q
 /**
  * Callback for output handling.
  *
  * @param string|array $buffer
  * @param int          $flags
  * @return string|array
  */
 public function callback($buffer, $flags)
 {
     $marker = $this->opt & Output::IGNORE_MARKERS || is_array($buffer) ? null : Output::curMarker();
     // Directly flush the output
     if (!isset($marker)) {
         return $this->transform->process($buffer);
     }
     // Keep caching the output of flush
     $this->data[$marker] = $this->data;
     return $flags & PHP_OUTPUT_HANDLER_END ? $this->transform->process($this->data) : null;
 }