X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=f741cd2653f340826cf84eaddd334ecf5d48186e;hb=12216dc71c7fb3ac4c533a03e39819170e2a5b66;hp=130d1fbf7150a6596be6853d12ad8affc829ebb4;hpb=11bf698158125bdbde2111f3c53dab528e4109e0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 130d1fbf71..f741cd2653 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -20,6 +20,8 @@ * @defgroup Maintenance Maintenance */ +define( 'MW_ENTRY_POINT', 'cli' ); + // Bail on old versions of PHP, or if composer has not been run yet to install // dependencies. require_once __DIR__ . '/../includes/PHPVersionCheck.php'; @@ -89,7 +91,11 @@ abstract class Maintenance { // Const for getStdin() const STDIN_ALL = 'all'; - // Array of desired/allowed params + /** + * Array of desired/allowed params + * @var array[] + * @phan-var array + */ protected $mParams = []; // Array of mapping short parameters to long ones @@ -128,9 +134,17 @@ abstract class Maintenance { */ protected $mBatchSize = null; - // Generic options added by addDefaultParams() + /** + * Generic options added by addDefaultParams() + * @var array[] + * @phan-var array + */ private $mGenericParameters = []; - // Generic options which might or not be supported by the script + /** + * Generic options which might or not be supported by the script + * @var array[] + * @phan-var array + */ private $mDependantParameters = []; /** @@ -573,7 +587,7 @@ abstract class Maintenance { "server name detection may fail in command line scripts.", false, true ); $this->addOption( 'profiler', 'Profiler output format (usually "text")', false, true ); // This is named --mwdebug, because --debug would conflict in the phpunit.php CLI script. - $this->addOption( 'mwdebug', 'Enable built-in MediaWiki development settings', false, true ); + $this->addOption( 'mwdebug', 'Enable built-in MediaWiki development settings', false, false ); # Save generic options to display them separately in help $this->mGenericParameters = $this->mParams; @@ -1235,6 +1249,7 @@ abstract class Maintenance { */ protected function afterFinalSetup() { if ( defined( 'MW_CMDLINE_CALLBACK' ) ) { + // @phan-suppress-next-line PhanUndeclaredConstant call_user_func( MW_CMDLINE_CALLBACK ); } } @@ -1324,6 +1339,7 @@ abstract class Maintenance { $res = $dbw->select( 'content', 'content_address', [], __METHOD__, [ 'DISTINCT' ] ); $blobStore = MediaWikiServices::getInstance()->getBlobStore(); foreach ( $res as $row ) { + // @phan-suppress-next-line PhanUndeclaredMethod $textId = $blobStore->getTextIdFromAddress( $row->content_address ); if ( $textId ) { $cur[] = $textId;