1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace Drush\Commands;
- use Consolidation\AnnotatedCommand\CommandData;
- class PolicyCommands extends DrushCommands {
-
- 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__]));
- }
- }
-
- 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__]));
- }
- }
- }
|