-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlanucher.php
46 lines (37 loc) · 1.03 KB
/
lanucher.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of lanucher
*
* @author reza
*/
class lanucher {
public function __construct(){
$argString=str_replace("/"," ",$_SERVER['QUERY_STRING']);
$argString=trim(str_replace("&"," ",$argString));
if(empty($argString)){
$argString= "";
}
$arguments = explode(" ",$argString);
$filename = array_shift($arguments);
if(empty($arguments)){
echo "Welcome!\n";
die();
}
// $arguments[] = 'humans';
$controller = "db\\controller\\".array_shift($arguments)."Controller";
if(!file_exists($controller.".php")){
echo "$controller doesn't exists\n";
die();
// throw new \Exception("$controller doesn't exists");
}
$myController = new $controller($arguments);
}
public function run(){
}
//put your code here
}
?>