Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/186634
Change subject: Replace useless double-quotes with single-quotes ...................................................................... Replace useless double-quotes with single-quotes Change-Id: Id8905cfff375a2b01d2dabfeb3035d65907762c0 --- M maintenance/BatchExport.php M maintenance/BatchImport.php M maintenance/CalculateDistances.php M maintenance/CleanMathTable.php M maintenance/CreateBaseXMathTable.php M maintenance/CreateDB2MathTable.php M maintenance/CreateMWSHarvest.php M maintenance/ExtractFeatures.php M maintenance/GenerateFeatureTable.php M maintenance/GenerateWorkload.php M maintenance/IndexBase.php M maintenance/MathMLFilter.php M maintenance/UpdateMath.php 13 files changed, 103 insertions(+), 103 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch refs/changes/34/186634/1 diff --git a/maintenance/BatchExport.php b/maintenance/BatchExport.php index 1ef82cb..c45a1a9 100644 --- a/maintenance/BatchExport.php +++ b/maintenance/BatchExport.php @@ -32,7 +32,7 @@ parent::__construct(); $this->mDescription = "Exports submissions to a folder. \n Each run is named after the following convention: \n \$userName-\$runName-\$runId.csv"; - $this->addArg( "dir", "The output directory", true ); + $this->addArg( 'dir', 'The output directory', true ); } /** @@ -49,7 +49,7 @@ //runName VARCHAR(45), //userId INT UNSIGNED, //isDraft TINYINT NOT NULL, - $res = $dbr->select( "math_wmc_runs", "*" ); + $res = $dbr->select( 'math_wmc_runs', '*' ); //TODO: Implement support for isDraft. foreach ( $res as $row ) { $user = User::newFromId( $row->userId ); @@ -64,6 +64,6 @@ } } -$maintClass = "BatchExport"; +$maintClass = 'BatchExport'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/BatchImport.php b/maintenance/BatchImport.php index 7b641a8..1f4f721 100644 --- a/maintenance/BatchImport.php +++ b/maintenance/BatchImport.php @@ -35,8 +35,8 @@ parent::__construct(); $this->mDescription = "Batch imports submissions from a folder. \n Processes CSV files that follow the naming convention: \n \$userName-\$runName.csv"; - $this->addArg( "dir", "The directory to be read", true ); - $this->addOption( "overwrite", "Overwrite existing runs with the same name.", false, false, + $this->addArg( 'dir', 'The directory to be read', true ); + $this->addOption( 'overwrite', 'Overwrite existing runs with the same name.', false, false, "o" ); } @@ -53,10 +53,10 @@ $this->output( "{$this->dir} is not a directory.\n" ); exit( 1 ); } - $files = new GlobIterator( $this->dir . "/*-*.csv" ); + $files = new GlobIterator( $this->dir . '/*-*.csv' ); foreach ( $files as $file ) { $fn = $file->getFilename(); - if ( preg_match( "/(?P<user>.*?)-(?P<runName>.*?)\\.csv/", $fn, $matches ) ) { + if ( preg_match( '/(?P<user>.*?)-(?P<runName>.*?)\\.csv/', $fn, $matches ) ) { $user = User::newFromName( $matches['user'] ); if ( $user->getId() > 0 ) { $this->output( "Importing filename $fn for userId {$user->getId()}.\n" ); @@ -80,6 +80,6 @@ } } -$maintClass = "BatchImport"; +$maintClass = 'BatchImport'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/CalculateDistances.php b/maintenance/CalculateDistances.php index 2477a67..d377aa8 100644 --- a/maintenance/CalculateDistances.php +++ b/maintenance/CalculateDistances.php @@ -19,7 +19,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' ); +require_once( __DIR__ . '/../../../maintenance/Maintenance.php' ); /** * Class CalculateDistances @@ -42,9 +42,9 @@ parent::__construct(); $this->mDescription = 'Outputs page text to stdout'; $this->addOption( 'page9', 'Ignore pages with only 9 equations or less.', false, false, - "9" ); - $this->addArg( 'min', "If set processing is started at the page with curid>min", false ); - $this->addArg( 'max', "If set processing is stopped at the page with curid<=max", false ); + '9' ); + $this->addArg( 'min', 'If set processing is started at the page with curid>min', false ); + $this->addArg( 'max', 'If set processing is stopped at the page with curid<=max', false ); } /** @@ -110,11 +110,11 @@ } $start = microtime( true ); $this->dbw->commit(); - echo " committed in " . ( microtime( true ) - $start ) . "s\n\n"; + echo ' committed in ' . ( microtime( true ) - $start ) . "s\n\n"; } } } -$maintClass = "CalculateDistances"; +$maintClass = 'CalculateDistances'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/CleanMathTable.php b/maintenance/CleanMathTable.php index 10e28a7..41fc632 100644 --- a/maintenance/CleanMathTable.php +++ b/maintenance/CleanMathTable.php @@ -19,7 +19,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' ); +require_once( __DIR__ . '/../../../maintenance/Maintenance.php' ); /** * Class CleanMathTable @@ -40,8 +40,8 @@ parent::__construct(); $this->mDescription = 'Outputs page text to stdout'; $this->addOption( 'purge', - "If set all formulae are rendered again from strech. (Very time consuming!)", false, - false, "f" ); + 'If set all formulae are rendered again from strech. (Very time consuming!)', false, + false, 'f' ); } /** @@ -51,13 +51,13 @@ */ public function execute() { // FIXME: this does not work at all - $this->purge = $this->getOption( "purge", false ); + $this->purge = $this->getOption( 'purge', false ); $this->db = wfGetDB( DB_MASTER ); - $this->db->query( "DELETE math FROM (`math` LEFT OUTER JOIN `mathindex` ON ( (`mathindex`.`mathindex_inputhash` = `math`.`math_inputhash`) )) WHERE mathindex_inputhash IS NULL " ); + $this->db->query( 'DELETE math FROM (`math` LEFT OUTER JOIN `mathindex` ON ( (`mathindex`.`mathindex_inputhash` = `math`.`math_inputhash`) )) WHERE mathindex_inputhash IS NULL ' ); $this->output( "Done.\n" ); } } -$maintClass = "CleanMathTable"; +$maintClass = 'CleanMathTable'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/CreateBaseXMathTable.php b/maintenance/CreateBaseXMathTable.php index ca13235..d5ee868 100644 --- a/maintenance/CreateBaseXMathTable.php +++ b/maintenance/CreateBaseXMathTable.php @@ -21,14 +21,14 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/IndexBase.php' ); +require_once( __DIR__ . '/IndexBase.php' ); /** * @author Moritz Schubotz * */ class CreateBaseXMathTable extends IndexBase { - private static $mwsns = "mws:"; + private static $mwsns = 'mws:'; private static $XMLHead; private static $XMLFooter; /** @var \BaseXSession */ @@ -116,6 +116,6 @@ } } -$maintClass = "CreateBaseXMathTable"; +$maintClass = 'CreateBaseXMathTable'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/CreateDB2MathTable.php b/maintenance/CreateDB2MathTable.php index 11bd92f..ec05a71 100644 --- a/maintenance/CreateDB2MathTable.php +++ b/maintenance/CreateDB2MathTable.php @@ -19,7 +19,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/IndexBase.php' ); +require_once( __DIR__. '/IndexBase.php' ); /** * @author Moritz Schubotz @@ -36,7 +36,7 @@ public function __construct() { parent::__construct(); $this->mDescription = 'Exports a db2 compatible math index table.'; - $this->addArg( 'truncate', "If true, db2 math table is deleted before import", false ); + $this->addArg( 'truncate', 'If true, db2 math table is deleted before import', false ); } /** @@ -102,6 +102,6 @@ } } -$maintClass = "CreateDB2MathTable"; +$maintClass = 'CreateDB2MathTable'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/CreateMWSHarvest.php b/maintenance/CreateMWSHarvest.php index ed9d262..fbad6fd 100644 --- a/maintenance/CreateMWSHarvest.php +++ b/maintenance/CreateMWSHarvest.php @@ -21,14 +21,14 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/IndexBase.php' ); +require_once( __DIR__ . '/IndexBase.php' ); /** * @author Moritz Schubotz * */ class CreateMWSHarvest extends IndexBase { - private static $mwsns = "mws:"; + private static $mwsns = 'mws:'; private static $XMLHead; private static $XMLFooter; @@ -55,7 +55,7 @@ echo "\t", $error->message; } libxml_clear_errors(); - return ""; + return ''; } // if ( $xml->math ) { // $smath = $xml->math->semantics-> { 'annotation-xml' } ->children()->asXML(); @@ -86,13 +86,13 @@ public function execute() { self::$mwsns = $this->getOption( 'mwsns', '' ); self::$XMLHead = - "<?xml version=\"1.0\"?>\n<" . self::$mwsns . - "harvest xmlns:mws=\"http://search.mathweb.org/ns\" xmlns:m=\"http://www.w3.org/1998/Math/MathML\">"; - self::$XMLFooter = "</" . self::$mwsns . "harvest>"; + '<?xml version="1.0"?>\n<' . self::$mwsns . + 'harvest xmlns:mws="http://search.mathweb.org/ns" xmlns:m="http://www.w3.org/1998/Math/MathML">'; + self::$XMLFooter = '</' . self::$mwsns . 'harvest>'; parent::execute(); } } -$maintClass = "CreateMWSHarvest"; +$maintClass = 'CreateMWSHarvest'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/ExtractFeatures.php b/maintenance/ExtractFeatures.php index 17aca4c..1e55e97 100644 --- a/maintenance/ExtractFeatures.php +++ b/maintenance/ExtractFeatures.php @@ -19,7 +19,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' ); +require_once( __DIR__ . '/../../../maintenance/Maintenance.php' ); /** * Class ExtractFeatures @@ -42,11 +42,11 @@ parent::__construct(); $this->mDescription = 'Outputs page text to stdout'; $this->addOption( 'purge', - "If set all formulae are rendered again from strech. (Very time consuming!)", false, - false, "f" ); - $this->addArg( 'min', "If set processing is started at the page with rank(pageID)>min", + 'If set all formulae are rendered again from strech. (Very time consuming!)', false, + false, 'f' ); + $this->addArg( 'min', 'If set processing is started at the page with rank(pageID)>min', false ); - $this->addArg( 'max', "If set processing is stopped at the page with rank(pageID)<=max", + $this->addArg( 'max', 'If set processing is stopped at the page with rank(pageID)<=max', false ); } @@ -95,26 +95,26 @@ $n += self::RTI_CHUNK_SIZE; } $this->output( "Clear mathvarstat\n" ); - $sql = "TRUNCATE TABLE `mathvarstat`"; + $sql = 'TRUNCATE TABLE `mathvarstat`'; $this->dbw->query( $sql ); $this->output( "Generate mathvarstat\n" ); $sql = - "INSERT INTO `mathvarstat` (`varstat_featurename` , `varstat_featuretype`, `varstat_featurecount`)\n" . - "SELECT `mathobservation_featurename` , `mathobservation_featuretype` , count( * ) AS CNT\n" . - "FROM `mathobservation`\n" . - "JOIN mathindex ON `mathobservation_inputhash` = mathindex_inputhash\n" . - "GROUP BY `mathobservation_featurename` , `mathobservation_featuretype`\n" . - "ORDER BY CNT DESC"; + 'INSERT INTO `mathvarstat` (`varstat_featurename` , `varstat_featuretype`, `varstat_featurecount`)\n' . + 'SELECT `mathobservation_featurename` , `mathobservation_featuretype` , count( * ) AS CNT\n' . + 'FROM `mathobservation`\n' . + 'JOIN mathindex ON `mathobservation_inputhash` = mathindex_inputhash\n' . + 'GROUP BY `mathobservation_featurename` , `mathobservation_featuretype`\n' . + 'ORDER BY CNT DESC'; $this->dbw->query( $sql ); $this->output( "Clear mathpagestat\n" ); - $sql = "TRUNCATE TABLE `mathpagestat`"; + $sql = 'TRUNCATE TABLE `mathpagestat`'; $this->dbw->query( $sql ); $this->output( "Generate mathpagestat\n" ); $sql = - "INSERT INTO `mathpagestat`(`pagestat_featureid`,`pagestat_pageid`,`pagestat_featurecount`)\n" . - "SELECT varstat_id, mathindex_revision_id, count(*) AS CNT FROM `mathobservation` JOIN mathindex ON `mathobservation_inputhash` =mathindex_inputhash\n" . - "JOIN mathvarstat ON varstat_featurename = `mathobservation_featurename` AND varstat_featuretype = `mathobservation_featuretype`\n" . - " GROUP BY `mathobservation_featurename`, `mathobservation_featuretype`,mathindex_revision_id ORDER BY CNT DESC"; + 'INSERT INTO `mathpagestat`(`pagestat_featureid`,`pagestat_pageid`,`pagestat_featurecount`)\n' . + 'SELECT varstat_id, mathindex_revision_id, count(*) AS CNT FROM `mathobservation` JOIN mathindex ON `mathobservation_inputhash` =mathindex_inputhash\n' . + 'JOIN mathvarstat ON varstat_featurename = `mathobservation_featurename` AND varstat_featuretype = `mathobservation_featuretype`\n' . + ' GROUP BY `mathobservation_featurename`, `mathobservation_featuretype`,mathindex_revision_id ORDER BY CNT DESC'; $this->dbw->query( $sql ); $this->output( "Updated {$fcount} formulae!\n" ); } @@ -152,13 +152,13 @@ */ public function execute() { $this->dbw = wfGetDB( DB_MASTER ); - $this->purge = $this->getOption( "purge", false ); + $this->purge = $this->getOption( 'purge', false ); $this->db = wfGetDB( DB_MASTER ); $this->output( "Done.\n" ); $this->populateSearchIndex( $this->getArg( 0, 0 ), $this->getArg( 1, - 1 ) ); } } -$maintClass = "ExtractFeatures"; +$maintClass = 'ExtractFeatures'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/GenerateFeatureTable.php b/maintenance/GenerateFeatureTable.php index ff72f37..643b81f 100644 --- a/maintenance/GenerateFeatureTable.php +++ b/maintenance/GenerateFeatureTable.php @@ -19,7 +19,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' ); +require_once( __DIR__ . '/../../../maintenance/Maintenance.php' ); /** * Class UpdateMath @@ -42,11 +42,11 @@ parent::__construct(); $this->mDescription = 'Outputs page text to stdout'; $this->addOption( 'purge', - "If set all formulae are rendered again from strech. (Very time consuming!)", false, - false, "f" ); - $this->addArg( 'min', "If set processing is started at the page with rank(pageID)>min", + 'If set all formulae are rendered again from strech. (Very time consuming!)', false, + false, 'f' ); + $this->addArg( 'min', 'If set processing is started at the page with rank(pageID)>min', false ); - $this->addArg( 'max', "If set processing is stopped at the page with rank(pageID)<=max", + $this->addArg( 'max', 'If set processing is stopped at the page with rank(pageID)<=max', false ); } @@ -127,12 +127,12 @@ */ public function execute() { $this->dbw = wfGetDB( DB_MASTER ); - $this->purge = $this->getOption( "purge", false ); + $this->purge = $this->getOption( 'purge', false ); $this->db = wfGetDB( DB_MASTER ); $this->populateSearchIndex( $this->getArg( 0, 0 ), $this->getArg( 1, - 1 ) ); } } -$maintClass = "GenerateFeatureTable"; +$maintClass = 'GenerateFeatureTable'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/GenerateWorkload.php b/maintenance/GenerateWorkload.php index 0445827..1157548 100644 --- a/maintenance/GenerateWorkload.php +++ b/maintenance/GenerateWorkload.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/IndexBase.php' ); +require_once( __DIR__ . '/IndexBase.php' ); /** * @author Moritz Schubotz @@ -37,12 +37,12 @@ public function __construct() { parent::__construct(); $this->mDescription = 'Generates a workload of sample queries.'; - $this->addOption( 'selectivity', "Specifies the selectivity for each individual equation", - false, true, "S" ); + $this->addOption( 'selectivity', 'Specifies the selectivity for each individual equation', + false, true, 'S' ); $this->addOption( 'lastId', - "Specifies to start the ID counter after the given id. For example '-l 1' would start with id 2.", - false, true, "l" ); - $this->addOption( 'overwrite', "Overwrite existing draft queries ", false, false, "o" ); + 'Specifies to start the ID counter after the given id. For example \'-l 1\' would start with id 2.', + false, true, 'l' ); + $this->addOption( 'overwrite', 'Overwrite existing draft queries ', false, false, "o" ); } /** @@ -53,7 +53,7 @@ protected function generateIndexString( $row ) { if ( mt_rand() <= $this->selectivity ) { $q = MathQueryObject::newQueryFromEquationRow( $row, ++ $this->id ); - $q->saveToDatabase( $this->getOption( "overwrite", false ) ); + $q->saveToDatabase( $this->getOption( 'overwrite', false ) ); $out = $q->exportTexDocument(); if ( $out == false ) { echo 'problem with ' . var_export( $q, true ) . "\n"; @@ -70,7 +70,7 @@ $i = 0; $inc = $this->getArg( 1, 100 ); $this->id = $this->getOption( 'lastId', 0 ); - $sel = $this->getOption( "selectivity", .1 ); + $sel = $this->getOption( 'selectivity', .1 ); $this->selectivity = (int)( $sel * mt_getrandmax() ); $db = wfGetDB( DB_SLAVE ); echo "getting list of all equations from the database\n"; @@ -87,10 +87,10 @@ $i += $inc; } while ( $res ); echo "last id used: {$this->id}\n"; - echo( "done" ); + echo( 'done' ); } } -$maintClass = "GenerateWorkload"; +$maintClass = 'GenerateWorkload'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file diff --git a/maintenance/IndexBase.php b/maintenance/IndexBase.php index 9583f96..b04149e 100644 --- a/maintenance/IndexBase.php +++ b/maintenance/IndexBase.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' ); +require_once( __DIR__ . '/../../../maintenance/Maintenance.php' ); /** * @author Moritz Schubotz @@ -38,10 +38,10 @@ parent::__construct(); $this->mDescription = 'Exports data'; $this->addArg( 'dir', 'The directory where the harvest files go to.' ); - $this->addArg( 'ffmax', "The maximal number of formula per file.", false ); - $this->addArg( 'min', "If set processing is started at the page with rank(pageID)>min", + $this->addArg( 'ffmax', 'The maximal number of formula per file.', false ); + $this->addArg( 'min', 'If set processing is started at the page with rank(pageID)>min', false ); - $this->addArg( 'max', "If set processing is stopped at the page with rank(pageID)<=max", + $this->addArg( 'max', 'If set processing is stopped at the page with rank(pageID)<=max', false ); $this->addOption( 'limit', 'The maximal number of database entries to be considered', false, true, "L" ); @@ -113,20 +113,20 @@ $res = $this->wFile( $fn, $i, $inc ); $i += $inc; } while ( $res ); - echo( "done" ); + echo( 'done' ); } /** * @return string */ protected function getHead() { - return ""; + return ''; } /** * @return string */ protected function getFooter() { - return ""; + return ''; } } diff --git a/maintenance/MathMLFilter.php b/maintenance/MathMLFilter.php index 44e807c..9773183 100644 --- a/maintenance/MathMLFilter.php +++ b/maintenance/MathMLFilter.php @@ -64,7 +64,7 @@ */ private static function replaceMath( $pText ) { $pText = Sanitizer::removeHTMLcomments( $pText ); - return preg_replace_callback( "#<math>(.*?)</math>#s", 'self::renderMath', + return preg_replace_callback( '#<math>(.*?)</math>#s', 'self::renderMath', $pText ); } diff --git a/maintenance/UpdateMath.php b/maintenance/UpdateMath.php index 6f6e809..c02171c 100644 --- a/maintenance/UpdateMath.php +++ b/maintenance/UpdateMath.php @@ -49,17 +49,17 @@ parent::__construct(); $this->mDescription = 'Updates the index of Mathematical formulae.'; $this->addOption( 'purge', - "If set all formulae are rendered again without using caches. (Very time consuming!)", - false, false, "f" ); - $this->addArg( 'min', "If set processing is started at the page with rank(pageID)>min", + 'If set all formulae are rendered again without using caches. (Very time consuming!)', + false, false, 'f' ); + $this->addArg( 'min', 'If set processing is started at the page with rank(pageID)>min', false ); - $this->addArg( 'max', "If set processing is stopped at the page with rank(pageID)<=max", + $this->addArg( 'max', 'If set processing is stopped at the page with rank(pageID)<=max', false ); - $this->addOption( 'verbose', "If set output for successful rendering will produced", false, + $this->addOption( 'verbose', 'If set output for successful rendering will produced', false, false, 'v' ); - $this->addOption( 'SVG', "If set SVG images will be produced", false, false ); - $this->addOption( 'hoooks', "If set hooks will be skipped", false, false ); - $this->addOption( 'texvccheck', "If set texvccheck will be skipped", false, false ); + $this->addOption( 'SVG', 'If set SVG images will be produced', false, false ); + $this->addOption( 'hoooks', 'If set hooks will be skipped', false, false ); + $this->addOption( 'texvccheck', 'If set texvccheck will be skipped', false, false ); $this->addOption( 'mode', 'Rendering mode to be used (0 = PNG, 5= MathML, 7=MathML)', false, true, 'm' ); } @@ -135,7 +135,7 @@ // echo "before" +$this->dbw->selectField('mathindex', 'count(*)')."\n"; $start = microtime( true ); $this->dbw->commit(); - echo " committed in " . ( microtime( true ) - $start ) . "s\n\n"; + echo ' committed in ' . ( microtime( true ) - $start ) . "s\n\n"; var_export( $this->performance ); // echo "after" +$this->dbw->selectField('mathindex', 'count(*)')."\n"; $n += self::RTI_CHUNK_SIZE; @@ -165,42 +165,42 @@ $renderer = MathRenderer::getRenderer( $formula[1], $formula[2], $this->renderingMode ); $this->current = $renderer; - $this->time( "loadClass" ); - if ( $this->getOption( "texvccheck", false ) ) { + $this->time( 'loadClass' ); + if ( $this->getOption( 'texvccheck', false ) ) { $checked = true; } else { $checked = $renderer->checkTex(); - $this->time( "checkTex" ); + $this->time( 'checkTex' ); } if ( $checked ) { $renderer->render( $this->purge ); if ( $renderer->getMathml() ) { - $this->time( "Rendering" ); + $this->time( 'Rendering' ); } else { - $this->time( "Failing" ); + $this->time( 'Failing' ); } - if ( $this->getOption( "SVG", false ) ) { + if ( $this->getOption( 'SVG', false ) ) { $svg = $renderer->getSvg(); if ( $svg ) { - $this->time( "SVG-Rendering" ); + $this->time( 'SVG-Rendering' ); } else { - $this->time( "SVG-Fail" ); + $this->time( 'SVG-Fail' ); } } } else { - $this->time( "checkTex-Fail" ); - echo "\nF:\t\t" . $renderer->getMd5() . " texvccheck error:" . + $this->time( 'checkTex-Fail' ); + echo "\nF:\t\t" . $renderer->getMd5() . ' texvccheck error:' . $renderer->getLastError(); continue; } - if ( !$this->getOption( "hooks", false ) ) { + if ( !$this->getOption( 'hooks', false ) ) { wfRunHooks( 'MathFormulaRendered', array( &$renderer, &$notused, $pid, $anchorID ) ); - $this->time( "hooks" ); + $this->time( 'hooks' ); $anchorID ++; } $renderer->writeCache( $this->dbw ); - $this->time( "write Cache" ); + $this->time( 'write Cache' ); if ( $renderer->getLastError() ) { echo "\n\t\t" . $renderer->getLastError(); echo "\nF:\t\t" . $renderer->getMd5() . " equation " . ( $anchorID - 1 ) . @@ -223,9 +223,9 @@ public function execute() { global $wgMathValidModes; $this->dbw = wfGetDB( DB_MASTER ); - $this->purge = $this->getOption( "purge", false ); - $this->verbose = $this->getOption( "verbose", false ); - $this->renderingMode = $this->getOption( "mode", 7 ); + $this->purge = $this->getOption( 'purge', false ); + $this->verbose = $this->getOption( 'verbose', false ); + $this->renderingMode = $this->getOption( 'mode', 7 ); $this->db = wfGetDB( DB_MASTER ); $wgMathValidModes[] = $this->renderingMode; $this->output( "Loaded.\n" ); @@ -234,6 +234,6 @@ } } -$maintClass = "UpdateMath"; +$maintClass = 'UpdateMath'; /** @noinspection PhpIncludeInspection */ require_once( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/186634 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8905cfff375a2b01d2dabfeb3035d65907762c0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MathSearch Gerrit-Branch: master Gerrit-Owner: Physikerwelt <w...@physikerwelt.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits