forked from drupal-composer/drupal-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update /drush dir for Drush9 (drupal-composer#350)
- Loading branch information
Showing
4 changed files
with
59 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Drush\Commands; | ||
|
||
use Consolidation\AnnotatedCommand\CommandData; | ||
use Drush\Commands\DrushCommands; | ||
|
||
/** | ||
* Edit this file to reflect your organization's needs. | ||
*/ | ||
class PolicyCommands extends DrushCommands { | ||
|
||
/** | ||
* Prevent catastrophic braino. Note that this file has to be local to the | ||
* machine that initiates the sql:sync command. | ||
* | ||
* @hook validate sql:sync | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function sqlSyncValidate(CommandData $commandData) { | ||
if ($commandData->input()->getArgument('destination') == '@prod') { | ||
throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__])); | ||
} | ||
} | ||
|
||
/** | ||
* Limit rsync operations to production site. | ||
* | ||
* @hook validate core:rsync | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function rsyncValidate(CommandData $commandData) { | ||
if (preg_match("/^@prod/", $commandData->input()->getArgument('destination'))) { | ||
throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__])); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# A Drush configuration file | ||
# | ||
# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml | ||
# | ||
# Edit or remove this file as needed. |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Edit or remove this file as needed. | ||
# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.site.yml | ||
|
||
#prod: | ||
# host: prod.domain.com | ||
# user: www-admin | ||
# root: /path/to/drupal | ||
# uri: http://www.example.com | ||
# | ||
#stage: | ||
# host: stage.domain.com | ||
# user: www-admin | ||
# root: /path/to/drupal | ||
# uri: http://stage.example.com |