From: Timo Tijhof Date: Wed, 4 Jun 2014 04:06:17 +0000 (+0200) Subject: RCFeed: Use named types instead of exposing internal MW constant X-Git-Tag: 1.31.0-rc.0~15482 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=c0b0a12eab2df5934da2f8c11fb3c04d5b94464d;p=lhc%2Fweb%2Fwiklou.git RCFeed: Use named types instead of exposing internal MW constant Like we do in ApiQueryRecentChanges as well, expose the named rc.type property, not the internal integer constants. Change-Id: I89a948eee999032bb2e42cc23345affa879afb42 --- diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 370e109a87..60aba7ebd7 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -147,7 +147,7 @@ class RecentChange { case RC_NEW: $type = 'new'; break; - case RC_MOVE: + case RC_MOVE: // obsolete $type = 'move'; break; case RC_LOG: @@ -156,7 +156,7 @@ class RecentChange { case RC_EXTERNAL: $type = 'external'; break; - case RC_MOVE_OVER_REDIRECT: + case RC_MOVE_OVER_REDIRECT: // obsolete $type = 'move over redirect'; break; default: diff --git a/includes/rcfeed/MachineReadableRCFeedFormatter.php b/includes/rcfeed/MachineReadableRCFeedFormatter.php index 3f17bcd82a..d61b6c05fd 100644 --- a/includes/rcfeed/MachineReadableRCFeedFormatter.php +++ b/includes/rcfeed/MachineReadableRCFeedFormatter.php @@ -46,7 +46,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter { // but there is no real reason not to expose it in other cases, // and I can see how this may be potentially useful for clients. 'id' => $attrib['rc_id'], - 'type' => $attrib['rc_type'], + 'type' => RecentChange::parseFromRCType( $attrib['rc_type'] ), 'namespace' => $rc->getTitle()->getNamespace(), 'title' => $rc->getTitle()->getPrefixedText(), 'comment' => $attrib['rc_comment'],