Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc76ce6
)
made file_run() able to pass args
author
Jason Woofenden
<jason@jasonwoof.com>
Thu, 18 Nov 2010 11:08:05 +0000
(06:08 -0500)
committer
Jason Woofenden
<jason@jasonwoof.com>
Thu, 18 Nov 2010 11:08:05 +0000
(06:08 -0500)
file_run.php
patch
|
blob
|
history
diff --git
a/file_run.php
b/file_run.php
index
295900c
..
e501668
100644
(file)
--- a/
file_run.php
+++ b/
file_run.php
@@
-33,12
+33,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);
}
}