X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateLogSearch.php;h=4c1a72e81ce0167c73150bd006d6a7e4b3f40802;hb=e36845aac66286ad9912d5d44ee7d226e7c4f616;hp=c6a5aff669c6a0092e00a3f2deef1433a58ae265;hpb=ea4340e126eb2657cc878af74d53b9991844fb6b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateLogSearch.php b/maintenance/populateLogSearch.php index c6a5aff669..4c1a72e81c 100644 --- a/maintenance/populateLogSearch.php +++ b/maintenance/populateLogSearch.php @@ -22,7 +22,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that makes the required database updates for populating the @@ -31,7 +31,12 @@ require_once( __DIR__ . '/Maintenance.php' ); * @ingroup Maintenance */ class PopulateLogSearch extends LoggedUpdateMaintenance { - static $tableMap = array( 'rev' => 'revision', 'fa' => 'filearchive', 'oi' => 'oldimage', 'ar' => 'archive' ); + private static $tableMap = array( + 'rev' => 'revision', + 'fa' => 'filearchive', + 'oi' => 'oldimage', + 'ar' => 'archive' + ); public function __construct() { parent::__construct(); @@ -51,11 +56,13 @@ class PopulateLogSearch extends LoggedUpdateMaintenance { $db = $this->getDB( DB_MASTER ); if ( !$db->tableExists( 'log_search' ) ) { $this->error( "log_search does not exist" ); + return false; } $start = $db->selectField( 'logging', 'MIN(log_id)', false, __FUNCTION__ ); if ( !$start ) { $this->output( "Nothing to do.\n" ); + return true; } $end = $db->selectField( 'logging', 'MAX(log_id)', false, __FUNCTION__ ); @@ -121,8 +128,8 @@ class PopulateLogSearch extends LoggedUpdateMaintenance { // Add item author relations... $log->addRelations( 'target_author_id', $userIds, $row->log_id ); $log->addRelations( 'target_author_ip', $userIPs, $row->log_id ); - // RevisionDelete logs - log events } elseif ( LogEventsList::typeAction( $row, $delTypes, 'event' ) ) { + // RevisionDelete logs - log events $params = LogPage::extractParams( $row->log_params ); // Param format: [ ] if ( count( $params ) < 1 ) { @@ -154,6 +161,7 @@ class PopulateLogSearch extends LoggedUpdateMaintenance { wfWaitForSlaves(); } $this->output( "Done populating log_search table.\n" ); + return true; } }