Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ThemeUninstaller.php
Go to the documentation of this file.
1 <?php
7 
9 use Symfony\Component\Console\Output\OutputInterface;
10 
12 {
16  private $themePackageInfo;
17 
21  private $remove;
22 
26  private $themeProvider;
27 
35  public function __construct(ThemePackageInfo $themePackageInfo, Remove $remove, ThemeProvider $themeProvider)
36  {
37  $this->themePackageInfo = $themePackageInfo;
38  $this->remove = $remove;
39  $this->themeProvider = $themeProvider;
40  }
41 
49  public function uninstallRegistry(OutputInterface $output, array $themePaths)
50  {
51  $output->writeln('<info>Removing ' . implode(', ', $themePaths) . ' from database');
52  foreach ($themePaths as $themePath) {
53  $this->themeProvider->getThemeByFullPath($themePath)->delete();
54  }
55  }
56 
64  public function uninstallCode(OutputInterface $output, array $themePaths)
65  {
66  $output->writeln('<info>Removing ' . implode(', ', $themePaths) . ' from Magento codebase');
67  $packageNames = [];
68  foreach ($themePaths as $themePath) {
69  $packageNames[] = $this->themePackageInfo->getPackageName($themePath);
70  }
71  $output->writeln($this->remove->remove($packageNames));
72  }
73 }
__construct(ThemePackageInfo $themePackageInfo, Remove $remove, ThemeProvider $themeProvider)
uninstallCode(OutputInterface $output, array $themePaths)
uninstallRegistry(OutputInterface $output, array $themePaths)