Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions drush/Commands/PolicyCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/**
* Edit this file to reflect your organization's needs.
*/
class PolicyCommands extends DrushCommands {
class PolicyCommands extends DrushCommands
{

/**
* Prevent catastrophic braino. Note that this file has to be local to the
Expand All @@ -17,7 +18,8 @@ class PolicyCommands extends DrushCommands {
*
* @throws \Exception
*/
public function sqlSyncValidate(CommandData $commandData) {
public function sqlSyncValidate(CommandData $commandData)
{
if ($commandData->input()->getArgument('target') == '@prod') {
throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__]));
}
Expand All @@ -30,7 +32,8 @@ public function sqlSyncValidate(CommandData $commandData) {
*
* @throws \Exception
*/
public function rsyncValidate(CommandData $commandData) {
public function rsyncValidate(CommandData $commandData)
{
if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) {
throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
}
Expand Down