protected function invoke_callback($function_name, array $parameters, $optional = false)
	{
		// call child function
		if (is_callable($function_name))
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($function_name, $parameters);
		}
		elseif (is_array($function_name) && method_exists($function_name[0], $function_name[1]))
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($function_name, $parameters);
		}
		elseif (method_exists($this, $function_name) )
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($this->$function_name, $parameters);
		}
		else if (function_exists($function_name))
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($function_name, $parameters);
		}
		else
		{
			if ($optional === false)
			{
				$this->log("Error there are no functions declared in scope to handle callback for function '" . $function_name . "'", self::LOG_LEVEL_CRIT);
			}
		}
	}
protected function invoke_callback($function_name, array $parameters, $optional = false)
	{
		// call child function
		if (is_callable($function_name))
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($function_name, $parameters);
		}
		elseif (is_array($function_name) && method_exists($function_name[0], $function_name[1]))
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($function_name, $parameters);
		}
		elseif (method_exists($this, $function_name) )
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($this->$function_name, $parameters);
		}
		else if (function_exists($function_name))
		{
			if (!is_array($parameters))
			{
				$parameters = array($parameters);
			}

			return call_user_func_array($function_name, $parameters);
		}
		else
		{
			if ($optional === false)
			{
				$this->log("Error there are no functions declared in scope to handle callback for function '" . $function_name . "'", self::LOG_LEVEL_CRIT);
			}
		}
	}
protected function invoke_callback ( $ function_name , array $ parameters , $ optional = false ) { // call child function if ( is_callable ( $ function_name ) ) { if ( ! is_array ( $ parameters ) ) { $ parameters = array ( $ parameters ) ; } return call_user_func_array ( $ function_name , $ parameters ) ; } elseif ( is_array ( $ function_name ) && method_exists ( $ function_name [ 0 ] , $ function_name [ 1 ] ) ) { if ( ! is_array ( $ parameters ) ) { $ parameters = array ( $ parameters ) ; } return call_user_func_array ( $ function_name , $ parameters ) ; } elseif ( method_exists ( $ this , $ function_name ) ) { if ( ! is_array ( $ parameters ) ) { $ parameters = array ( $ parameters ) ; } return call_user_func_array ( $ this -> $ function_name , $ parameters ) ; } else if ( function_exists ( $ function_name ) ) { if ( ! is_array ( $ parameters ) ) { $ parameters = array ( $ parameters ) ; } return call_user_func_array ( $ function_name , $ parameters ) ; } else { if ( $ optional === false ) { $ this -> log ( "Error there are no functions declared in scope to handle callback for function '" . $ function_name . "'" , self :: LOG_LEVEL_CRIT ) ; } } }
Invoke a call back function with parameters

Given the name of a function and parameters to send it, invoke the function.
This function will try using the objects inherited function if it exists.  If not,
it'll look for a declared function of the given name.

@access protected
@param string $function_name The name of the function to invoke.
@param array  $parameters    An array of parameters to pass to function.
@param bool   $optional      Is set to true, don't error if function_name not available.
@return mixed false on error, otherwise return of callback function
Invoke a call back function with parameters