r49433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49432‎ | r49433 | r49434 >
Date:05:29, 13 April 2009
Author:aaron
Status:ok
Tags:
Comment:
Disable extract for log items for speed
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -85,6 +85,7 @@
8686 $this->showImages();
8787 } else if( $this->deleteKey == 'logid' ) {
8888 $this->showLogItems();
 89+ return; // no logs for now
8990 }
9091 list($qc,$lim) = $this->getLogQueryCond();
9192 # Show relevant lines from the deletion log
@@ -121,8 +122,8 @@
122123
123124 private function getLogQueryCond() {
124125 $ids = $safeIds = array();
125 - $action = 'revision';
126126 $limit = 25; // default
 127+ $conds = array( 'log_action' => 'revision' ); // revision delete logs
127128 switch( $this->deleteKey ) {
128129 case 'oldid':
129130 $ids = $this->oldids;
@@ -136,13 +137,10 @@
137138 case 'fileid':
138139 $ids = $this->fileids;
139140 break;
140 - case 'logid':
 141+ default: // bad type?
141142 $ids = $this->logids;
142 - $action = 'event';
143 - break;
 143+ return array($conds,$limit);
144144 }
145 - // Revision delete logs
146 - $conds = array( 'log_action' => $action );
147145 // Just get the whole log if there are a lot if items
148146 if( count($ids) > $limit )
149147 return array($conds,$limit);
@@ -152,22 +150,9 @@
153151 $safeIds[] = $m[0];
154152 }
155153 }
156 - // Optimization for logs: the event was hidden after it was made
157 - if( $action == 'event' ) {
158 - $dbr = wfGetDB( DB_SLAVE );
159 - # Get the timestamp of the first item
160 - $first = $dbr->selectField( 'logging', 'log_timestamp',
161 - array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') );
162 - if( $first == false ) {
163 - return array( array('1=0'), $limit ); // If there are no items, then stop here
164 - }
165 - $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index
166 - }
167154 // Format is <id1,id2,i3...>
168155 if( count($safeIds) ) {
169 - // Log deletions do not have an item type, others do...
170 - $type = ($this->deleteKey != 'logid') ? "^{$this->deleteKey}.*" : '';
171 - $conds[] = "log_params RLIKE '$type(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'";
 156+ $conds[] = "log_params RLIKE '^{$this->deleteKey}.*(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'";
172157 } else {
173158 $conds = array('1=0');
174159 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r49434Remove extra code left in r49433aaron05:33, 13 April 2009

Status & tagging log