Skip to content

Commit

Permalink
Drupal 8: Refresh module cache after downloading new modules. Fixes d…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhattan authored and mikeker committed Aug 4, 2017
1 parent b51dc07 commit c099876
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands/pm/pm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,10 @@ function drush_pm_enable_validate() {
// Restore DRUSH_AFFIRMATIVE context.
drush_set_context('DRUSH_AFFIRMATIVE', $drush_affirmative);
// Refresh module cache after downloading the new modules.
if (drush_drupal_major_version() >= 8) {
\Drush\Drupal\ExtensionDiscovery::reset();
system_list_reset();
}
$extension_info = drush_get_extensions();
$recheck = TRUE;
}
Expand Down
12 changes: 12 additions & 0 deletions lib/Drush/Drupal/ExtensionDiscovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Drush\Drupal;

use \Drupal\Core\Extension\ExtensionDiscovery as DrupalExtensionDiscovery;

class ExtensionDiscovery extends DrupalExtensionDiscovery {
static public function reset() {
static::$files = array();
}
}

0 comments on commit c099876

Please sign in to comment.