summaryrefslogtreecommitdiff
path: root/includes/api/ApiResult.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/api/ApiResult.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiResult.php')
-rw-r--r--includes/api/ApiResult.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php
index a8ca6046..798b2275 100644
--- a/includes/api/ApiResult.php
+++ b/includes/api/ApiResult.php
@@ -24,11 +24,6 @@
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( 'ApiBase.php' );
-}
-
/**
* This class represents the result of the API operations.
* It simply wraps a nested array() structure, adding some functions to simplify array's modifications.
@@ -246,11 +241,12 @@ class ApiResult extends ApiBase {
/**
* Add value to the output data at the given path.
- * Path is an indexed array, each element specifying the branch at which to add the new value
- * Setting $path to array('a','b','c') is equivalent to data['a']['b']['c'] = $value
- * If $name is empty, the $value is added as a next list element data[] = $value
+ * Path can be an indexed array, each element specifying the branch at which to add the new
+ * value. Setting $path to array('a','b','c') is equivalent to data['a']['b']['c'] = $value.
+ * If $path is null, the value will be inserted at the data root.
+ * If $name is empty, the $value is added as a next list element data[] = $value.
*
- * @param $path
+ * @param $path array|string|null
* @param $name string
* @param $value mixed
* @param $overwrite bool
@@ -259,6 +255,7 @@ class ApiResult extends ApiBase {
*/
public function addValue( $path, $name, $value, $overwrite = false ) {
global $wgAPIMaxResultSize;
+
$data = &$this->mData;
if ( $this->mCheckingSize ) {
$newsize = $this->mSize + self::size( $value );