- Updated default filetypes used for system tags
[scuttle] / header.inc.php
index 1002aab5c2f640d274a51a93fc695df332d0ada8..d3c6ed898927f26e7cc5d5e6d4e7f57c13a94daa 100644 (file)
@@ -1,8 +1,4 @@
 <?php
-ini_set('display_errors', '1');
-ini_set('mysql.trace_mode', '0');
-
-error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
 session_start();
 
 require_once dirname(__FILE__) .'/services/servicefactory.php';
@@ -11,24 +7,34 @@ require_once dirname(__FILE__) .'/functions.inc.php';
 
 // Determine the base URL
 if (!isset($root)) {
-    $pieces = explode('/', $_SERVER['SCRIPT_NAME']);
-    $root   = '/';
-    foreach ($pieces as $piece) {
-        if ($piece != '' && !strstr($piece, '.php')) {
-            $root .= $piece .'/';
-        }
-    }
-    if (($root != '/') && (substr($root, -1, 1) != '/')) {
-        $root .= '/';
+  $pieces = explode('/', $_SERVER['SCRIPT_NAME']);
+  $root   = '/';
+  foreach ($pieces as $piece) {
+    if ($piece != '' && !strstr($piece, '.php')) {
+      $root .= $piece .'/';
     }
-    $path = $root;
+  }
+  if (($root != '/') && (substr($root, -1, 1) != '/')) {
+    $root .= '/';
+  }
+  $path = $root;
 
-    $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
-    $root     = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root;
+  $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
+  $root     = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root;
 }
 
 define('GENERAL_MESSAGE',  200);
 define('GENERAL_ERROR',    202);
 define('CRITICAL_MESSAGE', 203);
 define('CRITICAL_ERROR',   204);
-define('DEBUG',            TRUE);
+
+if (defined('SCUTTLE_DEBUG') && SCUTTLE_DEBUG) {
+  ini_set('display_errors',   '1');
+  ini_set('mysql.trace_mode', '1');
+  error_reporting(E_ALL);
+}
+else {
+  ini_set('display_errors',   '0');
+  ini_set('mysql.trace_mode', '0');
+  error_reporting(E_ALL);
+}
\ No newline at end of file

Benjamin Mako Hill || Want to submit a patch?