X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=file_run.php;h=1e8aa0ff0dd5b2278b19bbfa7f75b1e03411e2b5;hb=912bdab05d6262ab07e7ea6664192f97239db3e1;hp=295900cbd530c65867279983ba9182f0ae4a991b;hpb=091b305bc836d52c27a8ab4ab6b6ba08b7aad9d3;p=wfpl.git diff --git a/file_run.php b/file_run.php index 295900c..1e8aa0f 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,12 +23,13 @@ # 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); } }