Esempio n. 1
0
 /**
  * Iterates all Shopware 5 themes which
  * stored in the /engine/Shopware/Themes directory.
  * Each theme are stored as new Shopware\Models\Shop\Template.
  *
  * After the themes are initialed and stored in the database,
  * the function resolves the inheritance of each theme.
  *
  * After the inheritance is build, the installer uses
  * the Theme\Configurator to synchronize the theme configurations.
  *
  */
 private function synchronizeThemes()
 {
     //creates a directory iterator for the default theme directory (engine/Shopware/Themes)
     $directories = new \DirectoryIterator($this->pathResolver->getFrontendThemeDirectory());
     //synchronize the default themes which are stored in the engine/Shopware/Themes directory.
     $themes = $this->synchronizeThemeDirectories($directories);
     //to prevent inconsistent data, themes that were removed from the file system have to be removed.
     $this->removeDeletedThemes();
     //before the inheritance can be built, the plugin themes have to be initialized.
     $pluginThemes = $this->synchronizePluginThemes();
     $themes = array_merge($themes, $pluginThemes);
     //builds the theme inheritance
     $this->setParents($themes);
     /**@var $theme Theme */
     foreach ($themes as $theme) {
         $this->configurator->synchronize($theme);
     }
 }
Esempio n. 2
0
 /**
  * Helper function to generate the full theme directory name.
  * example: /var/www/engine/Shopware/Themes/MyTheme
  *
  * @param $name
  * @return string
  */
 private function getThemeDirectory($name)
 {
     return $this->pathResolver->getFrontendThemeDirectory() . DIRECTORY_SEPARATOR . $name;
 }