* Added wfDie() wrapper, and some manual die(-1), to force the return code
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 1e850e7..3e9783b 100644 (file)
@@ -581,6 +581,16 @@ function wfErrorExit() {
        wfAbruptExit( true );
 }
 
+/**
+ * Print a simple message and die, returning nonzero to the shell if any.
+ * Plain die() fails to return nonzero to the shell if you pass a string.
+ * @param string $msg
+ */
+function wfDie( $msg='' ) {
+       echo $msg;
+       die( -1 );
+}
+
 /**
  * Die with a backtrace
  * This is meant as a debugging aid to track down where bad data comes from.
@@ -1763,4 +1773,5 @@ function wfRegexReplacement( $string ) {
        return $string;
 }
 
+
 ?>