/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/migrations/src/Command/Phinx
NameSizeModeActions
BaseCommand.php2320644editdlrm
CacheBuild.php18940644editdlrm
CacheClear.php19620644editdlrm
CommandTrait.php37330644editdlrm
Create.php41740644editdlrm
Dump.php40440644editdlrm
MarkMigrated.php75720644editdlrm
Migrate.php33370644editdlrm
Rollback.php33960644editdlrm
Seed.php29430644editdlrm
Status.php48370644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/migrations/src/Command/Phinx/Status.php (4837B)
setName('status') ->setDescription('Show migration status') ->addOption( '--format', '-f', InputOption::VALUE_REQUIRED, 'The output format: text or json. Defaults to text.' ) ->setHelp('prints a list of all migrations, along with their current status') ->addOption('--plugin', '-p', InputOption::VALUE_REQUIRED, 'The plugin containing the migrations') ->addOption('--connection', '-c', InputOption::VALUE_REQUIRED, 'The datasource connection to use') ->addOption('--source', '-s', InputOption::VALUE_REQUIRED, 'The folder where migrations are in'); } /** * Show the migration status. * * @param \Symfony\Component\Console\Input\InputInterface $input the input object * @param \Symfony\Component\Console\Output\OutputInterface $output the output object * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { $this->beforeExecute($input, $output); $this->bootstrap($input, $output); /** @var string|null $environment */ $environment = $input->getOption('environment'); /** @var string|null $format */ $format = $input->getOption('format'); if ($environment === null) { $environment = $this->getManager()->getConfig()->getDefaultEnvironment(); $output->writeln('warning no environment specified, defaulting to: ' . $environment); } else { $output->writeln('using environment ' . $environment); } if ($format !== null) { $output->writeln('using format ' . $format); } // print the status /** @var array $migrations */ $migrations = $this->getManager()->printStatus($environment, $format); switch ($format) { case 'json': $this->getManager()->getOutput()->writeln($migrations); break; default: $this->display($migrations); break; } return BaseCommand::CODE_SUCCESS; } /** * Will output the status of the migrations * * @param array $migrations Migrations array. * @return void */ protected function display(array $migrations) { $output = $this->getManager()->getOutput(); if (!empty($migrations)) { $output->writeln(''); $output->writeln(' Status Migration ID Migration Name '); $output->writeln('-----------------------------------------'); foreach ($migrations as $migration) { $status = $migration['status'] === 'up' ? ' up ' : ' down '; $maxNameLength = $this->getManager()->maxNameLength; $name = $migration['name'] !== false ? ' ' . str_pad($migration['name'], $maxNameLength, ' ') . ' ' : ' ** MISSING **'; $missingComment = ''; if (!empty($migration['missing'])) { $missingComment = ' ** MISSING **'; } $output->writeln( $status . sprintf(' %14.0f ', $migration['id']) . $name . $missingComment ); } $output->writeln(''); } else { $msg = 'There are no available migrations. Try creating one using the create command.'; $output->writeln(''); $output->writeln($msg); $output->writeln(''); } } }