X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=file_run.php;h=1e8aa0ff0dd5b2278b19bbfa7f75b1e03411e2b5;hb=f58acc2fd5e5fbfb4a01d6b66711b2f62bf77c4a;hp=409b81d4fe43a574053fd828c2b48cd07460abad;hpb=856f805c6cbb6e712c662214f3b5821442f808a0;p=wfpl.git diff --git a/file_run.php b/file_run.php index 409b81d..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); } }