Permalink
Browse files

SymfonyConsole: support lazy loading of commands

  • Loading branch information...
JanTvrdik committed Jan 25, 2018
1 parent 641135d commit f0ce88860ed223ec29da6a19796fcc7807cad1fe
@@ -16,9 +16,13 @@
class ContinueCommand extends BaseCommand
{
/** @var string */
protected static $defaultName = 'migrations:continue';
protected function configure()
{
$this->setName('migrations:continue');
$this->setName(self::$defaultName);
$this->setDescription('Updates database schema by running all new migrations');
$this->setHelp("If table 'migrations' does not exist in current database, it is created automatically.");
}
@@ -25,6 +25,9 @@ class CreateCommand extends BaseCommand
const CONTENT_SOURCE_STDIN = 'stdin';
const CONTENT_SOURCE_EMPTY = 'empty';
/** @var string */
protected static $defaultName = 'migrations:create';
/** @var string */
protected $defaultContentSource = self::CONTENT_SOURCE_DIFF;
@@ -44,7 +47,7 @@ public function setDefaultContentSource($defaultContentSource)
*/
protected function configure()
{
$this->setName('migrations:create');
$this->setName(self::$defaultName);
$this->setDescription('Creates new migration file with proper name (e.g. 2015-03-14-130836-label.sql)');
$this->setHelp('Prints path of the created file to standard output.');
@@ -16,9 +16,12 @@
class ResetCommand extends BaseCommand
{
/** @var string */
protected static $defaultName = 'migrations:reset';
protected function configure()
{
$this->setName('migrations:reset');
$this->setName(self::$defaultName);
$this->setDescription('Drops current database and recreates it from scratch');
$this->setHelp("Drops current database and runs all migrations");
}

0 comments on commit f0ce888

Please sign in to comment.