public function UpdateModuleHandler::getImplementations

Implements \Drupal\Core\Extension\ModuleHandlerInterface::getImplementations().

Overrides ModuleHandler::getImplementations

File

drupal/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php, line 23
Contains \Drupal\Core\Extension\UpdateModuleHandler.

Class

UpdateModuleHandler
Deals with module enables and throws exception if hooks fired during updates.

Namespace

Drupal\Core\Extension

Code

public function getImplementations($hook) {
  if (substr($hook, -6) === '_alter') {
    return array();
  }
  switch ($hook) {

    // hook_requirements is necessary for updates to work.
    case 'requirements':

    // Allow logging.
    case 'watchdog':
      return parent::getImplementations($hook);

    // Forms and pages do not render without the basic elements defined in
    // system_element_info().
    case 'element_info':

    // Forms do not render without the basic elements in
    // drupal_common_theme() called from system_theme().
    case 'theme':

    // user_update_8011() uses public:// to create the image style directory.
    case 'stream_wrappers':
      return array(
        'system',
      );

    // This is called during rebuild to find testing themes.
    case 'system_theme_info':
      return array();

    // t() in system_stream_wrappers() needs this. Other schema calls aren't
    // supported.
    case 'schema':
      return array(
        'locale',
      );
    default:
      throw new \LogicException("Invoking hooks {$hook} is not supported during updates");
  }
}