芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/cms.mgaplay.com.br/vendor/robmorgan/phinx/src/Phinx/Console/Command/Test.php
*/ class Test extends AbstractCommand { /** * {@inheritdoc} */ protected function configure() { parent::configure(); $this->addOption('--environment', '-e', InputOption::VALUE_REQUIRED, 'The target environment'); $this->setName('test') ->setDescription('Verify the configuration file') ->setHelp( <<
test command verifies the YAML configuration file and optionally an environment
phinx test
phinx test -e development
EOT ); } /** * Verify configuration file * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @throws \RuntimeException * @throws \InvalidArgumentException * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { $this->loadConfig($input, $output); $this->loadManager($input, $output); // Verify the migrations path(s) array_map( [$this, 'verifyMigrationDirectory'], Util::globAll($this->getConfig()->getMigrationPaths()) ); // Verify the seed path(s) array_map( [$this, 'verifySeedDirectory'], Util::globAll($this->getConfig()->getSeedPaths()) ); $envName = $input->getOption('environment'); if ($envName) { if (!$this->getConfig()->hasEnvironment($envName)) { throw new \InvalidArgumentException(sprintf( 'The environment "%s" does not exist', $envName )); } $output->writeln(sprintf('
validating environment
%s', $envName)); $environment = new Environment( $envName, $this->getConfig()->getEnvironment($envName) ); // validate environment connection $environment->getAdapter()->connect(); } $output->writeln('
success!
'); } }