Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/API/Proxy.php')
-rw-r--r--core/API/Proxy.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/API/Proxy.php b/core/API/Proxy.php
index 1d348e1b87..7e88841f2a 100644
--- a/core/API/Proxy.php
+++ b/core/API/Proxy.php
@@ -105,6 +105,9 @@ class Proxy extends Singleton
$doc = preg_replace("/(@package)[a-z _A-Z]*/", "", $doc);
$doc = preg_replace("/(@method).*/", "", $doc);
$doc = str_replace(array("\t", "\n", "/**", "*/", " * ", " *", " ", "\t*", " * @package"), " ", $doc);
+
+ // replace 'foo' and `bar` and "foobar" with code blocks... much magic
+ $doc = preg_replace('/`(.*?)`/', '<code>$1</code>', $doc);
$this->metadataArray[$className]['__documentation'] = $doc;
}
@@ -204,8 +207,16 @@ class Proxy extends Singleton
*/
Piwik::postEvent(sprintf('API.%s.%s', $pluginName, $methodName), array(&$finalParameters));
+ $apiParametersInCorrectOrder = array();
+
+ foreach ($parameterNamesDefaultValues as $name => $defaultValue) {
+ if (isset($finalParameters[$name]) || array_key_exists($name, $finalParameters)) {
+ $apiParametersInCorrectOrder[] = $finalParameters[$name];
+ }
+ }
+
// call the method
- $returnedValue = call_user_func_array(array($object, $methodName), $finalParameters);
+ $returnedValue = call_user_func_array(array($object, $methodName), $apiParametersInCorrectOrder);
$endHookParams = array(
&$returnedValue,
@@ -405,7 +416,7 @@ class Proxy extends Singleton
} catch (Exception $e) {
throw new Exception(Piwik::translate('General_PleaseSpecifyValue', array($name)));
}
- $finalParameters[] = $requestValue;
+ $finalParameters[$name] = $requestValue;
}
return $finalParameters;
}