Merge "generatePhpCharToUpperMappings: Die if fopen fails"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 19 Sep 2019 08:19:53 +0000 (08:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 19 Sep 2019 08:19:53 +0000 (08:19 +0000)
maintenance/mediawiki.Title/generatePhpCharToUpperMappings.php

index e1a50ea..9fc5513 100755 (executable)
@@ -82,6 +82,9 @@ class GeneratePhpCharToUpperMappings extends Maintenance {
                ) . "\n";
                $outputPath = '/resources/src/mediawiki.Title/phpCharToUpper.json';
                $file = fopen( $IP . $outputPath, 'w' );
+               if ( !$file ) {
+                       $this->fatalError( "Unable to write file \"$IP$outputPath\"" );
+               }
                fwrite( $file, $mappingJson );
 
                $this->output( count( $data ) . " differences found.\n" );