Support multiple extension-dir paths to be passed to mergeMessageFileList
authorMukunda Modell <mmodell@wikimedia.org>
Thu, 4 Feb 2016 01:06:02 +0000 (19:06 -0600)
committerMukunda Modell <mmodell@wikimedia.org>
Wed, 16 Mar 2016 20:35:07 +0000 (15:35 -0500)
If scap is modified to pass the path to both extensions/ and skins/ then
the extension-list file in wmf-config will no longer be needed, eliminating
many headaches. (refs T125678)

Bug: T125678

Change-Id: I4fd0c99d68fa32bf2378691955850a1be2c022df

maintenance/mergeMessageFileList.php

index 46d5474..a650aa0 100644 (file)
@@ -81,7 +81,12 @@ class MergeMessageFileList extends Maintenance {
                # Now find out files in a directory
                if ( $this->hasOption( 'extensions-dir' ) ) {
                        $extdir = $this->getOption( 'extensions-dir' );
-                       $entries = scandir( $extdir );
+                       # Allow multiple directories to be passed with ":" as delimiter
+                       $extdirs = explode( ':', $extdir );
+                       $entries = [];
+                       foreach ( $extdirs as $extdir ) {
+                               $entries = array_merge( $entries, scandir( $extdir ) );
+                       }
                        foreach ( $entries as $extname ) {
                                if ( $extname == '.' || $extname == '..' || !is_dir( "$extdir/$extname" ) ) {
                                        continue;