|
20 | 20 | use Zend\View\Model\ViewModel;
|
21 | 21 | use Magento\Setup\Console\Command\InstallCommand;
|
22 | 22 | use Magento\SampleData;
|
23 |
| -use Magento\Framework\App\DeploymentConfig; |
24 | 23 |
|
25 | 24 | /**
|
26 | 25 | * Install controller
|
@@ -61,20 +60,17 @@ class Install extends AbstractActionController
|
61 | 60 | * @param InstallerFactory $installerFactory
|
62 | 61 | * @param ProgressFactory $progressFactory
|
63 | 62 | * @param \Magento\Framework\Setup\SampleData\State $sampleDataState
|
64 |
| - * @param \Magento\Framework\App\DeploymentConfig $deploymentConfig |
65 | 63 | */
|
66 | 64 | public function __construct(
|
67 | 65 | WebLogger $logger,
|
68 | 66 | InstallerFactory $installerFactory,
|
69 | 67 | ProgressFactory $progressFactory,
|
70 |
| - \Magento\Framework\Setup\SampleData\State $sampleDataState, |
71 |
| - DeploymentConfig $deploymentConfig |
| 68 | + \Magento\Framework\Setup\SampleData\State $sampleDataState |
72 | 69 | ) {
|
73 | 70 | $this->log = $logger;
|
74 | 71 | $this->installer = $installerFactory->create($logger);
|
75 | 72 | $this->progressFactory = $progressFactory;
|
76 | 73 | $this->sampleDataState = $sampleDataState;
|
77 |
| - $this->deploymentConfig = $deploymentConfig; |
78 | 74 | }
|
79 | 75 |
|
80 | 76 | /**
|
@@ -164,7 +160,7 @@ public function progressAction()
|
164 | 160 | */
|
165 | 161 | private function checkForPriorInstall()
|
166 | 162 | {
|
167 |
| - if ($this->deploymentConfig->isAvailable()) { |
| 163 | + if ($this->getDeploymentConfig()->isAvailable()) { |
168 | 164 | throw new \Magento\Setup\Exception('Magento application is already installed.');
|
169 | 165 | }
|
170 | 166 | }
|
@@ -266,4 +262,20 @@ private function importAdminUserForm()
|
266 | 262 | $result[AdminAccount::KEY_LAST_NAME] = $result[AdminAccount::KEY_USER];
|
267 | 263 | return $result;
|
268 | 264 | }
|
| 265 | + |
| 266 | + /** |
| 267 | + * Get Deployment Config |
| 268 | + * |
| 269 | + * @return \Magento\Framework\App\DeploymentConfig |
| 270 | + * |
| 271 | + * @deprecated |
| 272 | + */ |
| 273 | + private function getDeploymentConfig() |
| 274 | + { |
| 275 | + if ($this->deploymentConfig === null) { |
| 276 | + $this->deploymentConfig = \Magento\Framework\App\ObjectManager::getInstance() |
| 277 | + ->get(\Magento\Framework\App\DeploymentConfig::class); |
| 278 | + } |
| 279 | + return $this->deploymentConfig; |
| 280 | + } |
269 | 281 | }
|
0 commit comments