ThemeInstallerInterface.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Drupal\Core\Extension;
  3. /**
  4. * Manages theme installation/uninstallation.
  5. */
  6. interface ThemeInstallerInterface {
  7. /**
  8. * Installs a given list of themes.
  9. *
  10. * @param array $theme_list
  11. * An array of theme names.
  12. * @param bool $install_dependencies
  13. * (optional) If TRUE, dependencies will automatically be installed in the
  14. * correct order. This incurs a significant performance cost, so use FALSE
  15. * if you know $theme_list is already complete and in the correct order.
  16. *
  17. * @return bool
  18. * Whether any of the given themes have been installed.
  19. *
  20. * @throws \Drupal\Core\Extension\ExtensionNameLengthException
  21. * Thrown when the theme name is to long.
  22. *
  23. * @throws \Drupal\Core\Extension\Exception\UnknownExtensionException
  24. * Thrown when the theme does not exist.
  25. *
  26. * @throws \Drupal\Core\Extension\MissingDependencyException
  27. * Thrown when a requested dependency can't be found.
  28. */
  29. public function install(array $theme_list, $install_dependencies = TRUE);
  30. /**
  31. * Uninstalls a given list of themes.
  32. *
  33. * Uninstalling a theme removes all related configuration (like blocks) and
  34. * invokes the 'themes_uninstalled' hook.
  35. *
  36. * @param array $theme_list
  37. * The themes to uninstall.
  38. *
  39. * @throws \Drupal\Core\Extension\Exception\UnknownExtensionException
  40. * Thrown when trying to uninstall a theme that was not installed.
  41. *
  42. * @throws \InvalidArgumentException
  43. * Thrown when trying to uninstall the default theme or the admin theme.
  44. *
  45. * @see hook_themes_uninstalled()
  46. */
  47. public function uninstall(array $theme_list);
  48. }