r91101 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91100‎ | r91101 | r91102 >
Date:20:11, 29 June 2011
Author:reedy
Status:deferred
Tags:
Comment:
Fleshing out description type stuffs
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalytics.php (modified) (history)
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -27,6 +27,128 @@
2828 return $this->mDb;
2929 }
3030
 31+ /**
 32+ * @return array
 33+ */
 34+ public function getAllowedFilters() {
 35+ return array();
 36+ }
 37+
 38+ public function getAllowedParams() {
 39+ $params = array(
 40+ 'months' => 'string',
 41+ 'normalized' => 'bool',
 42+ 'data' => array(
 43+ ApiBase::PARAM_ISMULTI => true,
 44+ ApiBase::PARAM_TYPE => array(
 45+ 'timeseries',
 46+ 'timeseriesindexed',
 47+ 'percentagegrowthlastmonth',
 48+ 'percentagegrowthlasyyear',
 49+ 'percentagegrowthfullperiod',
 50+ ),
 51+ ),
 52+ 'reportlanguage' => array(
 53+ ApiBase::PARAM_DFLT => 'en',
 54+ ApiBase::PARAM_TYPE => array(
 55+ 'en',
 56+ ),
 57+ ),
 58+ );
 59+
 60+ $select = array(
 61+ 'selectregions' => array(
 62+ ApiBase::PARAM_ISMULTI => true,
 63+ ApiBase::PARAM_TYPE => array(
 64+ 'as',
 65+ 'c',
 66+ 'eu',
 67+ 'i',
 68+ 'la',
 69+ 'ma',
 70+ 'na',
 71+ 'us',
 72+ 'w',
 73+ ),
 74+ ),
 75+ 'selectcountries' => array(
 76+ ApiBase::PARAM_ISMULTI => false,
 77+ ApiBase::PARAM_TYPE => 'string',
 78+ ),
 79+ 'selectwebproperties' => array(
 80+ ApiBase::PARAM_ISMULTI => false,
 81+ ApiBase::PARAM_TYPE => 'string',
 82+ ),
 83+ 'selectprojects' => array(
 84+ ApiBase::PARAM_ISMULTI => false,
 85+ ApiBase::PARAM_TYPE => array(
 86+ 'wb',
 87+ 'wk',
 88+ 'wm',
 89+ 'wp',
 90+ 'wq',
 91+ 'ws',
 92+ 'wv',
 93+ 'co',
 94+ 'wx',
 95+ ),
 96+ ),
 97+ 'selectwikis' => array(
 98+ ApiBase::PARAM_ISMULTI => false,
 99+ ApiBase::PARAM_TYPE => 'string',
 100+ ),
 101+ 'selecteditors' => array(
 102+ ApiBase::PARAM_ISMULTI => false,
 103+ ApiBase::PARAM_TYPE => array(
 104+ 'a',
 105+ 'r',
 106+ 'b',
 107+ ),
 108+ ),
 109+ 'selectedits' => array(
 110+ ApiBase::PARAM_ISMULTI => false,
 111+ ApiBase::PARAM_TYPE => array(
 112+ 'm',
 113+ 'b',
 114+ ),
 115+ ),
 116+ 'selectplatforms' => array(
 117+ ApiBase::PARAM_ISMULTI => false,
 118+ ApiBase::PARAM_TYPE => array(
 119+ 'm',
 120+ 'n'
 121+ ),
 122+ ),
 123+ );
 124+
 125+ return array_merge( $params, array_intersect_key( $select, $this->getAllowedFilters() ) );
 126+ }
 127+
 128+ public function getParamDescription() {
 129+ return array(
 130+ 'months' => 'First and last month to include in time series',
 131+ 'normalized' => array(
 132+
 133+ ),
 134+ 'data' => array(
 135+
 136+ ),
 137+ 'reportlanguage' => '',
 138+ 'selectregions' => '',
 139+ 'selectcountries' => '',
 140+ 'selectwebproperties' => '',
 141+ 'selectprojects' => '',
 142+ 'selectwikis' => '',
 143+ 'selecteditors' => '',
 144+ 'selectedits' => '',
 145+ 'selectplatform' => '',
 146+ );
 147+ }
 148+
 149+ //public abstract function getDescription();
 150+
 151+ //protected abstract function getExamples();
 152+
31153 /*public function getPossibleErrors() {
32154 return array_merge( parent::getPossibleErrors(), array(
33155 ) );
Index: trunk/extensions/MetricsReporting/ApiAnalytics.php
@@ -45,7 +45,8 @@
4646 return array(
4747 'metric' => array(
4848 ApiBase::PARAM_ISMULTI => false,
49 - ApiBase::PARAM_TYPE => $this->metricModuleNames
 49+ ApiBase::PARAM_TYPE => $this->metricModuleNames,
 50+ ApiBase::PARAM_REQUIRED => true,
5051 ),
5152 );
5253 }
@@ -54,7 +55,8 @@
5556 return array(
5657 'metric' => array(
5758 'Type of data to collect',
58 - 'About metric names: these include source of data, to allow for alternate sources of similar metrics, which likely are defined differently or have other intrinsic issues (e.g. precision/reliability).'
 59+ 'About metric names: these include source of data, to allow for alternate sources of similar metrics,',
 60+ 'which likely are defined differently or have other intrinsic issues (e.g. precision/reliability).',
5961 ),
6062 );
6163 }

Status & tagging log