Skip to content

Commit 49e43a7

Browse files
MAGETWO-64554: Rename config.local.php file, use env.php file as configs storage
1 parent ce37752 commit 49e43a7

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

lib/internal/Magento/Framework/App/DeploymentConfig/FileReader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\App\Filesystem\DirectoryList;
99
use Magento\Framework\Config\File\ConfigFilePool;
10+
use Magento\Framework\Exception\FileSystemException;
1011
use Magento\Framework\Filesystem\DriverPool;
1112

1213
/**
@@ -56,8 +57,8 @@ public function __construct(
5657
* Loads the configuration file.
5758
*
5859
* @param string $fileKey The file key
59-
* @return array The configurations arrat
60-
* @throws \Exception
60+
* @return array The configurations array
61+
* @throws FileSystemException If file key is not correct
6162
*/
6263
public function load($fileKey)
6364
{

lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Framework\App\DeploymentConfig;
99
use Magento\Framework\App\Filesystem\DirectoryList;
10-
use Magento\Framework\App\ObjectManager;
1110
use Magento\Framework\Config\File\ConfigFilePool;
1211
use Magento\Framework\Exception\FileSystemException;
1312
use Magento\Framework\Filesystem;
@@ -25,13 +24,6 @@ class Writer
2524
*/
2625
private $reader;
2726

28-
/**
29-
* Deployment file config reader
30-
*
31-
* @var FileReader
32-
*/
33-
private $fileReader;
34-
3527
/**
3628
* Application filesystem
3729
*
@@ -62,22 +54,19 @@ class Writer
6254
* @param ConfigFilePool $configFilePool
6355
* @param DeploymentConfig $deploymentConfig
6456
* @param Writer\FormatterInterface $formatter
65-
* @param FileReader $fileReader
6657
*/
6758
public function __construct(
6859
Reader $reader,
6960
Filesystem $filesystem,
7061
ConfigFilePool $configFilePool,
7162
DeploymentConfig $deploymentConfig,
72-
Writer\FormatterInterface $formatter = null,
73-
FileReader $fileReader = null
63+
Writer\FormatterInterface $formatter = null
7464
) {
7565
$this->reader = $reader;
7666
$this->filesystem = $filesystem;
7767
$this->configFilePool = $configFilePool;
7868
$this->deploymentConfig = $deploymentConfig;
79-
$this->formatter = $formatter ?: ObjectManager::getInstance()->get(Writer\PhpFormatter::class);
80-
$this->fileReader = $fileReader ?: ObjectManager::getInstance()->get(FileReader::class);
69+
$this->formatter = $formatter ?: new Writer\PhpFormatter();
8170
}
8271

8372
/**

lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfig/WriterTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ class WriterTest extends \PHPUnit_Framework_TestCase
3333
*/
3434
private $reader;
3535

36-
/**
37-
* @var DeploymentConfig\FileReader|Mock
38-
*/
39-
private $fileReader;
40-
4136
/**
4237
* @var WriteInterface|Mock
4338
*/
@@ -83,9 +78,6 @@ protected function setUp()
8378
$this->deploymentConfig = $this->getMockBuilder(DeploymentConfig::class)
8479
->disableOriginalConstructor()
8580
->getMock();
86-
$this->fileReader = $this->getMockBuilder(DeploymentConfig\FileReader::class)
87-
->disableOriginalConstructor()
88-
->getMock();
8981
$this->dirWrite = $this->getMockForAbstractClass(WriteInterface::class);
9082
$this->dirRead = $this->getMockForAbstractClass(ReadInterface::class);
9183

@@ -94,8 +86,7 @@ protected function setUp()
9486
$this->filesystem,
9587
$this->configFilePool,
9688
$this->deploymentConfig,
97-
$this->formatter,
98-
$this->fileReader
89+
$this->formatter
9990
);
10091
}
10192

0 commit comments

Comments
 (0)