public function bindCommand(Command $command) { $this->command = $command; $this->options($command->getOptionCollection()); // $this->arguments( ); $this->config = $command->getApplication()->getGlobalConfig(); $this->setServiceContainer($command->getApplication()->getService()); $this->init(); }
public function init() { parent::init(); $this->command('setup'); $this->command('start'); $this->command('stop'); }
public function init() { parent::init(); $this->command('build'); $this->command('list'); $this->command('clean'); }
public function init() { parent::init(); $this->command('build', 'LazyRecord\\Command\\BuildSchemaCommand'); $this->command('sql', 'LazyRecord\\Command\\BuildSqlCommand'); $this->command('list', 'LazyRecord\\Command\\ListSchemaCommand'); $this->command('clean', 'LazyRecord\\Command\\CleanSchemaCommand'); }
public function options($opts) { parent::options($opts); $self = $this; $opts->add('D|data-source:', 'specify data source id')->validValues(function () use($self) { return $self->config->getDataSourceIds(); }); }
/** * test configure */ public function testGetContainer() { // set container $container = new Container(); $this->command->setContainer($container); // Reflection Class Command $reflectionClass = new \ReflectionClass($this->command); // change getContainer accessibility for test $reflectionProperty = $reflectionClass->getProperty('container'); $reflectionProperty->setAccessible(true); // change getContainer accessibility for test $reflectionMethod = $reflectionClass->getMethod('getContainer'); $reflectionMethod->setAccessible(true); // set container property $reflectionProperty->setValue($this->command, $container); // assert $this->assertEquals($container, $reflectionMethod->invoke($this->command)); }
public function prepare() { parent::prepare(); if (!getenv('PHPBREW_PHP')) { $this->logger->error("Error: PHPBREW_PHP environment variable is not defined."); $this->logger->error(" This extension command requires you specify a PHP version from your build list."); $this->logger->error(" And it looks like you haven't switched to a version from the builds that were built with PHPBrew."); $this->logger->error("Suggestion: Please install at least one PHP with your prefered version and switch to it."); return false; } return true; }
/** * register your command here */ public function init() { parent::init(); $this->command('sub-example'); }
public function init() { parent::init(); $this->command('parse', 'Phifty\\Command\\LocaleParseCommand'); $this->command('update', 'Phifty\\Command\\LocaleUpdateCommand'); }
public function init() { parent::init(); $this->command('get'); $this->command('list'); }
public function options($opts) { $opts->add('f|force', 'force generate all schema files.'); parent::options($opts); }