class ImportTextFiles extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Reads in text files and imports their content to pages of the wiki";
+ $this->addDescription( 'Reads in text files and imports their content to pages of the wiki' );
$this->addOption( 'user', 'Username to which edits should be attributed. ' .
'Default: "Maintenance script"', false, true, 'u' );
$this->addOption( 'summary', 'Specify edit summary for the edits', false, true, 's' );
// Get all the arguments. A loop is required since Maintenance doesn't
// suppport an arbitrary number of arguments.
- $files = array();
+ $files = [];
$i = 0;
while ( $arg = $this->getArg( $i++ ) ) {
if ( file_exists( $arg ) ) {
$this->output( "Importing $count pages...\n" );
if ( $userName === false ) {
- $user = User::newSystemUser( 'Maintenance script', array( 'steal' => true ) );
+ $user = User::newSystemUser( 'Maintenance script', [ 'steal' => true ] );
} else {
$user = User::newFromName( $userName );
}