diff options
| author | Thomas BrĂ¼derli | 2007-01-03 11:54:51 +0000 | 
|---|---|---|
| committer | Thomas BrĂ¼derli | 2007-01-03 11:54:51 +0000 | 
| commit | 5b29e1817f32454d79c3efa9d2a7688d00a85fbd (patch) | |
| tree | e7ddd9446c7a6dc1f8254e995057393d5c78a34e | |
| parent | ef4267241d9ef3b397d9251a4f023a5d762f5571 (diff) | |
| download | itools-5b29e1817f32454d79c3efa9d2a7688d00a85fbd.tar.gz itools-5b29e1817f32454d79c3efa9d2a7688d00a85fbd.tar.bz2 itools-5b29e1817f32454d79c3efa9d2a7688d00a85fbd.zip  | |
Check if global function already exists before creating it
| -rw-r--r-- | html.class | 5 | 
1 files changed, 4 insertions, 1 deletions
@@ -81,7 +81,10 @@ function it_html($config = array())  	# Create global functions for methods that are statically callable (have same arguments as global stubs)  	foreach (explode(",", $this->_staticallycallable) as $func) -		$code[$func] = "function $func() { \$args = func_get_args(); return call_user_func_array(array(&\$GLOBALS['$this->_name'], '$func'), \$args); }"; +	{ +		if ($func && !function_exists($func)) +			$code[$func] = "function $func() { \$args = func_get_args(); return call_user_func_array(array(&\$GLOBALS['$this->_name'], '$func'), \$args); }"; +	}  	eval(join("", (array)$code));  |