X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=run.php;h=f77e7d026c710aa061551bbc60ee73dd8bb856d0;hb=a1011831f5cf76e4cb8b1c0b5c5332cd82ca2d7b;hp=c5ae240daf78dd08ddbc6199fc1e32da81891ac0;hpb=74fac1cb550d6a337c67cabdcfae4ad26e34f422;p=wfpl.git diff --git a/run.php b/run.php index c5ae240..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,36 +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 '