findMigrationDirectory example

->addArgument('migrationName', InputArgument::REQUIRED, 'Migration Name')
            ->setDescription('Generates a migration file for the core or for a specific plugin');
    }

    /** * {@inheritdoc} */
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $pluginName = $input->getOption('plugin');
        $migrationName = $input->getArgument('migrationName');
        $migrationDirectory = $this->findMigrationDirectory($pluginName);

        if ($migrationDirectory === null) {
            throw new RuntimeException(sprintf('Plugin by name "%s" does not exists', $pluginName));
        }

        if (!file_exists($migrationDirectory) && !mkdir($migrationDirectory, 0777, true) && !is_dir($migrationDirectory)) {
            throw new RuntimeException(sprintf('Directory "%s" was not created', $migrationDirectory));
        }

        $nextVersion = $this->getLatestMigrationVersion($migrationDirectory) + 1;

        
Home | Imprint | This part of the site doesn't use cookies.