/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->updateModulesSequence(); $installer->installSchema(); $installer->installDataFixtures(); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->deploymentConfig->isAvailable()) { $output->writeln("<info>No information is available: the application is not installed.</info>"); return; } $installer = $this->installFactory->create(new ConsoleLogger($output)); $installer->installSchema(); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Are you sure you want to uninstall Magento?[y/N]', false); if ($helper->ask($input, $output, $question) || !$input->isInteractive()) { $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->uninstall(); } }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->deploymentConfig->isAvailable()) { $output->writeln("<info>Store settings can't be saved because the Magento application is not installed.</info>"); return; } $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->installUserConfig($input->getOptions()); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->deploymentConfig->isAvailable()) { $output->writeln("<info>No information is available: the Magento application is not installed.</info>"); // we must have an exit code higher than zero to indicate something was wrong return \Magento\Framework\Console\Cli::RETURN_FAILURE; } $installer = $this->installFactory->create(new ConsoleLogger($output)); $installer->installDataFixtures(); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $errors = $this->validate($input); if ($errors) { throw new \InvalidArgumentException(implode("\n", $errors)); } $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->installAdminUser($input->getOptions()); $output->writeln('<info>Created admin user ' . $input->getOption(AdminAccount::KEY_USER) . '</info>'); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $errors = $this->validate($input); if ($errors) { $output->writeln('<error>' . implode('</error>' . PHP_EOL . '<error>', $errors) . '</error>'); return; } $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->installAdminUser($input->getOptions()); $output->writeln('<info>Created Shop123 Administrator user named ' . $input->getOption(AdminAccount::KEY_USER) . '</info>'); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED); $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->updateModulesSequence($keepGenerated); $installer->installSchema(); $installer->installDataFixtures(); if (!$keepGenerated) { $output->writeln('<info>Please re-run Magento compile command</info>'); } }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $errors = $this->validate($input); if ($errors) { $output->writeln('<error>' . implode('</error>' . PHP_EOL . '<error>', $errors) . '</error>'); // we must have an exit code higher than zero to indicate something was wrong return \Magento\Framework\Console\Cli::RETURN_FAILURE; } $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->installAdminUser($input->getOptions()); $output->writeln('<info>Created Magento administrator user named ' . $input->getOption(AdminAccount::KEY_USER) . '</info>'); }
/** * Result of checking DB credentials * * @return JsonModel */ public function indexAction() { $params = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY); try { $installer = $this->installerFactory->create($this->webLogger); $password = isset($params['password']) ? $params['password'] : ''; $installer->checkDatabaseConnection($params['name'], $params['host'], $params['user'], $password); return new JsonModel(['success' => true]); } catch (\Exception $e) { return new JsonModel(['success' => false, 'error' => $e->getMessage()]); } }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->deploymentConfig->isAvailable()) { $output->writeln("<info>Store settings can't be saved because the Magento application is not installed.</info>"); // we must have an exit code higher than zero to indicate something was wrong return \Magento\Framework\Console\Cli::RETURN_FAILURE; } $errors = $this->validate($input); if ($errors) { $output->writeln($errors); // we must have an exit code higher than zero to indicate something was wrong return \Magento\Framework\Console\Cli::RETURN_FAILURE; } $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->installUserConfig($input->getOptions()); }
/** * Default Constructor * * @param WebLogger $logger * @param InstallerFactory $installerFactory * @param ProgressFactory $progressFactory * @param \Magento\Framework\Setup\SampleData\State $sampleDataState */ public function __construct(WebLogger $logger, InstallerFactory $installerFactory, ProgressFactory $progressFactory, \Magento\Framework\Setup\SampleData\State $sampleDataState) { $this->log = $logger; $this->installer = $installerFactory->create($logger); $this->progressFactory = $progressFactory; $this->sampleDataState = $sampleDataState; }
/** * Default Constructor * * @param WebLogger $logger * @param InstallerFactory $installerFactory * @param ProgressFactory $progressFactory * @param \Magento\Framework\Setup\SampleData\State $sampleDataState * @param \Magento\Framework\App\DeploymentConfig $deploymentConfig * @param RequestDataConverter $requestDataConverter */ public function __construct(WebLogger $logger, InstallerFactory $installerFactory, ProgressFactory $progressFactory, \Magento\Framework\Setup\SampleData\State $sampleDataState, DeploymentConfig $deploymentConfig, RequestDataConverter $requestDataConverter) { $this->log = $logger; $this->installer = $installerFactory->create($logger); $this->progressFactory = $progressFactory; $this->sampleDataState = $sampleDataState; $this->deploymentConfig = $deploymentConfig; $this->requestDataConverter = $requestDataConverter; }
/** * Default Constructor * * @param WebLogger $logger * @param InstallerFactory $installerFactory * @param ProgressFactory $progressFactory */ public function __construct( WebLogger $logger, InstallerFactory $installerFactory, ProgressFactory $progressFactory ) { $this->log = $logger; $this->installer = $installerFactory->create($logger); $this->progressFactory = $progressFactory; }
public function testCreate() { $returnValueMap = [['Magento\\Setup\\Model\\FilePermissions', $this->getMock('Magento\\Setup\\Model\\FilePermissions', [], [], '', false)], ['Magento\\Framework\\App\\DeploymentConfig\\Writer', $this->getMock('Magento\\Framework\\App\\DeploymentConfig\\Writer', [], [], '', false)], ['Magento\\Framework\\App\\DeploymentConfig\\Reader', $this->getMock('Magento\\Framework\\App\\DeploymentConfig\\Reader', [], [], '', false)], ['Magento\\Framework\\App\\DeploymentConfig', $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false)], ['Magento\\Framework\\Module\\ModuleList', $this->getMock('Magento\\Framework\\Module\\ModuleList', [], [], '', false)], ['Magento\\Framework\\Module\\ModuleList\\Loader', $this->getMock('Magento\\Framework\\Module\\ModuleList\\Loader', [], [], '', false)], ['Magento\\Setup\\Model\\AdminAccountFactory', $this->getMock('Magento\\Setup\\Model\\AdminAccountFactory', [], [], '', false)], ['Magento\\Setup\\Module\\ConnectionFactory', $this->getMock('Magento\\Setup\\Module\\ConnectionFactory', [], [], '', false)], ['Magento\\Framework\\App\\MaintenanceMode', $this->getMock('Magento\\Framework\\App\\MaintenanceMode', [], [], '', false)], ['Magento\\Framework\\Filesystem', $this->getMock('Magento\\Framework\\Filesystem', [], [], '', false)], ['Magento\\Setup\\Model\\ObjectManagerProvider', $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false)], ['Magento\\Framework\\Model\\ResourceModel\\Db\\TransactionManager', $this->getMock('Magento\\Framework\\Model\\ResourceModel\\Db\\TransactionManager', [], [], '', false)], ['Magento\\Framework\\Model\\ResourceModel\\Db\\ObjectRelationProcessor', $this->getMock('Magento\\Framework\\Model\\ResourceModel\\Db\\ObjectRelationProcessor', [], [], '', false)], ['Magento\\Setup\\Model\\ConfigModel', $this->getMock('Magento\\Setup\\Model\\ConfigModel', [], [], '', false)], ['Magento\\Framework\\App\\State\\CleanupFiles', $this->getMock('Magento\\Framework\\App\\State\\CleanupFiles', [], [], '', false)], ['Magento\\Setup\\Validator\\DbValidator', $this->getMock('Magento\\Setup\\Validator\\DbValidator', [], [], '', false)], ['Magento\\Setup\\Module\\SetupFactory', $this->getMock('Magento\\Setup\\Module\\SetupFactory', [], [], '', false)], ['Magento\\Setup\\Module\\DataSetupFactory', $this->getMock('Magento\\Setup\\Module\\DataSetupFactory', [], [], '', false)], ['Magento\\Framework\\Setup\\SampleData\\State', $this->getMock('Magento\\Framework\\Setup\\SampleData\\State', [], [], '', false)]]; $serviceLocatorMock = $this->getMockForAbstractClass('Zend\\ServiceManager\\ServiceLocatorInterface', ['get']); $serviceLocatorMock->expects($this->any())->method('get')->will($this->returnValueMap($returnValueMap)); $log = $this->getMockForAbstractClass('Magento\\Framework\\Setup\\LoggerInterface'); $resourceFactoryMock = $this->getMock('Magento\\Setup\\Module\\ResourceFactory', [], [], '', false); $resourceFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->getMock('Magento\\Framework\\App\\ResourceConnection', [], [], '', false))); $installerFactory = new InstallerFactory($serviceLocatorMock, $resourceFactoryMock); $installer = $installerFactory->create($log); $this->assertInstanceOf('Magento\\Setup\\Model\\Installer', $installer); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $consoleLogger = new ConsoleLogger($output); $installer = $this->installerFactory->create($consoleLogger); $installer->install($input->getOptions()); }
/** * Constructor * * @param ConsoleLogger $consoleLogger * @param Lists $options * @param InstallerFactory $installerFactory * @param MaintenanceMode $maintenanceMode */ public function __construct(ConsoleLogger $consoleLogger, Lists $options, InstallerFactory $installerFactory, MaintenanceMode $maintenanceMode) { $this->log = $consoleLogger; $this->options = $options; $this->installer = $installerFactory->create($consoleLogger); $this->maintenanceMode = $maintenanceMode; }
/** * Constructor * * @param ConsoleLogger $consoleLogger * @param Lists $options * @param InstallerFactory $installerFactory * @param MaintenanceMode $maintenanceMode * @param ObjectManagerProvider $objectManagerProvider */ public function __construct(ConsoleLogger $consoleLogger, Lists $options, InstallerFactory $installerFactory, MaintenanceMode $maintenanceMode, ObjectManagerProvider $objectManagerProvider) { $this->log = $consoleLogger; $this->options = $options; $this->installer = $installerFactory->create($consoleLogger); $this->maintenanceMode = $maintenanceMode; $this->objectManagerProvider = $objectManagerProvider; // By default we use our customized error handler, but for CLI we want to display all errors restore_error_handler(); }