Skip to content

Commit f427b8f

Browse files
MCLOUD-6529: Add support for .magento.docker.yml extension (#254)
1 parent d423e5a commit f427b8f

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

src/Config/Source/ConfigSource.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\CloudDocker\Config\Source;
99

1010
use Illuminate\Config\Repository;
11-
use Magento\CloudDocker\Filesystem\FileList;
11+
use Magento\CloudDocker\Filesystem\DirectoryList;
1212
use Magento\CloudDocker\Filesystem\Filesystem;
1313
use Symfony\Component\Yaml\Exception\ParseException;
1414
use Symfony\Component\Yaml\Yaml;
@@ -19,22 +19,22 @@
1919
class ConfigSource implements SourceInterface
2020
{
2121
/**
22-
* @var FileList
22+
* @var DirectoryList
2323
*/
24-
private $fileList;
24+
private $directoryList;
2525

2626
/**
2727
* @var Filesystem
2828
*/
2929
private $filesystem;
3030

3131
/**
32-
* @param FileList $fileList
32+
* @param DirectoryList $directoryList
3333
* @param Filesystem $filesystem
3434
*/
35-
public function __construct(FileList $fileList, Filesystem $filesystem)
35+
public function __construct(DirectoryList $directoryList, Filesystem $filesystem)
3636
{
37-
$this->fileList = $fileList;
37+
$this->directoryList = $directoryList;
3838
$this->filesystem = $filesystem;
3939
}
4040

@@ -43,7 +43,12 @@ public function __construct(FileList $fileList, Filesystem $filesystem)
4343
*/
4444
public function read(): Repository
4545
{
46-
$configFile = $this->fileList->getDockerConfig();
46+
$configFile = $this->directoryList->getMagentoRoot() . '/.magento.docker.yml';
47+
48+
if (!$this->filesystem->exists($configFile)) {
49+
$configFile = $this->directoryList->getMagentoRoot() . '/.magento.docker.yaml';
50+
}
51+
4752
$repository = new Repository();
4853

4954
try {

src/Filesystem/FileList.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ public function getServicesConfig(): string
4949
return $this->directoryList->getMagentoRoot() . '/.magento/services.yaml';
5050
}
5151

52-
/**
53-
* @return string
54-
*/
55-
public function getEceToolsCompose(): string
56-
{
57-
return $this->directoryList->getEceToolsRoot() . '/docker-compose.yml';
58-
}
59-
6052
/**
6153
* @return string
6254
*/
@@ -72,12 +64,4 @@ public function getMagentoComposer(): string
7264
{
7365
return $this->directoryList->getMagentoRoot() . '/composer.json';
7466
}
75-
76-
/**
77-
* @return string
78-
*/
79-
public function getDockerConfig(): string
80-
{
81-
return $this->directoryList->getMagentoRoot() . '/.magento.docker.yaml';
82-
}
8367
}

0 commit comments

Comments
 (0)