Skip to content

Commit d7be6e7

Browse files
committed
MAGETWO-35132: Create console shell
- change to use ObjectManager
1 parent 42b8e55 commit d7be6e7

File tree

1 file changed

+4
-4
lines changed
  • lib/internal/Magento/Framework

1 file changed

+4
-4
lines changed

lib/internal/Magento/Framework/Cli.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ protected function getApplicationCommands()
4545
$params = $bootstrapParam->mergeFromArgv($_SERVER, $_SERVER);
4646
$params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null;
4747
$bootstrap = Bootstrap::create(BP, $params);
48-
$serviceManager = \Zend\Mvc\Application::init(require BP . '/setup/config/application.config.php')
49-
->getServiceManager();
48+
$objectManager = $bootstrap->getObjectManager();
5049

5150
if (class_exists('Magento\Setup\Console\CommandList')) {
51+
$serviceManager = \Zend\Mvc\Application::init(require BP . '/setup/config/application.config.php')
52+
->getServiceManager();
5253
$setupCommandList = new \Magento\Setup\Console\CommandList($serviceManager);
5354
$setupCommands = $setupCommandList->getCommands();
5455
}
@@ -58,8 +59,7 @@ protected function getApplicationCommands()
5859
$toolsCommands = $toolsCommandList->getCommands();
5960
}
6061

61-
if ($serviceManager->get('Magento\Framework\App\DeploymentConfig')->isAvailable()) {
62-
$objectManager = $bootstrap->getObjectManager();
62+
if ($objectManager->get('Magento\Framework\App\DeploymentConfig')->isAvailable()) {
6363
$commandList = $objectManager->create(
6464
'Magento\Framework\Console\CommandList',
6565
['objectManager'=>$objectManager]

0 commit comments

Comments
 (0)