diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 35 |
1 files changed, 4 insertions, 31 deletions
@@ -11,25 +11,13 @@ if (file_exists($xss_file)) { exit(); } } +unset($xss_file); -// Decide where to look for things. //////////////////////////////////////////// -define('LIBPATH', BASEPATH.'/src/lib'.PATH_SEPARATOR.BASEPATH.'/src/ext'); -define('MODELPATH', BASEPATH.'/src/models'); -define('VIEWPATH', BASEPATH.'/src/views');// views are not objects -define('CONTROLLERPATH',BASEPATH.'/src/controllers'); -define('PLUGINPATH', BASEPATH.'/src/plugins'); - -set_include_path(get_include_path() - .PATH_SEPARATOR.LIBPATH - .PATH_SEPARATOR.MODELPATH - .PATH_SEPARATOR.CONTROLLERPATH - .PATH_SEPARATOR.PLUGINPATH - ); +require_once(BASEPATH.'/stub.php'); // Figure what page is trying to be loaded. //////////////////////////////////// // We don't have to do any check if it's a real file being looked for, if the // requested page exists as a real file, .htaccess won't even let us load -// thisfile. @$PAGE_RAW = $_GET['p']; $PAGE_PARTS = explode('/', $PAGE_RAW); $FILE = array_pop($PAGE_PARTS); @@ -42,27 +30,12 @@ if (preg_match($regex, $FILE, $matches)) { } else { $PAGE = $PAGE_RAW; } +unset($PAGE_RAW); unset($PAGE_PARTS); unset($FILE); unset($regex); + if ($PAGE=='') $PAGE = 'index'; define('PAGE', $PAGE); unset($PAGE); define('PAGE_EXT', $EXT); unset($EXT); -// Include base MVC classes //////////////////////////////////////////////////// -require_once('Model.class.php'); -require_once('View.class.php'); -require_once('Controller.class.php'); - -// Check if we have a database configuration /////////////////////////////////// -$conf_file = BASEPATH.'/conf.php'; -if (file_exists($conf_file)) { - require_once('Database.class.php'); - new Database($conf_file); - session_start(); -} else { - $view = new View('no-conf'); - $view->show(array()); - exit(); -} - // Kludgy ugly hacky hack ////////////////////////////////////////////////////// require_once('ContactMethod.class.php'); require(BASEPATH.'/conf-contacts.php'); |