migrate() публичный Метод

This iterates over available migrations and applies them to the existing packages if - the package needs the migration - is a clean git working copy
public migrate ( string $packageKey = null, string $versionNumber = null, boolean $force = false ) : void
$packageKey string key of the package to migrate, or NULL to migrate all packages
$versionNumber string version of the migration to execute (e.g. "20120126163610"), or NULL to execute all migrations
$force boolean if TRUE migrations will be applied even if the corresponding package is not a git working copy or contains local changes
Результат void
Пример #1
0
function outputMigrationHeadline(AbstractMigration $migration)
{
    global $lastMigration;
    if ($migration !== $lastMigration) {
        outputHeadline('Migration %s (%s)', 1, array($migration->getIdentifier(), formatVersion($migration->getVersionNumber())));
        $description = $migration->getDescription();
        if ($description !== null) {
            outputLine($description);
            outputLine();
        }
        $lastMigration = $migration;
    }
}
outputLine('Migrating...');
try {
    $migrationsManager->migrate($packageKey, $versionNumber, flagIsSet('force'));
} catch (\Exception $exception) {
    outputLine('EXCEPTION: %s', array($exception->getMessage()), 0, STYLE_ERROR);
    exit(255);
}
outputLine('Done.');
/**
 * Check if the given flag is in $GLOBALS['argv'].
 *
 * @param string $flag
 * @return boolean
 */
function flagIsSet($flag)
{
    return in_array('--' . $flag, $GLOBALS['argv']);
}