X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcreateCommonPasswordCdb.php;h=ef5a30de10b217c5c8c65619c7e03159e9c10457;hb=d517325c510ac17ea8dbcba4a4cd8bbbdd3fe125;hp=388ad8a711f45e9fd5482f7dc52bc13472fa2ef6;hpb=b8da5c83743ea31c6f73c063508384f114748537;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createCommonPasswordCdb.php b/maintenance/createCommonPasswordCdb.php index 388ad8a711..ef5a30de10 100644 --- a/maintenance/createCommonPasswordCdb.php +++ b/maintenance/createCommonPasswordCdb.php @@ -26,9 +26,11 @@ require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script to create common password cdb database. * - * Meant to take a file like - * https://github.com/danielmiessler/SecLists/blob/master/Passwords/rockyou.txt?raw=true - * as input. + * Meant to take a file like those from + * https://github.com/danielmiessler/SecLists + * For example: + * https://github.com/danielmiessler/SecLists/blob/fe2b40dd84/Passwords/rockyou.txt?raw=true + * * @see serialized/commonpasswords.cdb and PasswordPolicyChecks::checkPopularPasswordBlacklist * @since 1.27 * @ingroup Maintenance @@ -58,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 { @@ -107,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 = GenerateCommonPassword::class; require_once RUN_MAINTENANCE_IF_MAIN;