Libraryupgrader has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380189 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 ...................................................................... build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: Ic97c9bec3f405985a45547d9d2ec86dde91bfa0d --- M GetEquationsByQuery.php M MathObject.php M MathSearch.hooks.php M SpecialMathDownloadResult.php M SpecialUploadResult.php M composer.json M includes/ImportCsv.php M includes/special/SpecialDisplayTopics.php M maintenance/BatchExport.php M maintenance/ExportCache.php M maintenance/IndexBase.php M maintenance/QueryEval.php M maintenance/WmcRefIdentifier.php 13 files changed, 26 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch refs/changes/89/380189/1 diff --git a/GetEquationsByQuery.php b/GetEquationsByQuery.php index 292c01d..0bc85d7 100644 --- a/GetEquationsByQuery.php +++ b/GetEquationsByQuery.php @@ -57,7 +57,7 @@ $wgOut->addWikiText( "Displaying first 10 equation for query: <pre>" . var_export( $sqlFilter, true ) . '</pre>' ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'math' ], [ diff --git a/MathObject.php b/MathObject.php index fd3acea..aca736d 100644 --- a/MathObject.php +++ b/MathObject.php @@ -21,7 +21,7 @@ public static function hash2md5( $hash ) { // TODO: make MathRenderer::dbHash2md5 public - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $xhash = unpack( 'H32md5', $dbr->decodeBlob( $hash ) . " " ); return $xhash['md5']; } @@ -29,7 +29,7 @@ public static function findSimilarPages( $pid ) { global $wgOut; $out = ""; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); try { $res = $dbr->select( 'mathpagesimilarity', [ @@ -75,7 +75,7 @@ * @return self instance */ public static function constructformpage( $pid, $eid ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->selectRow( [ 'mathindex' ], self::dbIndexFieldsArray(), 'mathindex_revision_id = ' . $pid . ' AND mathindex_anchor= "' . $eid . '"' ); @@ -224,7 +224,7 @@ public function getObservations( $update = true ) { global $wgOut; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); try { $res = $dbr->select( [ "mathobservation", "mathvarstat", 'mathrevisionstat' ], [ @@ -334,7 +334,7 @@ * @return bool|ResultWrapper */ public function getNouns( $identifier ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $pageName = $this->getPageTitle(); if ( $pageName === false ) { return false; @@ -366,7 +366,7 @@ */ public function getAllOccurences( $currentOnly = true ) { $out = []; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'mathindex', self::dbIndexFieldsArray(), [ 'mathindex_inputhash' => $this->getInputHash() ] @@ -468,7 +468,7 @@ } public function getRelations() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $selection = $dbr->select( 'mathsemantics', [ 'identifier', 'evidence', 'noun' ], [ 'revision_id' => $this->revisionID ], __METHOD__, [ 'ORDER BY' => 'evidence desc' ] ); diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php index ab4eb15..44b5508 100644 --- a/MathSearch.hooks.php +++ b/MathSearch.hooks.php @@ -79,7 +79,7 @@ private static function updateIndex( $revId, $eid, $inputHash, $tex ) { if ( $revId > 0 && $eid ) { try { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $exists = $dbr->selectRow( 'mathindex', [ 'mathindex_revision_id', 'mathindex_anchor', 'mathindex_inputhash' ], [ diff --git a/SpecialMathDownloadResult.php b/SpecialMathDownloadResult.php index 113ce08..e4cdcc9 100644 --- a/SpecialMathDownloadResult.php +++ b/SpecialMathDownloadResult.php @@ -14,7 +14,7 @@ public static function run2CSV( $runId ) { $out = ImportCsv::getCsvColumnHeader() . "\n"; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'math_wmc_results', [ 'qId' , 'oldId' , 'fId' ], [ 'runId' => $runId ], diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php index d38d560..2cd8889 100644 --- a/SpecialUploadResult.php +++ b/SpecialUploadResult.php @@ -76,7 +76,7 @@ * @return array */ protected function printRunSelector( $type = 'selectorother' ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $formFields = []; $options = []; $uID = $this->getUser()->getId(); @@ -125,7 +125,7 @@ * @return bool|string */ function runValidatorFilter() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $uID = $this->getUser()->getId(); $res = $dbr->selectField( 'math_wmc_runs', 'runName', [ 'isDraft' => true, 'userID' => $uID, 'runId' => $this->runId ] ); @@ -214,7 +214,7 @@ */ private function displayFeedback() { $runId = $this->runId; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'l' => 'math_wmc_rank_levels', 'r' => 'math_wmc_ref', 'math_wmc_results' ], [ @@ -262,7 +262,7 @@ */ private function displayFormulaFeedback() { $runId = $this->runId; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'l' => 'math_wmc_rank_levels', 'r' => 'math_wmc_ref', 'math_wmc_results' ], [ diff --git a/composer.json b/composer.json index 6b670ed..607cc1e 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/includes/ImportCsv.php b/includes/ImportCsv.php index 2211b8a..680546e 100644 --- a/includes/ImportCsv.php +++ b/includes/ImportCsv.php @@ -224,7 +224,7 @@ if ( array_key_exists( $qId, $this->validQIds ) ) { return $this->validQIds[$qId]; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); if ( $dbr->selectField( 'math_wmc_ref', 'qId', [ 'qId' => $qId ] ) ) { $this->validQIds[$qId] = true; return true; @@ -240,7 +240,7 @@ * @return bool|mixed */ private function getInputHash( $pId, $eId ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); return $dbr->selectField( 'mathindex', 'mathindex_inputhash', [ 'mathindex_revision_id' => $pId, 'mathindex_anchor' => $eId ] ); } diff --git a/includes/special/SpecialDisplayTopics.php b/includes/special/SpecialDisplayTopics.php index f0eba48..e90318a 100644 --- a/includes/special/SpecialDisplayTopics.php +++ b/includes/special/SpecialDisplayTopics.php @@ -66,7 +66,7 @@ private function displayTopic( $query ) { $out = $this->getOutput(); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $qId = $dbr->selectField( 'math_wmc_ref', 'qId', [ 'qID' => $query ] ); if ( !$qId ) { $out->addWikiText( "Topic $query does not exist." ); @@ -124,7 +124,7 @@ */ private function printMostFrequentRuns( $qId ) { $out = $this->getOutput(); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->query( "select math_inputtex as rendering, count(distinct runs.userId) cntUser, @@ -157,7 +157,7 @@ private function printIndividualResults( $qId ) { $out = $this->getOutput(); $out->addWikiText( "== Individual results ==" ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); if ( !$dbr->tableExists( 'math_wmc_page_ranks' ) ) { MathSearchUtils::createEvaluationTables(); } diff --git a/maintenance/BatchExport.php b/maintenance/BatchExport.php index 117e5b2..271f4ca 100644 --- a/maintenance/BatchExport.php +++ b/maintenance/BatchExport.php @@ -49,7 +49,7 @@ $this->output( "{$dir} is not a directory.\n" ); exit( 1 ); } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // runId INT PRIMARY KEY AUTO_INCREMENT NOT NULL, // runName VARCHAR(45), // userId INT UNSIGNED, diff --git a/maintenance/ExportCache.php b/maintenance/ExportCache.php index 1fa1929..3ce95c6 100755 --- a/maintenance/ExportCache.php +++ b/maintenance/ExportCache.php @@ -59,7 +59,7 @@ */ private static function getMathTagsFromDatabase( $table , $offset , $length , $sort ) { $out = []; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $inputColumn = self::$inputColumns[ $table ]; $options = [ 'OFFSET' => $offset, diff --git a/maintenance/IndexBase.php b/maintenance/IndexBase.php index 270fad1..337b0ae 100644 --- a/maintenance/IndexBase.php +++ b/maintenance/IndexBase.php @@ -91,7 +91,7 @@ libxml_use_internal_errors( true ); $i = 0; $inc = $this->getArg( 1, 100 ); - $db = wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_REPLICA ); echo "getting list of all equations from the database\n"; $this->res = $db->select( [ 'mathindex', 'mathlatexml' ], [ diff --git a/maintenance/QueryEval.php b/maintenance/QueryEval.php index 7ba2697..6f6340e 100644 --- a/maintenance/QueryEval.php +++ b/maintenance/QueryEval.php @@ -84,7 +84,7 @@ $qId = $row->qId; $row->title = str_replace( [ 'π','ő' ], [ '$\\pi$', 'ö' ], $row->title ); $tName = $row->qId. ': {\\wikiLink{' . $row->title .'}{' . $row->oldId. '}{'.$row->fId.'}}'; - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( 'math_wmc_freq_hits', [ 'cntRun', 'cntUser' , 'links', 'minRank', 'rendering' ], [ 'qId' => $qId ] ); @@ -154,7 +154,7 @@ MathSearchUtils::createEvaluationTables(); $this->addExtensionTable( 'math_wmc_udf_create' ); $this->dbu->doUpdates( [ "extensions" ] ); - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // runId INT PRIMARY KEY AUTO_INCREMENT NOT NULL, // runName VARCHAR(45), // userId INT UNSIGNED, diff --git a/maintenance/WmcRefIdentifier.php b/maintenance/WmcRefIdentifier.php index fea53a3..4270e0f 100644 --- a/maintenance/WmcRefIdentifier.php +++ b/maintenance/WmcRefIdentifier.php @@ -31,7 +31,7 @@ * */ public function execute() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->query( 'SELECT qID, oldId, fid, math_inputtex FROM math_wmc_ref r' . ' JOIN mathlatexml l WHERE r.math_inputhash = l.math_inputhash;' ); -- To view, visit https://gerrit.wikimedia.org/r/380189 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic97c9bec3f405985a45547d9d2ec86dde91bfa0d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MathSearch Gerrit-Branch: master Gerrit-Owner: Libraryupgrader <tools.libraryupgra...@tools.wmflabs.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits