From 63de8cae6a1b19f5c56c67b4ad80506e3340c99a Mon Sep 17 00:00:00 2001 From: Hash9 Date: Sun, 20 Aug 2006 22:39:22 +0000 Subject: add invokeServiceFunctionR call until a generalisation can be desided --- LibertySystem.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'LibertySystem.php') diff --git a/LibertySystem.php b/LibertySystem.php index bc095da..9d2a316 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.38 2006/08/18 17:37:13 wjames5 Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.39 2006/08/20 22:39:22 hash9 Exp $ * @author spider */ @@ -385,6 +385,28 @@ class LibertySystem extends LibertyBase { return $ret; } + /** + * Return an associate array of the non empty return values of all the functions with the given arguments + * + * @param $pFunction the liberty name of the function to invoke + * @param $pArgs an array of arguments to the function + * @return array an associate array of the non empty return values + */ + function invokeServiceFunctionR($pFunction,$pArgs) { + $ret = array(); + if( $funcs = $this->getServiceValues( $pFunction ) ) { + foreach( $funcs as $serv => $func ) { + if( function_exists( $func ) ) { + $v = call_user_func_array($func,$pArgs); + if (!empty($v)) { + $ret[$serv] =$v; + } + } + } + } + return $ret; + } + // ****************************** Miscellaneous Functions /** * Get the URL to the icon for the mime type passed in. This should probably check for files of multiple image types instead of just jpg -- cgit v1.3