Download */ namespace qfq; use qfq; require_once(__DIR__ . '/../qfq/report/Download.php'); require_once(__DIR__ . '/../qfq/Constants.php'); require_once(__DIR__ . '/../qfq/exceptions/DownloadException.php'); require_once(__DIR__ . '/../qfq/exceptions/CodeException.php'); require_once(__DIR__ . '/../qfq/exceptions/DbException.php'); require_once(__DIR__ . '/../qfq/exceptions/ErrorHandler.php'); set_error_handler("\\qfq\\ErrorHandler::exception_error_handler"); $data = ''; try { try { $download = new \qfq\Download(); // If all is fine - 'process()' never returns! The output file is delivered and PHP is stopped after that. $data = $download->process(STORE_SIP, OUTPUT_MODE_DIRECT); } catch (qfq\CodeException $e) { $data = $e->formatMessage(); } catch (qfq\DbException $e) { $data = $e->formatMessage(); } catch (qfq\DownloadException $e) { $data = $e->formatMessage(); } } catch (\Exception $e) { $data = "Exception: " . $e->getMessage(); } echo $data;