r68332 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68331‎ | r68332 | r68333 >
Date:17:48, 20 June 2010
Author:reedy
Status:ok
Tags:
Comment:
Nuke $db->freeResult() from Api stuffs
Modified paths:
  • /trunk/phase3/includes/api/ApiPageSet.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllCategories.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllUsers.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllpages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBacklinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategories.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategoryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategoryMembers.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryDuplicateFiles.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryExtLinksUsage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryExternalLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryFilearchive.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryIWBacklinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryIWLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLangLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryProtectedTitles.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRandom.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -248,7 +248,6 @@
249249 break;
250250 }
251251 }
252 - $db->freeResult( $res );
253252 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'page' );
254253 }
255254
Index: trunk/phase3/includes/api/ApiQueryAllLinks.php
@@ -145,7 +145,6 @@
146146 $pageids[] = $row->pl_from;
147147 }
148148 }
149 - $db->freeResult( $res );
150149
151150 if ( is_null( $resultPageSet ) ) {
152151 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'l' );
Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -271,7 +271,6 @@
272272
273273 $data[] = $val;
274274 }
275 - $db->freeResult( $res );
276275
277276 $this->getResult()->setIndexedTagName( $data, 'iw' );
278277 return $this->getResult()->addValue( 'query', $property, $data );
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -345,7 +345,6 @@
346346 break;
347347 }
348348 }
349 - $db->freeResult( $res );
350349 }
351350
352351 private function extractRowInfo( $row ) {
Index: trunk/phase3/includes/api/ApiQueryFilearchive.php
@@ -166,7 +166,6 @@
167167 break;
168168 }
169169 }
170 - $db->freeResult( $res );
171170
172171 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'fa' );
173172 }
Index: trunk/phase3/includes/api/ApiQueryExternalLinks.php
@@ -82,7 +82,6 @@
8383 break;
8484 }
8585 }
86 - $db->freeResult( $res );
8786 }
8887
8988 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
@@ -160,7 +160,6 @@
161161 }
162162 $lastSortKey = $row->cl_sortkey; // detect duplicate sortkeys
163163 }
164 - $db->freeResult( $res );
165164
166165 if ( is_null( $resultPageSet ) ) {
167166 $this->getResult()->setIndexedTagName_internal(
Index: trunk/phase3/includes/api/ApiQueryAllpages.php
@@ -174,7 +174,6 @@
175175 $resultPageSet->processDbRow( $row );
176176 }
177177 }
178 - $db->freeResult( $res );
179178
180179 if ( is_null( $resultPageSet ) ) {
181180 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'p' );
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -114,9 +114,6 @@
115115 }
116116 }
117117
118 - // Free the database record so the connection can get on with other stuff
119 - $db->freeResult( $res );
120 -
121118 $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
122119 }
123120
Index: trunk/phase3/includes/api/ApiPageSet.php
@@ -472,7 +472,6 @@
473473 // Store any extra fields requested by modules
474474 $this->processDbRow( $row );
475475 }
476 - $db->freeResult( $res );
477476
478477 if ( isset( $remaining ) ) {
479478 // Any items left in the $remaining list are added as missing
@@ -527,7 +526,6 @@
528527 $pageids[$pageid] = '';
529528 unset( $remaining[$revid] );
530529 }
531 - $db->freeResult( $res );
532530 $this->profileDBOut();
533531
534532 $this->mMissingRevIDs = array_keys( $remaining );
@@ -606,7 +604,7 @@
607605 }
608606 $this->mRedirectTitles[$from] = $to;
609607 }
610 - $db->freeResult( $res );
 608+
611609 if ( $this->mPendingRedirectIDs ) {
612610 // We found pages that aren't in the redirect table
613611 // Add them
Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -273,8 +273,6 @@
274274 }
275275 }
276276
277 - $db->freeResult( $res );
278 -
279277 /* Format the result */
280278 $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'rc' );
281279 }
Index: trunk/phase3/includes/api/ApiQueryAllCategories.php
@@ -117,7 +117,6 @@
118118 }
119119 }
120120 }
121 - $db->freeResult( $res );
122121
123122 if ( is_null( $resultPageSet ) ) {
124123 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'c' );
Index: trunk/phase3/includes/api/ApiQueryProtectedTitles.php
@@ -123,7 +123,7 @@
124124 $titles[] = $title;
125125 }
126126 }
127 - $db->freeResult( $res );
 127+
