X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcreateCommonPasswordCdb.php;h=7f12252704019a8900fd41d346b539f8157e02ad;hb=fadd3277f73c8922cea2443a7e6566f54726fbbc;hp=f7e0c0fb9f463fae800e05149848c5be478e0410;hpb=0148939e93a5a314dcadbbce840f116b6bb538b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createCommonPasswordCdb.php b/maintenance/createCommonPasswordCdb.php index f7e0c0fb9f..7f12252704 100644 --- a/maintenance/createCommonPasswordCdb.php +++ b/maintenance/createCommonPasswordCdb.php @@ -1,6 +1,6 @@ addArg( 'inputfile', 'List of passwords (one per line) to use or - for stdin', true ); $this->addArg( 'output', - "Location to write CDB file to (Try $IP/serialized/commonpasswords.cdb)", + "Location to write CDB file to (Try $IP/includes/password/commonpasswords.cdb)", true ); } @@ -60,12 +60,12 @@ class GenerateCommonPassword extends Maintenance { $outfile = $this->getArg( 1 ); if ( !is_readable( $infile ) && $infile !== 'php://stdin' ) { - $this->error( "Cannot open input file $infile for reading", 1 ); + $this->fatalError( "Cannot open input file $infile for reading" ); } $file = fopen( $infile, 'r' ); if ( $file === false ) { - $this->error( "Cannot read input file $infile", 1 ); + $this->fatalError( "Cannot read input file $infile" ); } try { @@ -94,7 +94,7 @@ class GenerateCommonPassword extends Maintenance { continue; } if ( isset( $alreadyWritten[$line] ) ) { - $this->output( "Password '$line' already written (line " . ( $i + 1 ) .")\n" ); + $this->output( "Password '$line' already written (line " . ( $i + 1 ) . ")\n" ); $skipped++; continue; } @@ -109,10 +109,10 @@ class GenerateCommonPassword extends Maintenance { " (out of $i) passwords to $outfile\n" ); } catch ( \Cdb\Exception $e ) { - $this->error( "Error writing cdb file: " . $e->getMessage(), 2 ); + $this->fatalError( "Error writing cdb file: " . $e->getMessage(), 2 ); } } } -$maintClass = "GenerateCommonPassword"; +$maintClass = CreateCommonPasswordCdb::class; require_once RUN_MAINTENANCE_IF_MAIN;