Tagged 0.7.5
[scuttle] / header.inc.php
1 <?php
2 ini_set('display_errors', '1');
3 ini_set('mysql.trace_mode', '0');
4
5 error_reporting(E_ALL ^ E_NOTICE);
6
7 define('DEBUG', true);
8 session_start();
9
10 require_once dirname(__FILE__) .'/services/servicefactory.php';
11 require_once dirname(__FILE__) .'/config.inc.php';
12 require_once dirname(__FILE__) .'/functions.inc.php';
13
14 // Determine the base URL
15 if (!isset($root)) {
16     $pieces = explode('/', $_SERVER['SCRIPT_NAME']);
17     $root   = '/';
18     foreach ($pieces as $piece) {
19         if ($piece != '' && !strstr($piece, '.php')) {
20             $root .= $piece .'/';
21         }
22     }
23     if (($root != '/') && (substr($root, -1, 1) != '/')) {
24         $root .= '/';
25     }
26     $path = $root;
27
28     $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
29     $root     = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root;
30 }
31
32 // Error codes
33 define('GENERAL_MESSAGE',  200);
34 define('GENERAL_ERROR',    202);
35 define('CRITICAL_MESSAGE', 203);
36 define('CRITICAL_ERROR',   204);

Benjamin Mako Hill || Want to submit a patch?