Example #1
0
 public function outputHandler(string $contents, int $status = 0) : string
 {
     return mb_output_handler($contents, $status);
 }
Example #2
0
 public function outputHandler($contents = '', $status = 0)
 {
     if (!is_string($contents)) {
         return Error::set('Error', 'stringParameter', '1.(contents)');
     }
     if (!is_numeric($status)) {
         return Error::set('Error', 'numericParameter', '2.(status)');
     }
     return mb_output_handler($contents, $status);
 }
Example #3
0
 /**
  * Output callback method which will be called when the output buffer
  * is flushed at the end of the request.
  *
  * @param string    $uValue     the generated content
  * @param int       $uStatus    the status of the output buffer
  *
  * @return string final content
  */
 public static function output($uValue, $uStatus)
 {
     $tParms = array('exitStatus' => &self::$exitStatus, 'responseFormat' => &self::$responseFormat, 'content' => &$uValue);
     Events::invoke('output', $tParms);
     if (ini_get('output_handler') === "") {
         $tParms['content'] = mb_output_handler($tParms['content'], $uStatus);
         // PHP_OUTPUT_HANDLER_START | PHP_OUTPUT_HANDLER_END
         if (!ini_get('zlib.output_compression') && PHP_SAPI !== 'cli' && Config::get('options/gzip', true) === true) {
             $tParms['content'] = ob_gzhandler($tParms['content'], $uStatus);
             // PHP_OUTPUT_HANDLER_START | PHP_OUTPUT_HANDLER_END
         }
     }
     return $tParms['content'];
 }