includes/common.php
changeset 500 455277559782
parent 470 a044ad834691
child 527 21e11f564463
--- a/includes/common.php	Sat Mar 15 00:08:01 2008 -0400
+++ b/includes/common.php	Sat Mar 15 00:17:26 2008 -0400
@@ -154,6 +154,16 @@
 global $timezone;
 $timezone = 0;
 
+// Divert to CLI loader if running from CLI
+if ( isset($argc) && isset($argv) )
+{
+  if ( is_int($argc) && is_array($argv) && !isset($_SERVER['REQUEST_URI']) )
+  {
+    require(ENANO_ROOT . '/includes/common_cli.php');
+    return;
+  }
+}
+
 // Because Enano sends out complete URLs in several occasions, we need to know what hostname the user is requesting the page from.
 // In future versions we may include a fallback "safety" host to use, but that's too much to worry about now
 if ( !isset($_SERVER['HTTP_HOST']) )