/** * Install/Uninstall application * * @param \Magento\Install\Model\Installer\Console $installer * @return void */ protected function _handleInstall(\Magento\Install\Model\Installer\Console $installer) { if (isset($this->_arguments['config']) && $this->rootDirectory->isExist($this->rootDirectory->getRelativePath($this->_arguments['config']))) { $config = (array) (include $this->_arguments['config']); $this->_arguments = array_merge((array) $config, $this->_arguments); } $isUninstallMode = isset($this->_arguments['uninstall']); if ($isUninstallMode) { $result = $installer->uninstall(); } else { $result = $installer->install($this->_arguments); } if (!$installer->hasErrors()) { if ($isUninstallMode) { $msg = $result ? 'Uninstalled successfully' : 'Ignoring attempt to uninstall non-installed application'; } else { $msg = 'Installed successfully' . ($result ? ' (encryption key "' . $result . '")' : ''); } $this->_output->success($msg . PHP_EOL); } else { $this->_output->error(implode(PHP_EOL, $installer->getErrors()) . PHP_EOL); } }