Skip to content

Commit a946ec3

Browse files
authored
Merge pull request #1850 from mrrobot47/fix/custom-docker-compose-file
Extend only valid extension files in custom docker compose
2 parents f9ef705 + 1d1d8a8 commit a946ec3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

php/class-ee-docker.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ public static function docker_compose_with_custom( array $files_before_custom =
3939
} else {
4040

4141
if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) {
42-
$custom_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] );
43-
$custom_compose_files = array_map( function ( $arrayValues ) {
42+
$ymlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yml' );
43+
$yamlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yaml' );
4444

45-
return SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $arrayValues;
46-
}, $custom_compose_files );
45+
$custom_compose_files = array_merge( $ymlFiles, $yamlFiles );
4746

4847
$files_before_custom = array_unique( array_merge( $files_before_custom, $custom_compose_files ) );
4948
}

0 commit comments

Comments
 (0)