X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=blobdiff_plain;f=maintenance%2FimportTextFiles.php;h=88ee9d7ecdda9a416544a6b0b017a9bfb822b3f3;hb=b46368a94cc411b8de9a6ad41f3767e729251b5c;hp=14d8420ce41d7bfa31703c7d9991042452b0c494;hpb=53be5c92adab85c799754775e6b68c30fed6bf9c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importTextFiles.php b/maintenance/importTextFiles.php index 14d8420ce4..88ee9d7ecd 100644 --- a/maintenance/importTextFiles.php +++ b/maintenance/importTextFiles.php @@ -32,7 +32,7 @@ require_once __DIR__ . '/Maintenance.php'; 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' ); @@ -56,8 +56,8 @@ class ImportTextFiles extends Maintenance { $prefix = $this->getOption( 'prefix', '' ); // Get all the arguments. A loop is required since Maintenance doesn't - // suppport an arbitrary number of arguments. - $files = array(); + // support an arbitrary number of arguments. + $files = []; $i = 0; while ( $arg = $this->getArg( $i++ ) ) { if ( file_exists( $arg ) ) { @@ -71,7 +71,7 @@ class ImportTextFiles extends Maintenance { $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 ); }