128128 if ( is_null( $resultPageSet ) ) {
129129 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), $this->getModulePrefix() );
130130 } else {
Index: trunk/phase3/includes/api/ApiQueryIWLinks.php
@@ -107,7 +107,6 @@
108108 break;
109109 }
110110 }
111 - $db->freeResult( $res );
112111 }
113112
114113 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryLinks.php
@@ -178,8 +178,6 @@
179179 }
180180 $resultPageSet->populateFromTitles( $titles );
181181 }
182 -
183 - $db->freeResult( $res );
184182 }
185183
186184 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryCategories.php
@@ -174,8 +174,6 @@
175175 }
176176 $resultPageSet->populateFromTitles( $titles );
177177 }
178 -
179 - $db->freeResult( $res );
180178 }
181179
182180 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryExtLinksUsage.php
@@ -141,7 +141,6 @@
142142 $resultPageSet->processDbRow( $row );
143143 }
144144 }
145 - $db->freeResult( $res );
146145
147146 if ( is_null( $resultPageSet ) ) {
148147 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ),
Index: trunk/phase3/includes/api/ApiQueryCategoryInfo.php
@@ -93,7 +93,6 @@
9494 break;
9595 }
9696 }
97 - $db->freeResult( $res );
9897 }
9998
10099 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryDuplicateFiles.php
@@ -121,7 +121,6 @@
122122 if ( !is_null( $resultPageSet ) ) {
123123 $resultPageSet->populateFromTitles( $titles );
124124 }
125 - $db->freeResult( $res );
126125 }
127126
128127 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryBacklinks.php
@@ -232,7 +232,6 @@
233233 $resultPageSet->processDbRow( $row );
234234 }
235235 }
236 - $db->freeResult( $res );
237236
238237 if ( $this->redirect && count( $this->redirTitles ) ) {
239238 $this->resetQueryParams();
@@ -258,7 +257,6 @@
259258 $resultPageSet->processDbRow( $row );
260259 }
261260 }
262 - $db->freeResult( $res );
263261 }
264262 if ( is_null( $resultPageSet ) ) {
265263 // Try to add the result data in one go and pray that it fits
Index: trunk/phase3/includes/api/ApiQueryIWBacklinks.php
@@ -111,7 +111,6 @@
112112 break;
113113 }
114114 }
115 - $db->freeResult( $res );
116115
117116 $this->getResult()->setIndexedTagName_internal(
118117 array( 'query', $this->getModuleName() ),
Index: trunk/phase3/includes/api/ApiQueryImages.php
@@ -120,8 +120,6 @@
121121 }
122122 $resultPageSet->populateFromTitles( $titles );
123123 }
124 -
125 - $db->freeResult( $res );
126124 }
127125
128126 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryRandom.php
@@ -87,7 +87,7 @@
8888 $resultPageSet->processDbRow( $row );
8989 }
9090 }
91 - $db->freeResult( $res );
 91+
9292 return $count;
9393 }
9494
Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -134,7 +134,6 @@
135135 $titles[] = Title::makeTitle( NS_IMAGE, $row->img_name );
136136 }
137137 }
138 - $db->freeResult( $res );
139138
140139 if ( is_null( $resultPageSet ) ) {
141140 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'img' );
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -171,8 +171,6 @@
172172 break;
173173 }
174174 }
175 - $db->freeResult( $res );
176 -
177175 $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
178176 }
179177
Index: trunk/phase3/includes/api/ApiQueryLangLinks.php
@@ -94,7 +94,6 @@
9595 break;
9696 }
9797 }
98 - $db->freeResult( $res );
9998 }
10099
101100 public function getAllowedParams() {
Index: trunk/phase3/includes/api/ApiQueryAllUsers.php
@@ -187,8 +187,6 @@
188188 }
189189 }
190190
191 - $db->freeResult( $res );
192 -
193191 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'u' );
194192 }
195193
Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -416,7 +416,6 @@
417417 }
418418 }
419419 }
420 - $db->freeResult( $res );
421420 }
422421
423422 // Get protections for missing titles
@@ -434,7 +433,6 @@
435434 'expiry' => Block::decodeExpiry( $row->pt_expiry, TS_ISO_8601 )
436435 );
437436 }
438 - $db->freeResult( $res );
439437 }
440438
441439 // Cascading protections
@@ -470,7 +468,6 @@
471469 'source' => $source->getPrefixedText()
472470 );
473471 }
474 - $db->freeResult( $res );
475472 }
476473
477474 if ( count( $images ) ) {
@@ -494,7 +491,6 @@
495492 'source' => $source->getPrefixedText()
496493 );
497494 }
498 - $db->freeResult( $res );
499495 }
500496 }
501497
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -202,8 +202,6 @@
203203 }
204204 }
205205
206 - $db->freeResult( $res );
207 -
208206 if ( is_null( $resultPageSet ) ) {
209207 $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
210208 } elseif ( $params['allrev'] ) {

Status & tagging log