Update webapp.php
This commit is contained in:
parent
2263dff0cf
commit
215beed570
|
@ -32,7 +32,7 @@ $self_filename = "";
|
|||
$routes = read_route_all();
|
||||
|
||||
// set path and URL
|
||||
$webapp_root = $_SERVER["DOCUMENT_ROOT"] . "webapp";
|
||||
$webapp_root = $_SERVER["DOCUMENT_ROOT"] . "/webapp";
|
||||
$webapp_url = base_url() . "webapp";
|
||||
|
||||
// set DOCUMENT_ROOT forcely
|
||||
|
@ -40,6 +40,7 @@ $_SERVER["DOCUMENT_ROOT"] = $webapp_root;
|
|||
|
||||
// set file path
|
||||
$appfile = $webapp_root . "/" . implode("/", $routes);
|
||||
|
||||
$appfile_path = $appfile . ".php";
|
||||
|
||||
// get end of routes
|
||||
|
@ -88,13 +89,15 @@ if($is_redirect_to_index == true) {
|
|||
if($is_static_file == true) {
|
||||
if(file_exists($appfile)) {
|
||||
set_header_content_type($end_era);
|
||||
header("Cache-Control: max-age=86400");
|
||||
|
||||
$fp = fopen($appfile, "r") or die("file does not exists");
|
||||
$fp = fopen($appfile, "r") or die("404 Not Found");
|
||||
while(!feof($fp)) {
|
||||
echo fread($fp, 8192);
|
||||
}
|
||||
fclose($fp);
|
||||
} else {
|
||||
echo "File Not Found";
|
||||
set_error("404 Not Found");
|
||||
show_errors();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user