| @@ 37-59 (lines=23) @@ | ||
| 34 | private $mFiles = [], $mFailures = [], $mWarnings = []; |
|
| 35 | private $mIgnorePaths = [], $mNoStyleCheckPaths = []; |
|
| 36 | ||
| 37 | public function __construct() { |
|
| 38 | parent::__construct(); |
|
| 39 | $this->addDescription( 'Check syntax for all PHP files in MediaWiki' ); |
|
| 40 | $this->addOption( 'with-extensions', 'Also recurse the extensions folder' ); |
|
| 41 | $this->addOption( |
|
| 42 | 'path', |
|
| 43 | 'Specific path (file or directory) to check, either with absolute path or ' |
|
| 44 | . 'relative to the root of this MediaWiki installation', |
|
| 45 | false, |
|
| 46 | true |
|
| 47 | ); |
|
| 48 | $this->addOption( |
|
| 49 | 'list-file', |
|
| 50 | 'Text file containing list of files or directories to check', |
|
| 51 | false, |
|
| 52 | true |
|
| 53 | ); |
|
| 54 | $this->addOption( |
|
| 55 | 'modified', |
|
| 56 | 'Check only files that were modified (requires Git command-line client)' |
|
| 57 | ); |
|
| 58 | $this->addOption( 'syntax-only', 'Check for syntax validity only, skip code style warnings' ); |
|
| 59 | } |
|
| 60 | ||
| 61 | public function getDbType() { |
|
| 62 | return Maintenance::DB_NONE; |
|
| @@ 32-45 (lines=14) @@ | ||
| 29 | * @ingroup Maintenance |
|
| 30 | */ |
|
| 31 | class PopulateImageSha1 extends LoggedUpdateMaintenance { |
|
| 32 | public function __construct() { |
|
| 33 | parent::__construct(); |
|
| 34 | $this->addDescription( 'Populate the img_sha1 field' ); |
|
| 35 | $this->addOption( 'force', "Recalculate sha1 for rows that already have a value" ); |
|
| 36 | $this->addOption( 'multiversiononly', "Calculate only for files with several versions" ); |
|
| 37 | $this->addOption( 'method', "Use 'pipe' to pipe to mysql command line,\n" . |
|
| 38 | "\t\tdefault uses Database class", false, true ); |
|
| 39 | $this->addOption( |
|
| 40 | 'file', |
|
| 41 | 'Fix for a specific file, without File: namespace prefixed', |
|
| 42 | false, |
|
| 43 | true |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | ||
| 47 | protected function getUpdateKey() { |
|
| 48 | return 'populate img_sha1'; |
|