Exemple #1
0
 function start($engine = true)
 {
     self::$site = str_replace('www.', '', $_SERVER['HTTP_HOST']);
     self::$query_string = urldecode($_SERVER['QUERY_STRING']);
     self::$request_uri = str_replace('?' . self::$query_string, '', urldecode($_SERVER['REQUEST_URI']));
     if (!self::$request_uri) {
         self::$request_uri = '/';
     }
     /*
     	Sections
     */
     self::$sections = explode('/', string::clearBoth(self::$request_uri));
     if (!self::$sections) {
         self::$sections[0] = '';
     }
     self::loadEngine();
     // load sites.ini
     if (self::$engine == 'web') {
         // redirects
         $redirect = false;
         $ini = ini::parse(SYS_ROOT . 'conf/global/sites.ini', 'redirects');
         if ($ini) {
             $redirect = arrays::returnValue($ini, self::$site);
             if ($redirect) {
                 headers::site($redirect);
             }
         }
         // mirrors
         $ini = ini::get('mirrors');
         if ($ini) {
             $mirror = arrays::returnValue($ini, self::$site);
             if ($mirror) {
                 self::$site = $mirror;
             }
         }
     }
     self::setConst();
     if ($engine) {
         load::engine(ENGINE);
     }
 }