Esempio n. 1
0
 /**
  * 	method:	initialise
  *
  * 	todo: write documentation
  */
 public static function initialise()
 {
     if (self::$is_initialised) {
         return;
     }
     $search = array_merge($_SERVER, $_GET);
     self::$pathList["__WEBSITE_ROOT__"] = $search["__WEBSITE_ROOT__"];
     self::$path = NULL;
     self::$base = self::getPath("__WEBSITE_ROOT__");
     if (self::$base) {
         //	Obtain the path within the website, without the website base
         //	we use this to calculate the path inside the website, not relative to the document root
         self::$path = Amslib_String::lchop($_SERVER["REQUEST_URI"], self::$base);
         self::$path = Amslib_String::rchop(self::$path, "?");
         self::$path = Amslib_File::reduceSlashes("/" . self::$path . "/");
     }
     //	Now automatically load the amslib routers configuration as the framework system
     //	This allows amslib to add routes the system can use to import/export router configurations
     //	This isn't part of your application, this is part of the system and used to self-configure
     self::load(Amslib::locate() . "/router/router.xml", "xml", "framework");
     self::$is_initialised = true;
     //	remove this from the $_GET superglobal, it's kind of annoying to keep finding it in the application code
     Amslib_GET::delete("__WEBSITE_ROOT__");
 }