summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-16 01:49:32 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-16 01:49:32 -0400
commite1711bb0cf36a28c3c8b9047c0748432348e5ccb (patch)
tree4658f90e957dc29d6e7d37e07d7e5fd3fad10601
parent9e5a8b7e1fe2e0dbb4f0d7e0021e155f4f6ecb18 (diff)
error handler in xmppdaemon
darcs-hash:20080716054932-84dde-4c7c65cb1b5fb1d3b1b15409e092b40285d6cfd0.gz
-rwxr-xr-xxmppdaemon.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmppdaemon.php b/xmppdaemon.php
index 9aaa953fd..c8e2ba16f 100755
--- a/xmppdaemon.php
+++ b/xmppdaemon.php
@@ -18,6 +18,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+function xmppdaemon_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
+ print "Error $errno in $errfile[$errline]: $errstr\n";
+ die();
+}
+
+set_error_handler('xmppdaemon_error_handler');
+
# Abort if called from a web server
if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
print "This script must be run from the command line\n";