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