4 require_once dirname(__FILE__) .'/services/servicefactory.php';
5 require_once dirname(__FILE__) .'/config.inc.php';
6 require_once dirname(__FILE__) .'/functions.inc.php';
8 // Determine the base URL
10 $pieces = explode('/', $_SERVER['SCRIPT_NAME']);
12 foreach ($pieces as $piece) {
13 if ($piece != '' && !strstr($piece, '.php')) {
17 if (($root != '/') && (substr($root, -1, 1) != '/')) {
22 $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
23 $root = $protocol .'://'. $_SERVER['HTTP_HOST'] . $root;
26 define('GENERAL_MESSAGE', 200);
27 define('GENERAL_ERROR', 202);
28 define('CRITICAL_MESSAGE', 203);
29 define('CRITICAL_ERROR', 204);
31 if (defined('SCUTTLE_DEBUG') && SCUTTLE_DEBUG) {
32 ini_set('display_errors', '1');
33 ini_set('mysql.trace_mode', '1');
34 error_reporting(E_ALL);
37 ini_set('display_errors', '0');
38 ini_set('mysql.trace_mode', '0');
39 error_reporting(E_ALL);
40 //PHP5.4 PHP Notice: Undefined variable: PHP7 STOP deprecated and Warning
41 error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_USER_WARNING);