Skip to content

Commit 7474def

Browse files
author
Yevhen Miroshnychenko
authored
Merge pull request #3127 from magento-thunder/MAGETWO-94475
Fixed issues: - MAGETWO-94475: [Backport to 2.2] Command bin/magento doesn't work if Magento uninstalled
2 parents fbb7fad + 9d2b0e6 commit 7474def

File tree

1 file changed

+0
-29
lines changed
  • lib/internal/Magento/Framework/Console

1 file changed

+0
-29
lines changed

lib/internal/Magento/Framework/Console/Cli.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Magento\Framework\App\DeploymentConfig;
1010
use Magento\Framework\App\Filesystem\DirectoryList;
1111
use Magento\Framework\App\ProductMetadata;
12-
use Magento\Framework\App\State;
1312
use Magento\Framework\Composer\ComposerJsonFinder;
1413
use Magento\Framework\Console\Exception\GenerationDirectoryAccessException;
1514
use Magento\Framework\Filesystem\Driver\File;
@@ -74,7 +73,6 @@ public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
7473

7574
$this->assertCompilerPreparation();
7675
$this->initObjectManager();
77-
$this->assertGenerationPermissions();
7876
} catch (\Exception $exception) {
7977
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
8078
$output->writeln(
@@ -167,33 +165,6 @@ private function initObjectManager()
167165
$omProvider->setObjectManager($this->objectManager);
168166
}
169167

170-
/**
171-
* Checks whether generation directory is read-only.
172-
* Depends on the current mode:
173-
* production - application will proceed
174-
* default - application will be terminated
175-
* developer - application will be terminated
176-
*
177-
* @return void
178-
* @throws GenerationDirectoryAccessException If generation directory is read-only in developer mode
179-
*/
180-
private function assertGenerationPermissions()
181-
{
182-
/** @var GenerationDirectoryAccess $generationDirectoryAccess */
183-
$generationDirectoryAccess = $this->objectManager->create(
184-
GenerationDirectoryAccess::class,
185-
['serviceManager' => $this->serviceManager]
186-
);
187-
/** @var State $state */
188-
$state = $this->objectManager->get(State::class);
189-
190-
if ($state->getMode() !== State::MODE_PRODUCTION
191-
&& !$generationDirectoryAccess->check()
192-
) {
193-
throw new GenerationDirectoryAccessException();
194-
}
195-
}
196-
197168
/**
198169
* Checks whether compiler is being prepared.
199170
*

0 commit comments

Comments
 (0)