r24227 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24226‎ | r24227 | r24228 >
Date:05:25, 18 July 2007
Author:amidaniel
Status:old
Tags:
Comment:
(bug 10602) API: Add two protected accessors to ApiMain allowing extending class to add to or override existing modules and formats.
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -481,6 +481,31 @@
482482 $vers[] = ApiFormatFeedWrapper :: getVersion(); // not accessible with format=xxx
483483 return $vers;
484484 }
 485+
 486+ /**
 487+ * Add or overwrite a module in this ApiMain instance. Intended for use by extending
 488+ * classes who wish to add their own modules to their lexicon or override the
 489+ * behavior of inherent ones.
 490+ *
 491+ * @access protected
 492+ * @param $mdlName String The identifier for this module.
 493+ * @param $mdlClass String The class where this module is implemented.
 494+ */
 495+ protected function addModule( $mdlName, $mdlClass ) {
 496+ $this->mModules[$mdlName] = $mdlClass;
 497+ }
 498+
 499+ /**
 500+ * Add or overwrite an output format for this ApiMain. Intended for use by extending
 501+ * classes who wish to add to or modify current formatters.
 502+ *
 503+ * @access protected
 504+ * @param $fmtName The identifier for this format.
 505+ * @param $fmtClass The class implementing this format.
 506+ */
 507+ protected function addFormat( $fmtName, $fmtClass ) {
 508+ $this->mFormats[$fmtName] = $fmtClass;
 509+ }
485510 }
486511
487512 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r24276Merged revisions 24213-24275 via svnmerge from...david20:20, 19 July 2007

Status & tagging log