diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-10-03 15:10:09 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2014-10-03 15:10:09 +0200 |
commit | cc60fda68712f75ae98213858f0af6369fe18b1b (patch) | |
tree | 076725f14d71055012086006b725b81ff8de08dd | |
parent | 5b9d0d0168d9356fc7d944fb565cdbed85d659a1 (diff) |
WIP: Trap all errors and hide output before errorno-ouput-if-error
WIP: This buffers the whole output of the php based file downloader
which could be huge. Need to either use x-sendfile everywhere or find a
better solution.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | index.php | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -258,7 +258,19 @@ register_shutdown_function("check_for_fatal"); * And away we go... * */ -require_once BASEPATH.'core/CodeIgniter.php'; +try { + ob_start(); + require_once BASEPATH.'core/CodeIgniter.php'; + ob_end_flush(); +} catch (Exception $e) { + ob_end_clean(); + foreach (headers_list() as $header) { + $key = explode(":", $header)[0]; + header_remove($key); + } + _actual_exception_handler($e); + echo "Usage peak: ".format_bytes(memory_get_peak_usage()); +} /* End of file index.php */ /* Location: ./index.php */ |