/* ==================================================================== Website initialization file v1.0.0 filename: _init.php date: January 22, 2008 author: John McClumpha (john@modularphp.com) purpose: used for setting up site variables, initiating php session and including modules revisions: 1.0.0 - Jan 22 2008 New version created for OO version of ModularPHP ==================================================================== */ /* start the session */ session_start(); // make sure the hostname includes the "www" //if(substr($_SERVER['HTTP_HOST'],0,3) != "www" && $_SERVER['HTTP_HOST'] != "localdev" && $_SERVER['HTTP_HOST'] != "asparagus.essentia.com.au" ) { // $newhost = "http://www." . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; // header("Location: " . $newhost); // exit; // } switch($_SERVER['HTTP_HOST']) { case "localdev"; case "asparagus.essentia.com.au"; case "192.168.10.110"; $basepath = "/var/www/phpstack-596603-5508512.cloudwaysapps.com.v2/"; // absolute path (local) $basedir = "/phpstack-596603-5508512.cloudwaysapps.com.v2/"; // absolute path within host break; case "www.essentia.com.au"; case "phpstack-596603-5508512.cloudwaysapps.com"; //case "68.168.96.213"; $basepath = ""; // absolute path (local) $basedir = "/"; // absolute path within host default: $basepath = ""; // absolute path (local) $basedir = "/"; // absolute path within host } $debugmode = false; // enable debug mode to show errors $timenow = time(); // current timestamp $absolutePath = "http://".$_SERVER['HTTP_HOST'].$basedir; // required (common) files $required[] = "Functions"; //$required[] = "PageBuild"; $required[] = "SendMail"; // modules (used throughout) $modules[] = "DataBase"; if (isset($required) && count($required)) { foreach ($required as $req) { require($basepath . "includes/" . $req . "/" . $req . ".req.php"); } } // modules (load dynamically) if (isset($modules) && count($modules)) { foreach ($modules as $module) { include_once($basepath . "includes/" . $module . "/" . $module . ".mod.php"); } } $globalEmailFrom = "info@essentia.com.au"; $globalEmailToName = "Essentia Group"; $globalEmailTo = "info@essentia.com.au"; $globalEmailCC = 'info@essentia.com.au'; //CheckActions(); ?>