public static function setUri() { //mix and match, gets the job done, should be cleaned up self::$requestUri = ($qsa = strpos($_SERVER['REQUEST_URI'], '?')) ? substr($_SERVER['REQUEST_URI'], 0, $qsa) : $_SERVER['REQUEST_URI']; self::$requestA = array_slice(explode('/', self::$requestUri), 1); //setConfig("CMS_ROOT",substr($_SERVER['PHP_SELF'],0,-strlen('index.php'))); //script name = last item in array $a = explode("/", $_SERVER['PHP_SELF']); $t = $a[count($a) - 1]; /* if(isset($_SERVER["HTTP_REFERER"])){ $this->refA = explode("/",$_SERVER["HTTP_REFERER"]); $t = array_search($_SERVER['SERVER_NAME'],$this->refA); $this->refA = array_slice($this->refA, ($t+1)); } */ $tA = explode("/", substr($_SERVER['PHP_SELF'], 1, -(strlen($t) + 1))); define('BASE', substr($_SERVER['PHP_SELF'], 0, -strlen($t))); if ($tA[0] != '') { array_splice(self::$requestA, 0, count($tA)); /* if(isset($this->refA)){ $this->refA = array_slice($this->refA,count($tA)); } */ } self::$requestUri = '/' . join('/', self::$requestA); }