summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-03 15:10:09 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-10-03 15:10:09 +0200
commitcc60fda68712f75ae98213858f0af6369fe18b1b (patch)
tree076725f14d71055012086006b725b81ff8de08dd
parent5b9d0d0168d9356fc7d944fb565cdbed85d659a1 (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.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/index.php b/index.php
index 00ab370c3..895c242ac 100644
--- a/index.php
+++ b/index.php
@@ -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 */