<?
class Module{
static private $instance = NULL;
public $url = array();
public function __construct(){
/*if (preg_match ("/([^a-zA-Z0-9\.\=\+\?\!\/\&\%\-\_\#])/", $_SERVER['REQUEST_URI'])) {
header("Location:/Lunapark/");
die();
}*/
$this->url = preg_split ("/(\/|\..*$)/", $_SERVER['REQUEST_URI'],-1, PREG_SPLIT_NO_EMPTY);
}
static function a(){
if(self::$instance==NULL)self::$instance=new Module();
return self::$instance;
}
public function getModule(){
if (empty($this->url)) {
include_once"modules/index.php";
die();
}
if(!file_exists("modules/".strtolower($this->url[0])."/index.php")){
header("Location:/Lunapark/");
die();
}
include_once"modules/".strtolower($this->url[0])."/index.php";
die();
}
}
?>