$aPath = str_replace('index.php?q=', '', $aPath); $aPath = explode('/', $aPath); $i = 0; while ($aPath[$i] != 'fabriqinstall' && $i < count($aPath)) { $appPath .= $aPath[$i] . '/'; $i++; } $_FAPP['url'] = "http://{$_SERVER['HTTP_HOST']}"; $_FAPP['apppath'] = str_replace('//', '/', $appPath); } // require the core files FabriqStack::requireCore(); // check if user is logged in and if not give viewer // unathenticated role FabriqStack::checkUserStatus(); // determine the controller and action to render PathMap::map_path(); // determine which template to set initially FabriqTemplates::init(); // include the controller and action files if (file_exists('sites/' . FabriqStack::site() . '/app/controllers/application.controller.php')) { require_once 'sites/' . FabriqStack::site() . '/app/controllers/application.controller.php'; } else { require_once 'app/controllers/application.controller.php'; } FabriqStack::processQueue(); FabriqTemplates::render(); // close the database connection if ($installed) { $db->close(); }