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; }
/** * 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(); } }
function pdump($val) { Tracy\Debugger::$productionMode = false; call_user_func_array('dump', func_get_args()); }
public function __construct() { \Tracy\Debugger::$productionMode = TRUE; }
<?php if (defined('DOING_AJAX') && DOING_AJAX) { Tracy\Debugger::$productionMode = TRUE; }