X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiResult.php;h=cd4165b6032583c2e983ffd4c4f28c8871d29b1c;hb=e9a09648dceb8ed37e90a85ffd7230358878b638;hp=608e9e1213a2d6cc084f5cb091cd79eb92b19313;hpb=a007bbecc25d5d1babf2af65ac983ff47e1b2720;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index 608e9e1213..cd4165b603 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -144,7 +144,7 @@ class ApiResult implements ApiSerializable { private $errorFormatter; // Deprecated fields - private $isRawMode, $checkingSize, $mainForContinuation; + private $checkingSize, $mainForContinuation; /** * @param int|bool $maxSize Maximum result "size", or false for no limit @@ -159,7 +159,6 @@ class ApiResult implements ApiSerializable { } $this->maxSize = $maxSize; - $this->isRawMode = false; $this->checkingSize = true; $this->reset(); } @@ -1205,27 +1204,23 @@ class ApiResult implements ApiSerializable { */ /** - * Call this function when special elements such as '_element' - * are needed by the formatter, for example in XML printing. + * Formerly used to enable/disable "raw mode". * @deprecated since 1.25, you shouldn't have been using it in the first place * @since 1.23 $flag parameter added * @param bool $flag Set the raw mode flag to this state */ public function setRawMode( $flag = true ) { - // Can't wfDeprecated() here, since we need to set this flag from - // ApiMain for BC with stuff using self::getIsRawMode as - // "self::getIsXMLMode". - $this->isRawMode = $flag; + wfDeprecated( __METHOD__, '1.25' ); } /** - * Returns true whether the formatter requested raw data. + * Returns true, the equivalent of "raw mode" is always enabled now * @deprecated since 1.25, you shouldn't have been using it in the first place * @return bool */ public function getIsRawMode() { - /// @todo: After Wikibase stops calling this, warn - return $this->isRawMode; + wfDeprecated( __METHOD__, '1.25' ); + return true; } /** @@ -1238,7 +1233,7 @@ class ApiResult implements ApiSerializable { return $this->getResultData( null, array( 'BC' => array(), 'Types' => array(), - 'Strip' => $this->isRawMode ? 'bc' : 'all', + 'Strip' => 'all', ) ); } @@ -1277,7 +1272,7 @@ class ApiResult implements ApiSerializable { */ public static function setElement( &$arr, $name, $value, $flags = 0 ) { wfDeprecated( __METHOD__, '1.25' ); - return self::setValue( $arr, $name, $value, $flags ); + self::setValue( $arr, $name, $value, $flags ); } /**