r55770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55769‎ | r55770 | r55771 >
Date:16:15, 3 September 2009
Author:daniel
Status:ok
Tags:
Comment:
adding public access methods for use by XMLRC extension.
Modified paths:
  • /trunk/phase3/includes/RecentChange.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RecentChange.php
@@ -585,6 +585,10 @@
586586 return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : NULL;
587587 }
588588
 589+ public function getAttributes() {
 590+ return $this->mAttribs;
 591+ }
 592+
589593 /**
590594 * Gets the end part of the diff URL associated with this object
591595 * Blank if no diff link should be displayed
Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -82,6 +82,23 @@
8383 }
8484
8585 /**
 86+ * Sets internal state to include the desired properties in the output.
 87+ * @param $prop associative array of properties, only keys are used here
 88+ */
 89+ public function initProperties( $prop ) {
 90+ $this->fld_comment = isset ($prop['comment']);
 91+ $this->fld_user = isset ($prop['user']);
 92+ $this->fld_flags = isset ($prop['flags']);
 93+ $this->fld_timestamp = isset ($prop['timestamp']);
 94+ $this->fld_title = isset ($prop['title']);
 95+ $this->fld_ids = isset ($prop['ids']);
 96+ $this->fld_sizes = isset ($prop['sizes']);
 97+ $this->fld_redirect = isset($prop['redirect']);
 98+ $this->fld_patrolled = isset($prop['patrolled']);
 99+ $this->fld_loginfo = isset($prop['loginfo']);
 100+ }
 101+
 102+ /**
86103 * Generates and outputs the result of this query based upon the provided parameters.
87104 */
88105 public function execute() {
@@ -164,16 +181,7 @@
165182 $prop = array_flip($params['prop']);
166183
167184 /* Set up internal members based upon params. */
168 - $this->fld_comment = isset ($prop['comment']);
169 - $this->fld_user = isset ($prop['user']);
170 - $this->fld_flags = isset ($prop['flags']);
171 - $this->fld_timestamp = isset ($prop['timestamp']);
172 - $this->fld_title = isset ($prop['title']);
173 - $this->fld_ids = isset ($prop['ids']);
174 - $this->fld_sizes = isset ($prop['sizes']);
175 - $this->fld_redirect = isset($prop['redirect']);
176 - $this->fld_patrolled = isset($prop['patrolled']);
177 - $this->fld_loginfo = isset($prop['loginfo']);
 185+ $this->initProperties( $prop );
178186
179187 global $wgUser;
180188 if($this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol())
@@ -245,9 +253,9 @@
246254 *
247255 * @param $row The row from which to extract the data.
248256 * @return An array mapping strings (descriptors) to their respective string values.
249 - * @access private
 257+ * @access public
250258 */
251 - private function extractRowInfo($row) {
 259+ public function extractRowInfo($row) {
252260 /* If page was moved somewhere, get the title of the move target. */
253261 $movedToTitle = false;
254262 if (isset($row->rc_moved_to_title) && $row->rc_moved_to_title !== '')

Status & tagging log