/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/Dump.php (4044B)
setName('dump') ->setDescription('Dumps the current schema of the database to be used while baking a diff') ->setHelp(sprintf( '%sDumps the current schema of the database to be used while baking a diff%s', PHP_EOL, PHP_EOL )) ->addOption('plugin', 'p', InputOption::VALUE_REQUIRED, 'The plugin the file should be created for') ->addOption('connection', 'c', InputOption::VALUE_REQUIRED, 'The datasource connection to use') ->addOption('source', 's', InputOption::VALUE_REQUIRED, 'The folder where migrations are in'); } /** * @param \Symfony\Component\Console\Output\OutputInterface $output The output object. * @return mixed */ public function output(?OutputInterface $output = null) { if ($output !== null) { $this->output = $output; } return $this->output; } /** * Dumps the current schema to be used when baking a diff * * @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->setInput($input); $this->bootstrap($input, $output); $this->output($output); $path = $this->getOperationsPath($input); /** @var string $connectionName */ $connectionName = $input->getOption('connection') ?: 'default'; $connection = ConnectionManager::get($connectionName); $collection = $connection->getSchemaCollection(); $options = [ 'require-table' => false, 'plugin' => $this->getPlugin($input), ]; $tables = $this->getTablesToBake($collection, $options); $dump = []; if ($tables) { foreach ($tables as $table) { $schema = $collection->describe($table); $dump[$table] = $schema; } } $filePath = $path . DS . 'schema-dump-' . $connectionName . '.lock'; $output->writeln(sprintf('Writing dump file `%s`...', $filePath)); if (file_put_contents($filePath, serialize($dump))) { $output->writeln(sprintf('Dump file `%s` was successfully written', $filePath)); return BaseCommand::CODE_SUCCESS; } $output->writeln(sprintf( 'An error occurred while writing dump file `%s`', $filePath )); return BaseCommand::CODE_ERROR; } }