X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=run.php;h=f77e7d026c710aa061551bbc60ee73dd8bb856d0;hb=a1011831f5cf76e4cb8b1c0b5c5332cd82ca2d7b;hp=dac7bc4d6fb95ec96d48e860c0fcfab1421548b9;hpb=a679272cb862dd647da227cc720cd4d4853887c0;p=wfpl.git diff --git a/run.php b/run.php index dac7bc4..f77e7d0 100644 --- a/run.php +++ b/run.php @@ -59,6 +59,10 @@ require_once('code/wfpl/file_run.php'); require_once('code/wfpl/http.php'); require_once('code/wfpl/template.php'); +if(file_exists('code/config.php')) { + file_run('code/config.php'); +} + function run_php($basename = false) { if(!$basename) { $basename = $_SERVER['REDIRECT_URL']; @@ -72,35 +76,51 @@ function run_php($basename = false) { $html_file = "$basename.html"; $php_file = "$basename.php"; - if(!file_exists($php_file)) { - if(file_exists($html_file)) { - readfile($html_file); + $html_exists = file_exists($html_file); + $php_exists = file_exists($php_file); + + if(!$php_exists && !$html_exists) { + header('HTTP/1.0 404 File Not Found'); + if(file_exists('404.php') || file_exists('404.html')) { + run_php('404'); } else { - header('HTTP/1.0 404 File Not Found'); - if(file_exists('404.php') || file_exists('404.html')) { - run_php('404'); - } else { - echo '