Last active
August 5, 2016 16:44
-
-
Save KeyboardCowboy/f4c91d5fcdfe879c44007278c89eabd7 to your computer and use it in GitHub Desktop.
Keep selected Drupal modules out of PROD automatically with Drush.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a safe space for dangerous modules. | |
/sites/*/modules/ignored/ | |
/docroot/sites/*/modules/ignored/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Store dangerous contrib modules in an 'ignored' directory. | |
* | |
* See @pm_drush_pm_download_destination_alter(). | |
* | |
* @param array $project | |
* Information about the project. | |
* @param array $release | |
* Information about the particular release version being downloaded. | |
*/ | |
function quarantine_drush_pm_download_destination_alter(&$project, $release) { | |
$safe_place = DRUPAL_ROOT . '/sites/all/modules/ignored'; | |
$quarantine = array( | |
'coder', | |
'coffee', | |
'devel', | |
'devel_themer', | |
'masquerade', | |
'module_filter', | |
); | |
// Alter the destination of quarantined modules. | |
if (in_array($project['name'], $quarantine)) { | |
$project['project_install_location'] = $safe_place; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Know how this would work for D8 or using composer? Fork this and post the link here or post your additions in the comments and I'll update.