/var/www/vhosts/ihelp.ro/_OLD/vendor/robmorgan/phinx/src/Phinx/Console/Command
NameSizeModeActions
AbstractCommand.php110940644editdlrm
Breakpoint.php39140644editdlrm
Create.php122870644editdlrm
Init.php51980644editdlrm
ListAliases.php24140644editdlrm
Migrate.php49790644editdlrm
Rollback.php61580644editdlrm
SeedCreate.php62960644editdlrm
SeedRun.php39160644editdlrm
Status.php28710644editdlrm
Test.php28490644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/robmorgan/phinx/src/Phinx/Console/Command/Test.php (2849B)
*/ class Test extends AbstractCommand { /** * @var string */ protected static $defaultName = 'test'; /** * {@inheritDoc} * * @return void */ protected function configure() { parent::configure(); $this->addOption('--environment', '-e', InputOption::VALUE_REQUIRED, 'The target environment'); $this->setDescription('Verify the configuration file') ->setHelp( <<test command is used to verify the phinx configuration file and optionally an environment phinx test phinx test -e development If the environment option is set, it will test that phinx can connect to the DB associated with that environment EOT ); } /** * Verify configuration file * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output * * @throws \InvalidArgumentException * * @return int 0 on success */ 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!'); return self::CODE_SUCCESS; } }