X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=www%2Findex.php;h=f8434a9ff4e7f4de392b25728ce024675e09dfc1;hb=7fffb0960436ff0cc2b1fb3642f7400e015244db;hp=4468e057bb7fbe2f7082d28fe6f9b2c9506cff3b;hpb=28d2c6d84af075263a89025b04df438cdd762658;p=readifood.git diff --git a/www/index.php b/www/index.php index 4468e05..f8434a9 100644 --- a/www/index.php +++ b/www/index.php @@ -8,12 +8,13 @@ $root = join(DIRECTORY_SEPARATOR, array($_SERVER['DOCUMENT_ROOT'], "..")); $propel_root = join(DIRECTORY_SEPARATOR, array($root, "propel")); $lib_root = join(DIRECTORY_SEPARATOR, array($root, "lib")); - require_once "propel/Propel.php"; + require_once(join(DIRECTORY_SEPARATOR, array($root, "vendor", "autoload.php"))); Propel::init("$propel_root/build/conf/$propel_project-conf.php"); - set_include_path(join(PATH_SEPARATOR, array("$propel_root/build/classes", get_include_path()))); + set_include_path(join(PATH_SEPARATOR, array(join(DIRECTORY_SEPARATOR, array($propel_root, "build", "classes")), get_include_path()))); - $request = preg_replace('!^/branches/[^/]+/!', "", $_SERVER['REQUEST_URI']); + $script_url = array_key_exists('SCRIPT_URL', $_SERVER) ? $_SERVER['SCRIPT_URL'] : $_SERVER['REDIRECT_URL']; + $request = preg_replace('!^/branches/[^/]+/!', "", $script_url); $request = preg_replace('!^/+!', "", $request); $request = preg_replace('!/+$!', "", $request); @@ -30,9 +31,10 @@ $http = (isset($_SERVER['HTTPS'])) ? "https" : "http"; $username = $_SERVER['REMOTE_USER']; - include_once("$lib_root/constants.php"); - include_once("$lib_root/functions.php"); - include_once("$lib_root/header.php"); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "constants.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "functions.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "session.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "header.php"))); $q = new UserQuery; $user = $q->findOneByUsername($username); if (! $q->count()) { @@ -45,10 +47,10 @@ $admin_level = $user->getAdmin(); if ($module) { echo "

$charity $module

\n"; - include_once("$lib_root/$module.php"); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "$module.php"))); } - #else include_once("$lib_root/menu.php"); + #else include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "menu.php"))); } - include_once("$lib_root/footer.php"); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "footer.php"))); ?>