This commit is contained in:
Brian Buller 2012-06-11 12:30:26 -05:00
parent aed8ded16b
commit 24c67d5844
2 changed files with 7 additions and 2 deletions

View File

@ -11,3 +11,8 @@ $global_models = array();
// These are Libraries that we ALWAYS want loaded // These are Libraries that we ALWAYS want loaded
$global_libraries = array(); $global_libraries = array();
// This tells the system to throw away the first URI token
// For example, if the system is kept in:
// http://mysite.com/folder1/
// Then setting this should be set to 1
$starting_token = 1;

View File

@ -2,11 +2,10 @@
require_once('config.php'); require_once('config.php');
// We need the uri library for things to work
$global_libraries[] = "uri";
// Load up the base classes // Load up the base classes
require_once('core/Controller.php'); require_once('core/Controller.php');
require_once('core/Model.php'); require_once('core/Model.php');
// We need the uri library for things to work
require_once('core/uri_library.php'); require_once('core/uri_library.php');
// Load up the globals // Load up the globals
foreach($global_libraries as $alib) { foreach($global_libraries as $alib) {
@ -18,6 +17,7 @@ foreach($global_models as $amod) {
$uri = new Uri_library($_SERVER['REQUEST_URI']); $uri = new Uri_library($_SERVER['REQUEST_URI']);
$uri_array = $uri->getFullArray(); $uri_array = $uri->getFullArray();
while($starting_token-- > 0) { array_shift($uri_array); }
// Check if $uri->getItem(0) is a controller // Check if $uri->getItem(0) is a controller
if(file_exists('controllers/'.$uri_array[0].'_controller.php')) { if(file_exists('controllers/'.$uri_array[0].'_controller.php')) {
// File exists, set the cc_name and pop the uri_array // File exists, set the cc_name and pop the uri_array