From: Geoffrey T. D. <da...@us...> - 2001-11-21 20:01:55
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv25069/lib Modified Files: WikiCallback.php Log Message: New class: WikiAnonymousCb Index: WikiCallback.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiCallback.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** WikiCallback.php 2001/11/21 19:44:34 1.1 --- WikiCallback.php 2001/11/21 20:01:52 1.2 *************** *** 158,161 **** --- 158,189 ---- } + /** + * Anonymous function callback. + */ + class WikiAnonymousCb + extends WikiCallback + { + /** + * Constructor + * + * @param $args string Argument declarations + * @param $code string Function body + * @see create_function(). + * @access public + */ + function WikiAnonymousCb ($args, $code) { + $this->function = create_function($args, $code); + } + + function call_array ($args) { + return call_user_func_array($this->function, $args); + } + + function toPearCb() { + trigger_error("Can't convert WikiAnonymousCb to Pear callback", + E_USER_ERROR); + } + } + // (c-file-style: "gnu") // Local Variables: |