From 1d1d8a8448d207742f5c43fac105bbf54df7d216 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Thu, 8 Aug 2024 10:23:14 +0530 Subject: [PATCH] Extend only valid extension files Signed-off-by: Riddhesh Sanghvi --- php/class-ee-docker.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 058d354d7..d1deacbfb 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -39,11 +39,10 @@ public static function docker_compose_with_custom( array $files_before_custom = } else { if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) { - $custom_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] ); - $custom_compose_files = array_map( function ( $arrayValues ) { + $ymlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yml' ); + $yamlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yaml' ); - return SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $arrayValues; - }, $custom_compose_files ); + $custom_compose_files = array_merge( $ymlFiles, $yamlFiles ); $files_before_custom = array_unique( array_merge( $files_before_custom, $custom_compose_files ) ); }