You are here

function drush_lightning_core_pre_updatedb in Lightning Core 8.4

Same name and namespace in other branches
  1. 8.5 lightning_core.drush.inc \drush_lightning_core_pre_updatedb()
  2. 8.2 lightning_core.drush.inc \drush_lightning_core_pre_updatedb()
  3. 8.3 lightning_core.drush.inc \drush_lightning_core_pre_updatedb()

Implements drush_hook_pre_COMMAND().

File

./lightning_core.drush.inc, line 23
Drush integration for Lightning.

Code

function drush_lightning_core_pre_updatedb() {

  // A common cause of errors during database updates is update hooks referring
  // to new or changed plugin definitions. Clearing all plugin caches before
  // updates begin ensures that the plugin system always has the latest plugin
  // definitions to work with.
  if (Drupal::hasContainer()) {
    Drupal::service('plugin.cache_clearer')
      ->clearCachedDefinitions();
  }
}