* @since 3.0.0 */ class DownloadPage extends AjaxPage { /** @var string */ protected $sContent; /** * @inheritDoc */ public function add($sContent) { $this->sContent .= $sContent; } /** * @inheritDoc */ public function output() { $oKpi = new ExecutionKPI(); if (!empty($this->sContentType)) { $this->add_header('Content-type: '.$this->sContentType); } if (!empty($this->sContentDisposition)) { $this->add_header('Content-Disposition: '.$this->sContentDisposition.'; filename="'.$this->sContentFileName.'"'); } foreach ($this->a_headers as $s_header) { header($s_header); } $oKpi->ComputeAndReport(get_class($this).' output'); echo $this->sContent; $oKpi->ComputeAndReport('Echoing ('.round(strlen($this->sContent) / 1024).' Kb)'); ExecutionKPI::ReportStats(); } }