Create webapp.php
This commit is contained in:
parent
e6553f919e
commit
0b5ffc1579
17
route/webapp.php
Normal file
17
route/webapp.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
$routes = read_route_all();
|
||||
$webapp_root = $_SERVER["DOCUMENT_ROOT"] . "webapp";
|
||||
|
||||
// set DOCUMENT_ROOT forcely
|
||||
$_SERVER["DOCUMENT_ROOT"] = $webapp_root;
|
||||
|
||||
// set file path
|
||||
$appfile_path = $webapp_root . "/" . implode("/", array_slice($routes, 1)) . ".php";
|
||||
|
||||
// load file
|
||||
if(file_exists($appfile_path)) {
|
||||
include($appfile_path);
|
||||
} else {
|
||||
set_error("404 Not Found");
|
||||
show_errors();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user