Drupal 8  8.0.2
ThemeInstaller Class Reference
Inheritance diagram for ThemeInstaller:

Public Member Functions

 __construct (ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory, ConfigInstallerInterface $config_installer, ModuleHandlerInterface $module_handler, ConfigManagerInterface $config_manager, AssetCollectionOptimizerInterface $css_collection_optimizer, RouteBuilderInterface $route_builder, LoggerInterface $logger, StateInterface $state)
 
 install (array $theme_list, $install_dependencies=TRUE)
 
 uninstall (array $theme_list)
 

Protected Member Functions

 resetSystem ()
 
 themeRegistryRebuild ()
 
 systemListReset ()
 

Protected Attributes

 $configFactory
 
 $configInstaller
 
 $moduleHandler
 
 $state
 
 $configManager
 
 $cssCollectionOptimizer
 
 $routeBuilder
 
 $logger
 

Detailed Description

Manages theme installation/uninstallation.

Constructor & Destructor Documentation

__construct ( ThemeHandlerInterface  $theme_handler,
ConfigFactoryInterface  $config_factory,
ConfigInstallerInterface  $config_installer,
ModuleHandlerInterface  $module_handler,
ConfigManagerInterface  $config_manager,
AssetCollectionOptimizerInterface  $css_collection_optimizer,
RouteBuilderInterface  $route_builder,
LoggerInterface  $logger,
StateInterface  $state 
)

Constructs a new ThemeInstaller.

Parameters
\Drupal\Core\Extension\ThemeHandlerInterface$theme_handlerThe theme handler.
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe config factory to get the installed themes.
\Drupal\Core\Config\ConfigInstallerInterface$config_installer(optional) The config installer to install configuration. This optional to allow the theme handler to work before Drupal is installed and has a database.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler to fire themes_installed/themes_uninstalled hooks.
\Drupal\Core\Config\ConfigManagerInterface$config_managerThe config manager used to uninstall a theme.
\Drupal\Core\Asset\AssetCollectionOptimizerInterface$css_collection_optimizerThe CSS asset collection optimizer service.
\Drupal\Core\Routing\RouteBuilderInterface$route_builder(optional) The route builder service to rebuild the routes if a theme is installed.
\Psr\Log\LoggerInterface$loggerA logger instance.
\Drupal\Core\State\StateInterface$stateThe state store.

References Drupal\configFactory(), Drupal\logger(), Drupal\moduleHandler(), and Drupal\state().

Here is the call graph for this function:

Member Function Documentation

install ( array  $theme_list,
  $install_dependencies = TRUE 
)

{Installs a given list of themes.

Parameters
array$theme_listAn array of theme names.
bool$install_dependencies(optional) If TRUE, dependencies will automatically be installed in the correct order. This incurs a significant performance cost, so use FALSE if you know $theme_list is already complete and in the correct order.
Returns
bool Whether any of the given themes have been installed.
Exceptions
\Drupal\Core\Extension\ExtensionNameLengthExceptionThrown when the theme name is to long
}

Implements ThemeInstallerInterface.

References Drupal\configFactory(), Drupal\logger(), Drupal\moduleHandler(), ThemeInstaller\resetSystem(), Drupal\state(), and ThemeInstaller\systemListReset().

Here is the call graph for this function:

resetSystem ( )
protected

Resets some other systems like rebuilding the route information or caches.

References Cache\invalidateTags(), ThemeInstaller\systemListReset(), and ThemeInstaller\themeRegistryRebuild().

Referenced by ThemeInstaller\install(), and ThemeInstaller\uninstall().

Here is the call graph for this function:

Here is the caller graph for this function:

systemListReset ( )
protected

Wraps system_list_reset().

Referenced by ThemeInstaller\install(), and ThemeInstaller\resetSystem().

Here is the caller graph for this function:

themeRegistryRebuild ( )
protected

Wraps drupal_theme_rebuild().

Referenced by ThemeInstaller\resetSystem().

Here is the caller graph for this function:

uninstall ( array  $theme_list)

{Uninstalls a given list of themes.Uninstalling a theme removes all related configuration (like blocks) and invokes the 'themes_uninstalled' hook.

Parameters
array$theme_listThe themes to uninstall.
Exceptions
\InvalidArgumentExceptionThrown when you uninstall an not installed theme.
See Also
hook_themes_uninstalled()
}

Implements ThemeInstallerInterface.

References Drupal\configFactory(), Drupal\moduleHandler(), ThemeInstaller\resetSystem(), and Drupal\state().

Here is the call graph for this function:


The documentation for this class was generated from the following file: