Did you find yourself ashamed, running command in the wrong environment ?
"Oups... I dropped the database in the prod environment..." - A guy that lost his job
This bundle want to help. Using configuration, define commands that you are not expecting to be used in your environment.
That's it...
composer require yokai/safe-command-bundle
<?php
// config/bundles.php
return [
// ...
Yokai\SafeCommandBundle\YokaiSafeCommandBundle::class => ['prod' => true],
];
Note
The bundle is enabled only for prod
here, but you are free to do whatever you want.
The bundle comes with some commands disabled by default (from Symfony's standards).
That "standard" command list can be overridden:
# config/packages/yokai_safe_command.yaml
when@prod:
yokai_safe_command:
standard: []
Note
"standard" disabled commands are viewable via the command:
bin/console config:dump-reference yokai_safe_command
And you can also add your own commands to the list:
# config/packages/yokai_safe_command.yaml
when@prod:
yokai_safe_command:
custom:
- 'vendor:my:dev-command'
- 'app:my:dev-command'
Note
standard
and custom
configs are merged together to create the final list of disabled commands.
This library is under MIT LICENSE.
The bundle was originally created by Yann Eugoné.
See the list of contributors.