Пример #1
0
function sendPayload($params = array())
{
    global $Payload;
    $payloadArray = (array) $Payload;
    Tracy\Debugger::$productionMode = TRUE;
    header('Content-Type:application/json;charset=utf-8');
    print json_encode($params + $payloadArray) and die;
}
Пример #2
0
 /**
  * Sends response to output.
  * @param  Nette\Http\IRequest  $httpRequest
  * @param  Nette\Http\IResponse $httpResponse
  * @return void
  */
 public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
 {
     /**
      * Disable tracy bar
      */
     if (class_exists('\\Tracy\\Debugger') && property_exists('\\Tracy\\Debugger', 'productionMode')) {
         \Tracy\Debugger::$productionMode = TRUE;
     }
     /**
      * Set Content-Type header
      */
     $httpResponse->setContentType($this->contentType, $this->output_encoding);
     /**
      * Set Content-Disposition header
      */
     $httpResponse->setHeader('Content-Disposition', 'attachment' . '; filename="' . $this->name . '"');
     /*. '; filename*=' . $this->output_encoding . '\'\'' . rawurlencode($this->name));*/
     /**
      * Set other headers
      */
     foreach ($this->headers as $key => $value) {
         $httpResponse->setHeader($key, $value);
     }
     if (function_exists('ob_start')) {
         ob_start();
     }
     /**
      * Output data
      */
     if ($this->include_bom && strtolower($this->output_encoding) == 'utf-8') {
         echo "";
     }
     $delimiter = '"' . $this->delimiter . '"';
     foreach ($this->data as $row) {
         if (strtolower($this->output_encoding) == 'utf-8') {
             echo '"' . implode($delimiter, (array) $row) . '"';
         } else {
             echo iconv('UTF-8', $this->output_encoding, '"' . implode($delimiter, (array) $row) . '"');
         }
         echo "\r\n";
     }
     if (function_exists('ob_end_flush')) {
         ob_end_flush();
     }
 }
Пример #3
0
function pdump($val)
{
    Tracy\Debugger::$productionMode = false;
    call_user_func_array('dump', func_get_args());
}
Пример #4
0
 public function __construct()
 {
     \Tracy\Debugger::$productionMode = TRUE;
 }
Пример #5
0
<?php

if (defined('DOING_AJAX') && DOING_AJAX) {
    Tracy\Debugger::$productionMode = TRUE;
}