X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=file_run.php;h=e22e2bc096c797009b4c285547cf1394219651ec;hb=HEAD;hp=295900cbd530c65867279983ba9182f0ae4a991b;hpb=091b305bc836d52c27a8ab4ab6b6ba08b7aad9d3;p=wfpl.git diff --git a/file_run.php b/file_run.php index 295900c..e22e2bc 100644 --- a/file_run.php +++ b/file_run.php @@ -1,19 +1,9 @@ . +# This program is in the public domain within the United States. Additionally, +# we waive copyright and related rights in the work worldwide through the CC0 +# 1.0 Universal public domain dedication, which can be found at +# http://creativecommons.org/publicdomain/zero/1.0/ # This function makes it easier to put everything in functions like you should. @@ -33,13 +23,12 @@ # return array('me', 'secret'); # } -function file_run($filename) { +function file_run($filename /* args... */) { + $args = array_slice(func_get_args(), 1); require_once($filename); $func = basename($filename, '.php') . '_main'; if(function_exists($func)) { - return $func(); + return call_user_func_array($func, $args); } } - -?>