includes/functions.php
changeset 500 455277559782
parent 481 07bf15b066bc
child 504 bc8e0e9ee01d
--- a/includes/functions.php	Sat Mar 15 00:08:01 2008 -0400
+++ b/includes/functions.php	Sat Mar 15 00:17:26 2008 -0400
@@ -550,6 +550,11 @@
 
   if ( ob_get_status() )
     ob_end_clean();
+  
+  if ( defined('ENANO_CLI') )
+  {
+    grinding_halt($t, $p);
+  }
 
   if ( $no_wrapper )
   {
@@ -609,9 +614,26 @@
 
   if ( is_object($db) )
     $db->close();
-
+  
   if ( ob_get_status() )
     ob_end_clean();
+  
+  if ( defined('ENANO_CLI') )
+  {
+    // set console color
+    echo "\x1B[31;1m";
+    // error title
+    echo "Critical error in Enano runtime: ";
+    // unbold
+    echo "$t\n";
+    // bold
+    echo "\x1B[37;1m";
+    echo "Error: ";
+    // unbold
+    echo "\x1B[0m";
+    echo "$p\n";
+    exit;
+  }
 
   $tpl = new template_nodb();
   $tpl->load_theme('oxygen', 'bleu');