-
-
Save keopx/db50241fc6424f347e17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/** | |
* Implement of drush_hook_COMMAND_validate(). | |
* | |
* Prevent catastrophic sql-sync to live. Note that this file has to be local to the | |
* machine that intitiates sql-sync command. | |
*/ | |
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) { | |
if (strstr($destination, '.prod')) { | |
return drush_set_error(dt('You may never overwrite the production database.')); | |
} | |
} | |
/** | |
* Implement of drush_hook_COMMAND_validate(). | |
* | |
* Prevent catastrophic rsync to live. Note that this file has to be local to the machine | |
* that intitiates sql-sync command. | |
*/ | |
function drush_policy_core_rsync_validate($source = NULL, $destination = NULL) { | |
if (strstr($destination, '.prod')) { | |
return drush_set_error(dt('You may never overwrite the production files.')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment