X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=blobdiff_plain;f=maintenance%2FimportTextFiles.php;h=5531ffc3afb0e124e843110c0d8ea2177979e578;hb=4fd1f42d0b8f61fa970a5e1dbb37a0979a11e537;hp=e926cfd2b789ea4385175c9747dd2e0600599089;hpb=9ba3fca2d8adc56787c8efc32c41424cb212e387;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importTextFiles.php b/maintenance/importTextFiles.php index e926cfd2b7..5531ffc3af 100644 --- a/maintenance/importTextFiles.php +++ b/maintenance/importTextFiles.php @@ -56,14 +56,23 @@ 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. + // support an arbitrary number of arguments. $files = []; $i = 0; while ( $arg = $this->getArg( $i++ ) ) { if ( file_exists( $arg ) ) { $files[$arg] = file_get_contents( $arg ); } else { - $this->error( "Fatal error: The file '$arg' does not exist!", 1 ); + // use glob to support the Windows shell, which doesn't automatically + // expand wildcards + $found = false; + foreach ( glob( $arg ) as $filename ) { + $found = true; + $files[$filename] = file_get_contents( $filename ); + } + if ( !$found ) { + $this->error( "Fatal error: The file '$arg' does not exist!", 1 ); + } } };