r91465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91464‎ | r91465 | r91466 >
Date:17:28, 5 July 2011
Author:reedy
Status:deferred
Tags:
Comment:
Add a few more TODO/commented out code
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -38,6 +38,8 @@
3939 $query = $this->getQueryInfo();
4040 $query['fields'] = $this->getQueryFields();
4141
 42+ // TODO: Do we need to do the dates as Like? (bleugh)
 43+ // Else, strtotime( '(First|Last) day of Month YYYY' )
4244 $db = $this->getDB();
4345 if ( $params['startmonth'] && !$params['endmonth'] ) {
4446 $query['conds']['date'] = $params['startmonth'];
@@ -90,6 +92,9 @@
9193 $query['conds']['country_code'] = $parsedFilter;
9294 break;
9395 case 'selectwebproperties':
 96+ /*if ( $params['authcode'] != 'some string' ) {
 97+ $this->dieUsage( 'Wrong code', 'badcode' );
 98+ }*/
9499 // c, d
95100 // TODO: Cater for "top:20" etc
96101 $query['conds']['web_property'] = $parsedFilter;
@@ -143,6 +148,7 @@
144149 $result->addValue( 'metric', $this->getModuleName(), $data );
145150 }
146151
 152+ // TODO: Deal with foo AS bar, and return bar for nicer aliasing of stuff
147153 /**
148154 * Looks to see if the column is fully qualified (table.column)
149155 * If is, return only the column name
@@ -261,7 +267,14 @@
262268 ),
263269 );
264270
265 - return array_merge( $params, array_intersect_key( $select, array_flip( $this->getAllowedFilters() ) ) );
 271+ $params = array_merge( $params, array_intersect_key( $select, array_flip( $this->getAllowedFilters() ) ) );
 272+
 273+ if ( isset( $params['selectwebproperties'] ) ) {
 274+ $params['authcode'] = array(
 275+ ApiBase::PARAM_TYPE => 'string',
 276+ );
 277+ }
 278+ return $params;
266279 }
267280
268281 public function getParamDescription() {
@@ -544,7 +557,7 @@
545558 ),
546559 'selectwebproperties' => array(
547560 '',
548 - 'This parameter requires extra authorisation',
 561+ 'This parameter requires extra authorisation.',
549562 ),
550563 'selectprojects' => array(
551564 'Which projects',
@@ -562,6 +575,7 @@
563576 'selecteditors' => 'a for anonymous, r for registered, b for bot',
564577 'selectedits' => 'm for manual, b for bot-induced',
565578 'selectplatform' => 'm for mobile, n for non-mobile',
 579+ 'authcode' => "Auth code needed for 'selectwebproperties'",
566580 );
567581 }
568582

Status & tagging log