Created
September 16, 2010 11:23
-
-
Save pborreli/582284 to your computer and use it in GitHub Desktop.
disable drop-db task in symfony console
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 | |
class ProjectConfiguration extends sfProjectConfiguration | |
{ | |
public function setup() | |
{ | |
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions')); | |
} | |
/** | |
* Filters command options. | |
* | |
* @param sfEvent $event | |
* @param array $options | |
* | |
* @return array | |
*/ | |
public function filterCommandOptions(sfEvent $event, $options) { | |
if ('sfDoctrineDropDbTask' === get_class($event->getSubject())) | |
{ | |
$event->getSubject()->logSection('doctrine', 'You are not allowed to drop database', null, 'ERROR'); | |
die(); | |
} | |
return $options; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment