r87169 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87168‎ | r87169 | r87170 >
Date:16:52, 30 April 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r87150

Reuse SpecialVersions arrayToString (made it explicitly public!) in an array_amp for the formatting of arrays/objects (Yay for all the different ways we accept things ;P)
Modified paths:
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -510,7 +510,7 @@
511511 foreach ( $myWgHooks as $hook => $hooks ) {
512512 $arr = array(
513513 'name' => $hook,
514 - 'subscribers' => $hooks,
 514+ 'subscribers' => array_map( array( 'SpecialVersion', 'arrayToString' ), $hooks ),
515515 );
516516
517517 $this->getResult()->setIndexedTagName( $arr['subscribers'], 's' );
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -564,9 +564,10 @@
565565 *
566566 * @return Mixed
567567 */
568 - static function arrayToString( $list ) {
569 - if( is_array( $list ) && count( $list ) == 1 )
 568+ public static function arrayToString( $list ) {
 569+ if( is_array( $list ) && count( $list ) == 1 ) {
570570 $list = $list[0];
 571+ }
571572 if( is_object( $list ) ) {
572573 $class = get_class( $list );
573574 return "($class)";

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87150* Get a list of all subscribed hooks, and those subscribers...reedy23:33, 29 April 2011

Status & tagging log