X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=file_run.php;h=d69b5b6a0c2264e5abcc180e40752ed582524216;hb=b0b28a4587992b92f47abb0429df0e1eaf7f151f;hp=409cb4b190ced6549a60e0d47b9cb4e6dee8394a;hpb=22d5fb7ab7d4ee86bd59e194387dca268bd577a1;p=wfpl.git diff --git a/file_run.php b/file_run.php index 409cb4b..d69b5b6 100644 --- a/file_run.php +++ b/file_run.php @@ -32,15 +32,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(); + } } ?>