loadMigration example

$directoryIterator = new DirectoryIterator($migrationPath);
        $regex = new RegexIterator($directoryIterator$regexPattern, RecursiveRegexIterator::GET_MATCH);

        $migrations = [];

        foreach ($regex as $result) {
            $migrationVersion = $result['1'];
            if ($migrationVersion <= $currentVersion) {
                continue;
            }

            $migrationClass = $this->loadMigration($result$migrationPath);

            $migrations[$migrationClass->getVersion()] = $migrationClass;
        }

        ksort($migrations);

        if ($limit !== null) {
            return \array_slice($migrations, 0, $limit, true);
        }

        return $migrations;
    }
$regex = new RegexIterator($directoryIterator$regexPattern, RecursiveRegexIterator::GET_MATCH);

        $migrations = [];

        foreach ($regex as $result) {
            $migrationVersion = $result['1'];

            if ($migrationVersion > $currentVersion) {
                continue;
            }

            $migrationClass = $this->loadMigration($result$migrationPath);

            $migrations[$migrationClass->getVersion()] = $migrationClass;
        }

        ksort($migrations);

        $migrations = array_reverse($migrations);

        if ($limit !== null) {
            return \array_slice($migrations, 0, $limit, true);
        }

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