- // retrieve parameter names, types and description from javadoc comments
-
- // function description
- $desc = '';
- // type of return val: by default 'any'
- $returns = Value::$xmlrpcValue;
- // desc of return val
- $returnsDocs = '';
- // type + name of function parameters
- $paramDocs = array();
-
- $docs = $func->getDocComment();
- if ($docs != '') {
- $docs = explode("\n", $docs);
- $i = 0;
- foreach ($docs as $doc) {
- $doc = trim($doc, " \r\t/*");
- if (strlen($doc) && strpos($doc, '@') !== 0 && !$i) {
- if ($desc) {
- $desc .= "\n";
- }
- $desc .= $doc;
- } elseif (strpos($doc, '@param') === 0) {
- // syntax: @param type [$name] desc
- if (preg_match('/@param\s+(\S+)(\s+\$\S+)?\s+(.+)/', $doc, $matches)) {
- if (strpos($matches[1], '|')) {
- //$paramDocs[$i]['type'] = explode('|', $matches[1]);
- $paramDocs[$i]['type'] = 'mixed';
- } else {
- $paramDocs[$i]['type'] = $matches[1];
- }
- $paramDocs[$i]['name'] = trim($matches[2]);
- $paramDocs[$i]['doc'] = $matches[3];
+ return false;
+ }
+ if ($func->isAbstract()) {
+ error_log('XML-RPC: method to be wrapped is abstract: ' . $plainFuncName);
+
+ return false;
+ }
+ /// @todo add more checks for static vs. nonstatic?
+ } else {
+ $func = new \ReflectionFunction($callable);
+ }
+ if ($func->isInternal()) {
+ // Note: from PHP 5.1.0 onward, we will possibly be able to use invokeargs
+ // instead of getparameters to fully reflect internal php functions ?
+ error_log('XML-RPC: function to be wrapped is internal: ' . $plainFuncName);
+
+ return false;
+ }
+
+ // retrieve parameter names, types and description from javadoc comments
+
+ // function description
+ $desc = '';
+ // type of return val: by default 'any'
+ $returns = Value::$xmlrpcValue;
+ // desc of return val
+ $returnsDocs = '';
+ // type + name of function parameters
+ $paramDocs = array();
+
+ $docs = $func->getDocComment();
+ if ($docs != '') {
+ $docs = explode("\n", $docs);
+ $i = 0;
+ foreach ($docs as $doc) {
+ $doc = trim($doc, " \r\t/*");
+ if (strlen($doc) && strpos($doc, '@') !== 0 && !$i) {
+ if ($desc) {
+ $desc .= "\n";
+ }
+ $desc .= $doc;
+ } elseif (strpos($doc, '@param') === 0) {
+ // syntax: @param type [$name] desc
+ if (preg_match('/@param\s+(\S+)(\s+\$\S+)?\s+(.+)/', $doc, $matches)) {
+ if ($matches[2] == '' && substr($matches[3], 0, 1) == '$') {
+ // syntax: @param type $name
+ $name = strtolower(trim($matches[3]));
+ $paramDocs[$name]['name'] = trim($matches[3]);
+ $paramDocs[$name]['doc'] = '';
+ } else {
+ $name = strtolower(trim($matches[2]));
+ $paramDocs[$name]['name'] = trim($matches[2]);
+ $paramDocs[$name]['doc'] = $matches[3];