aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2010-04-19 12:35:20 +0200
committerLaurent Bachelier <laurent@bachelier.name>2010-04-19 12:35:20 +0200
commit456bb8ac656e6a4d3f1003efc8f825c9d71092f1 (patch)
treeff4391d80c56f7b4727a44cca98eeff72a819394
parentFix typo (diff)
downloadsymfttpd-456bb8ac656e6a4d3f1003efc8f825c9d71092f1.tar.xz
Fixes diplay of uncaught exceptions
PHP does not show uncaught exceptions in CLI and just exists. How can this be?! Working around it.
-rw-r--r--lib/bootstrap.php10
-rwxr-xr-xmksymlinks4
-rwxr-xr-xspawn4
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/bootstrap.php b/lib/bootstrap.php
new file mode 100644
index 0000000..0f0e708
--- /dev/null
+++ b/lib/bootstrap.php
@@ -0,0 +1,10 @@
+<?php
+error_reporting(E_ALL|E_STRICT);
+ini_set('display_errors', true);
+function handle_exception($e)
+{
+ echo "Fatal error:\n";
+ echo $e."\n";
+ exit(1);
+}
+set_exception_handler('handle_exception');
diff --git a/mksymlinks b/mksymlinks
index a365bee..67294a2 100755
--- a/mksymlinks
+++ b/mksymlinks
@@ -3,9 +3,7 @@
/**
* @author Laurent Bachelier <laurent@bachelier.name>
*/
-
-error_reporting(E_ALL|E_STRICT);
-
+require(dirname(__FILE__).'/lib/bootstrap.php');
require(dirname(__FILE__).'/lib/FileTools.php');
require(dirname(__FILE__).'/lib/MultiConfig.php');
require(dirname(__FILE__).'/lib/Symfony.php');
diff --git a/spawn b/spawn
index 4e520f7..1f22343 100755
--- a/spawn
+++ b/spawn
@@ -3,9 +3,7 @@
/**
* @author Laurent Bachelier <laurent@bachelier.name>
*/
-
-error_reporting(E_ALL|E_STRICT);
-
+require dirname(__FILE__).'/lib/bootstrap.php';
require dirname(__FILE__).'/lib/Argument.php';
require dirname(__FILE__).'/lib/Template.php';
require dirname(__FILE__).'/lib/FileTools.php';