diff --git a/images/proxy.php b/images/proxy.php new file mode 100644 index 0000000..1dcb13e --- /dev/null +++ b/images/proxy.php @@ -0,0 +1,43 @@ +getURLRoot())); + +$custom_file = $oConf->getPathCustom($file_path); +$native_file = $oConf->getPathRoot($file_path); + +if(file_exists($custom_file)){ + $file = $custom_file; +} elseif(file_exists($native_file)) { + $file = $native_file; +} else { + header('HTTP/1.1 404 Not found', true); + exit(0); +} + +$is_css = preg_match('/\.css$/', $file); +$is_js = preg_match('/\.js$/', $file); +$is_php = preg_match('/\.php$/', $file); + +if($is_php){ + include($file); + exit(0); +} else if($is_css){ + $type = 'text/css'; +} else if($is_js){ + $type = 'text/javascript'; +} else { + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $type = finfo_file($finfo, $file); + finfo_close($finfo); +} + +header('Content-Type: ' . $type, true); + +echo file_get_contents($file); diff --git a/proxy.php b/proxy.php new file mode 100644 index 0000000..1dcb13e --- /dev/null +++ b/proxy.php @@ -0,0 +1,43 @@ +getURLRoot())); + +$custom_file = $oConf->getPathCustom($file_path); +$native_file = $oConf->getPathRoot($file_path); + +if(file_exists($custom_file)){ + $file = $custom_file; +} elseif(file_exists($native_file)) { + $file = $native_file; +} else { + header('HTTP/1.1 404 Not found', true); + exit(0); +} + +$is_css = preg_match('/\.css$/', $file); +$is_js = preg_match('/\.js$/', $file); +$is_php = preg_match('/\.php$/', $file); + +if($is_php){ + include($file); + exit(0); +} else if($is_css){ + $type = 'text/css'; +} else if($is_js){ + $type = 'text/javascript'; +} else { + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $type = finfo_file($finfo, $file); + finfo_close($finfo); +} + +header('Content-Type: ' . $type, true); + +echo file_get_contents($file);