X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=file_run.php;h=295900cbd530c65867279983ba9182f0ae4a991b;hb=e09ce518fa4526e8832d81e7693f30991abb0a48;hp=014cab510a39179698270e98ba891058d950d49b;hpb=6efe0372c5d3b2db723ada811917b6a52f13130b;p=wfpl.git diff --git a/file_run.php b/file_run.php index 014cab5..295900c 100644 --- a/file_run.php +++ b/file_run.php @@ -1,23 +1,19 @@ -. # This function makes it easier to put everything in functions like you should. @@ -33,15 +29,17 @@ # # the file db_password.php would be like so: # -# function db_password() { +# function db_password_main() { # return array('me', 'secret'); # } function file_run($filename) { - require_once($filename); - ereg_replace('.*/', '', $filename); - $func = basename($filename, '.php'); - return $func(); + require_once($filename); + $func = basename($filename, '.php') . '_main'; + + if(function_exists($func)) { + return $func(); + } } ?>