示例#1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $force = $input->getOption('force');
     $config_si = $input->getOption('config');
     $installer = new Installer($this->getService('sugarcrm.application'), $input->getOption('source'), $config_si);
     try {
         $installer->run($force);
         $output->writeln('Installation was sucessfully completed.');
     } catch (InstallerException $e) {
         $logger = $this->getService('logger');
         $logger->error('An error occured during the installation.');
         $logger->error($e->getMessage());
         return ExitCode::EXIT_INSTALL_ERROR;
     }
 }
示例#2
0
 /**
  * @group sugar
  */
 public function testInstall()
 {
     $this->assertFileExists(getenv('SUGARCRM_PATH'), 'Please specify the SUGARCRM_PATH from the environment or phpunit.xml file.');
     $install_path = getenv('SUGARCRM_PATH') . '/inetprocess_installer';
     $fs = new Filesystem();
     if ($fs->exists($install_path)) {
         $fs->remove($install_path);
     }
     $fs->mkdir($install_path);
     $installer = new Installer($this->newApp($install_path), __DIR__ . '/installer/Fake_Sugar.zip', __DIR__ . '/installer/config_si.php');
     $installer->run();
     $this->assertTrue($installer->getApplication()->isValid(), 'The install did not extract the zip archive correctly');
     $this->assertTrue($installer->getApplication()->isInstalled(), 'The installer did not perform the sugar installation correctly.');
     $sugar_config = $installer->getApplication()->getSugarConfig();
     $this->assertEquals('UTF-8', $sugar_config['default_export_charset']);
     $fs->remove($install_path);
 }