X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=file_run.php;h=bca5c1846fcac944d61f10d00a3527e078e77cc6;hb=48805cdb3501fc558a68a31f2aed2f6ad716e297;hp=409cb4b190ced6549a60e0d47b9cb4e6dee8394a;hpb=8355c5788f7179a3674ab1121c859530e838bb64;p=wfpl.git diff --git a/file_run.php b/file_run.php index 409cb4b..bca5c18 100644 --- a/file_run.php +++ b/file_run.php @@ -32,15 +32,18 @@ # # 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)) { + $func = basename($filename, '.php'); + } + + return $func(); } ?>