/**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $languages = $input->getArgument(self::PACKAGE_ARGUMENT);
     $packagesToRemove = [];
     $dependencies = $this->dependencyChecker->checkDependencies($languages, true);
     foreach ($languages as $package) {
         if (!$this->validate($package)) {
             $output->writeln("<info>Package {$package} is not a Magento language and will be skipped.</info>");
         } else {
             if (sizeof($dependencies[$package]) > 0) {
                 $output->writeln("<info>Package {$package} has dependencies and will be skipped.</info>");
             } else {
                 $packagesToRemove[] = $package;
             }
         }
     }
     if ($packagesToRemove !== []) {
         if ($input->getOption(self::BACKUP_CODE_OPTION)) {
             $backupRestore = $this->backupRollbackFactory->create($output);
             $backupRestore->codeBackup(time());
         } else {
             $output->writeln('<info>You are removing language package without a code backup.</info>');
         }
         $output->writeln($this->remove->remove($packagesToRemove));
         $this->cache->clean();
     } else {
         $output->writeln('<info>Nothing is removed.</info>');
     }
 }
 /**
  * Do the cleanup
  *
  * @return void
  */
 protected function performCleanup()
 {
     $this->status->add('Cleaning generated files...', \Psr\Log\LogLevel::INFO);
     $this->cleanupFiles->clearCodeGeneratedFiles();
     $this->status->add('Complete!', \Psr\Log\LogLevel::INFO);
     $this->status->add('Clearing cache...', \Psr\Log\LogLevel::INFO);
     $this->cache->clean();
     $this->status->add('Complete!', \Psr\Log\LogLevel::INFO);
 }
 /**
  * Cleanup after updated modules status
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return void
  */
 private function cleanup(InputInterface $input, OutputInterface $output)
 {
     $this->cache->clean();
     $output->writeln('<info>Cache cleared successfully.</info>');
     if ($input->getOption(self::INPUT_KEY_CLEAR_STATIC_CONTENT)) {
         $this->cleanupFiles->clearMaterializedViewFiles();
         $output->writeln('<info>Generated static view files cleared successfully.</info>');
     } else {
         $output->writeln('<error>Alert: Generated static view files were not cleared.' . ' You can clear them using the --' . self::INPUT_KEY_CLEAR_STATIC_CONTENT . ' option.' . ' Failure to clear static view files might cause display issues in the Admin and storefront.</error>');
     }
 }
Exemple #4
0
 public function testCleanByEmptyTags()
 {
     $this->_cacheFrontendMock->expects($this->once())->method('clean')->with(\Zend_Cache::CLEANING_MODE_ALL)->will($this->returnValue(true));
     $this->assertTrue($this->_model->clean());
 }
Exemple #5
0
 public function removeTagValues($tag)
 {
     $tags = array(\Ess\M2ePro\Helper\Data::CUSTOM_IDENTIFIER . '_' . $tag);
     $this->cache->clean($tags);
 }