/**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->updateMemoryLimit();
     $sampleDataPackages = $this->sampleDataDependency->getSampleDataPackages();
     if (!empty($sampleDataPackages)) {
         $baseDir = $this->filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath();
         $commonArgs = ['--working-dir' => $baseDir, '--no-progress' => 1];
         $packages = [];
         foreach ($sampleDataPackages as $name => $version) {
             $packages[] = "{$name}:{$version}";
         }
         $commonArgs = array_merge(['packages' => $packages], $commonArgs);
         $arguments = array_merge(['command' => 'require'], $commonArgs);
         /** @var ArrayInput $commandInput */
         $commandInput = $this->arrayInputFactory->create(['parameters' => $arguments]);
         /** @var Application $application */
         $application = $this->applicationFactory->create();
         $application->setAutoExit(false);
         $result = $application->run($commandInput, $output);
         if ($result !== 0) {
             $output->writeln('<info>' . 'There is an error during sample data deployment.' . '</info>');
         }
     } else {
         $output->writeln('<info>' . 'There is no sample data for current set of modules.' . '</info>');
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $sampleDataPackages = $this->sampleDataDependency->getSampleDataPackages();
     if (!empty($sampleDataPackages)) {
         foreach (array_keys($sampleDataPackages) as $name) {
             $moduleName = $this->packageInfo->getModuleName($name);
             $this->moduleResource->setDataVersion($moduleName, '');
         }
         $output->writeln('<info>' . 'Reset of sample data version completed successfully.' . '</info>');
     } else {
         $output->writeln('<info>' . 'There is no sample data for current set of modules.' . '</info>');
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $sampleDataPackages = $this->sampleDataDependency->getSampleDataPackages();
     if (!empty($sampleDataPackages)) {
         $baseDir = $this->filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath();
         $commonArgs = ['--working-dir' => $baseDir, '--no-interaction' => 1, '--no-progress' => 1];
         $packages = array_keys($sampleDataPackages);
         $arguments = array_merge(['command' => 'remove', 'packages' => $packages], $commonArgs);
         $commandInput = new ArrayInput($arguments);
         /** @var Application $application */
         $application = $this->applicationFactory->create();
         $application->setAutoExit(false);
         $result = $application->run($commandInput, $output);
         if ($result !== 0) {
             $output->writeln('<info>' . 'There is an error during remove sample data.' . '</info>');
         }
     } else {
         $output->writeln('<info>' . 'There is no sample data for current set of modules.' . '</info>');
     }
 }
Beispiel #4
0
 /**
  * 2016-09-03
  * «vendor/mage2pro/core/Backend/composer.json» => «vendor/mage2pro/core/composer.json»
  * @override
  * @see \Magento\SampleData\Model\Dependency::getModuleComposerPackage()
  * @used-by \Magento\SampleData\Model\Dependency::getSuggestsFromModules()
  * @param string $file
  * @return \Magento\Framework\Config\Composer\Package
  */
 protected function getModuleComposerPackage($file)
 {
     return parent::getModuleComposerPackage(false === strpos($file, 'mage2pro') || file_exists($file) ? $file : preg_replace('#/mage2pro/core/[^/]+/#', '/mage2pro/core/', df_path_n($file)));
 }