diff options
author | Bryan Davis <bd808@wikimedia.org> | 2017-11-19 17:36:54 -0700 |
---|---|---|
committer | Bryan Davis <bd808@wikimedia.org> | 2017-11-21 21:34:16 -0700 |
commit | 9e34eeff23fdd46a8e9bddfbab39d45eab232827 (patch) | |
tree | 8bc5d4bdd2efc8ce68d2c605f10f1bfa7d88de3a /maintenance/formatInstallDoc.php | |
parent | 708e8e9dee4523997a2dfe73e312db18725e782b (diff) | |
download | mediawikicore-9e34eeff23fdd46a8e9bddfbab39d45eab232827.tar.gz mediawikicore-9e34eeff23fdd46a8e9bddfbab39d45eab232827.zip |
Maintenance: add fatalError() method
Deprecate the second argument to Maintenance::error() in favor of a new
Maintenance::fatalError() method. This is intended to make it easier to
review flow control in maintenance scripts.
Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
Diffstat (limited to 'maintenance/formatInstallDoc.php')
-rw-r--r-- | maintenance/formatInstallDoc.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/maintenance/formatInstallDoc.php b/maintenance/formatInstallDoc.php index e2b3c4199d72..95d90c1bdb8e 100644 --- a/maintenance/formatInstallDoc.php +++ b/maintenance/formatInstallDoc.php @@ -41,8 +41,7 @@ class MaintenanceFormatInstallDoc extends Maintenance { $fileName = $this->getArg( 0 ); $inFile = fopen( $fileName, 'r' ); if ( !$inFile ) { - $this->error( "Unable to open input file \"$fileName\"" ); - exit( 1 ); + $this->fatalError( "Unable to open input file \"$fileName\"" ); } } else { $inFile = STDIN; @@ -52,8 +51,7 @@ class MaintenanceFormatInstallDoc extends Maintenance { $fileName = $this->getOption( 'outfile' ); $outFile = fopen( $fileName, 'w' ); if ( !$outFile ) { - $this->error( "Unable to open output file \"$fileName\"" ); - exit( 1 ); + $this->fatalError( "Unable to open output file \"$fileName\"" ); } } else { $outFile = STDOUT; |