r91514 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91513‎ | r91514 | r91515 >
Date:01:22, 6 July 2011
Author:reedy
Status:deferred
Tags:
Comment:
Remove some code, hacking up to test output formatting
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/ComScoreReachPercentageMetric.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -136,8 +136,6 @@
137137 $data = array();
138138
139139 $fields = array_map( array( $this, 'getColumnName' ), $query['fields'] );
140 - //$metricFields = $this->getMetricFields();
141 - //$metricTotals = array();
142140
143141 foreach( $res as $row ) {
144142 // Dump all data to output
@@ -145,52 +143,11 @@
146144 foreach( $fields as $field ) {
147145 $item[$field] = $row->$field;
148146 }
149 - $data[] = $item;
150 -
151 - // Do some maths
152 - //foreach( $metricFields as $field ) {
153 - // if ( !isset( $metricTotals[$field] ) ) {
154 - // $metricTotals[$field] = 0;
155 - // }
156 - // $metricTotals[$field] += $row->$field;
157 - //}
158 -
159 - // Make grouped output data
160 - foreach( $this->getAllowedFilters() as $filter ) {
161 - if ( !isset( $params[$filter] ) ) {
162 - continue;
163 - }
164 - if ( $params[$filter][0] === '*' ) {
165 - // For */"all", don't do any filtering
166 - continue;
167 - }
168 -
169 - $parsedFilter = $this->getAllUniqueParams( $params[$filter] );
170 - switch ( $filter ) {
171 - case 'selectregions':
172 - break;
173 - case 'selectcountries':
174 - break;
175 - case 'selectwebproperties':
176 - break;
177 - case 'selectprojects':
178 - break;
179 - case 'selectwikis':
180 - break;
181 - case 'selecteditors':
182 - break;
183 - case 'selectedits':
184 - break;
185 - case 'selectplatform':
186 - break;
187 - }
188 - }
 147+ $data[ $row->{$this->getColumnName( 'comscore.region_code' )} ][] = $item;
189148 }
190149
191150 $result->setIndexedTagName( $data, 'data' );
192 - //$result->setIndexedTagName( $metricTotals, 'totals' );
193151 $result->addValue( 'metric', $this->getModuleName(), $data );
194 - //$result->addValue( 'totals', $this->getModuleName(), $metricTotals );
195152 }
196153
197154 // TODO: Deal with foo AS bar, and return bar for nicer aliasing of stuff
Index: trunk/extensions/MetricsReporting/metrics/ComScoreReachPercentageMetric.php
@@ -13,7 +13,7 @@
1414 return array(
1515 'table' => array( 'comscore', 'comscore_regions'),
1616 'conds' => array(),
17 - 'options' => array( 'GROUP BY' => 'date', 'ORDER BY' => 'comscore.region_code, date' ),
 17+ 'options' => array( 'GROUP BY' => 'comscore.region_code, date', 'ORDER BY' => 'comscore.region_code, date' ),
1818 'join_conds' => array( 'comscore_regions' => array( 'LEFT JOIN', "comscore.region_code = comscore_regions.region_code" )
1919 ),
2020 );

Status & tagging log