コード例 #1
0
 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();
 }
コード例 #2
0
ファイル: FpmCommand.php プロジェクト: phpbrew/phpbrew
 public function init()
 {
     parent::init();
     $this->command('setup');
     $this->command('start');
     $this->command('stop');
 }
コード例 #3
0
ファイル: SchemaCommand.php プロジェクト: appleboy/LazyRecord
 public function init()
 {
     parent::init();
     $this->command('build');
     $this->command('list');
     $this->command('clean');
 }
コード例 #4
0
ファイル: SchemaCommand.php プロジェクト: azole/LazyRecord
 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');
 }
コード例 #5
0
ファイル: BaseCommand.php プロジェクト: appleboy/LazyRecord
 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();
     });
 }
コード例 #6
0
 /**
  * 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));
 }
コード例 #7
0
ファイル: BaseCommand.php プロジェクト: WebDevJL/phpbrew
 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;
 }
コード例 #8
0
 /**
  * register your command here
  */
 public function init()
 {
     parent::init();
     $this->command('sub-example');
 }
コード例 #9
0
ファイル: LocaleCommand.php プロジェクト: corneltek/phifty
 public function init()
 {
     parent::init();
     $this->command('parse', 'Phifty\\Command\\LocaleParseCommand');
     $this->command('update', 'Phifty\\Command\\LocaleUpdateCommand');
 }
コード例 #10
0
ファイル: AppCommand.php プロジェクト: nanasess/phpbrew
 public function init()
 {
     parent::init();
     $this->command('get');
     $this->command('list');
 }
コード例 #11
0
 public function options($opts)
 {
     $opts->add('f|force', 'force generate all schema files.');
     parent::options($opts);
 }