class ArrayConfiguration extends AbstractFileConfiguration (View source)

The ArrayConfiguration class is responsible for loading migration configuration information from a PHP file.

Constants

VERSIONS_ORGANIZATION_BY_YEAR

VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH

VERSION_FORMAT

ALLOWED_CONFIGURATION_KEYS

CONFIGURATION_METHOD_MAP

Methods

__construct(Connection $connection, OutputWriter|null $outputWriter = null, MigrationFinder|null $migrationFinder = null, QueryWriter|null $queryWriter = null, DependencyFactory|null $dependencyFactory = null)

No description

setName(string $name)

No description

getName()

No description

getConnection()

No description

setMigrationsTableName(string $tableName)

No description

getMigrationsTableName()

No description

setMigrationsColumnName(string $columnName)

No description

getMigrationsColumnName()

No description

setMigrationsColumnLength(int $columnLength)

No description

getMigrationsColumnLength()

No description

setMigrationsExecutedAtColumnName(string $migrationsExecutedAtColumnName)

No description

setMigrationsDirectory(string $migrationsDirectory)

No description

getMigrationsDirectory()

No description

setMigrationsNamespace(string $migrationsNamespace)

No description

getMigrationsNamespace()

No description

setCustomTemplate(string|null $customTemplate)

No description

getCustomTemplate()

No description

setMigrationsAreOrganizedByYear(bool $migrationsAreOrganizedByYear = true)

No description

setMigrationsAreOrganizedByYearAndMonth(bool $migrationsAreOrganizedByYearAndMonth = true)

No description

setMigrationsFinder(MigrationFinder $migrationFinder)

No description

getMigrationsFinder()

No description

validate()

No description

hasVersionMigrated(Version $version)

No description

mixed[]
getVersionData(Version $version)

No description

resolveVersionAlias(string $alias)

No description

setIsDryRun(bool $isDryRun)

No description

isDryRun()

No description

setAllOrNothing(bool $allOrNothing)

No description

isAllOrNothing()

No description

isMigrationTableCreated()

No description

createMigrationTable()

No description

getDateTime(string $version)

No description

generateVersionNumber(DateTimeInterface|null $now = null)

No description

connect()

Explicitely opens the database connection. This is done to play nice with DBAL's MasterSlaveConnection. Which, in some cases, connects to a follower when fetching the executed migrations. If a follower is lagging significantly behind that means the migrations system may see unexecuted migrations that were actually executed earlier.

dispatchMigrationEvent(string $eventName, string $direction, bool $dryRun)

No description

dispatchVersionEvent(Version $version, string $eventName, string $direction, bool $dryRun)

No description

dispatchEvent(string $eventName, EventArgs|null $args = null)

No description

getLatestVersion()

No description

string[]
getMigratedVersions()

No description

string[]
getAvailableVersions()

No description

getCurrentVersion()

No description

registerMigrationsFromDirectory(string $path)

No description

registerMigration(string $version, string $class)

No description

registerMigrations(array $migrations)

No description

getMigrations()

No description

getVersion(string $version)

No description

hasVersion(string $version)

No description

getMigrationsToExecute(string $direction, string $to)

No description

getPrevVersion()

No description

getNextVersion()

No description

getRelativeVersion(string $version, int $delta)

No description

getDeltaVersion(string $delta)

No description

setOutputWriter(OutputWriter $outputWriter)

No description

getOutputWriter()

No description

getQueryWriter()

No description

getDependencyFactory()

No description

load(string $file)

No description

getFile()

No description

setConfiguration(array $config)

No description

getDirectoryRelativeToFile(string $file, string $input)

No description

doLoad(string $file)

No description

Details

__construct(Connection $connection, OutputWriter|null $outputWriter = null, MigrationFinder|null $migrationFinder = null, QueryWriter|null $queryWriter = null, DependencyFactory|null $dependencyFactory = null)

Parameters

Connection $connection
OutputWriter|null $outputWriter
MigrationFinder|null $migrationFinder
QueryWriter|null $queryWriter
DependencyFactory|null $dependencyFactory

setName(string $name)

Parameters

string $name

getName()

getConnection()

setMigrationsTableName(string $tableName)

Parameters

string $tableName

getMigrationsTableName()

setMigrationsColumnName(string $columnName)

Parameters

string $columnName

getMigrationsColumnName()

getQuotedMigrationsColumnName()

setMigrationsColumnLength(int $columnLength)

Parameters

int $columnLength

getMigrationsColumnLength()

setMigrationsExecutedAtColumnName(string $migrationsExecutedAtColumnName)

Parameters

string $migrationsExecutedAtColumnName

getMigrationsExecutedAtColumnName()

getQuotedMigrationsExecutedAtColumnName()

setMigrationsDirectory(string $migrationsDirectory)

Parameters

string $migrationsDirectory

getMigrationsDirectory()

setMigrationsNamespace(string $migrationsNamespace)

Parameters

string $migrationsNamespace

getMigrationsNamespace()

setCustomTemplate(string|null $customTemplate)

Parameters

string|null $customTemplate

getCustomTemplate()

areMigrationsOrganizedByYear()

setMigrationsAreOrganizedByYear(bool $migrationsAreOrganizedByYear = true)

Parameters

bool $migrationsAreOrganizedByYear

Exceptions

MigrationException

setMigrationsAreOrganizedByYearAndMonth(bool $migrationsAreOrganizedByYearAndMonth = true)

Parameters

bool $migrationsAreOrganizedByYearAndMonth

Exceptions

MigrationException

areMigrationsOrganizedByYearAndMonth()

setMigrationsFinder(MigrationFinder $migrationFinder)

Parameters

MigrationFinder $migrationFinder

Exceptions

MigrationException

getMigrationsFinder()

validate()

Exceptions

MigrationException

hasVersionMigrated(Version $version)

Parameters

Version $version

mixed[] getVersionData(Version $version)

Parameters

Version $version

Return Value

mixed[]

resolveVersionAlias(string $alias)

Parameters

string $alias

setIsDryRun(bool $isDryRun)

Parameters

bool $isDryRun

isDryRun()

setAllOrNothing(bool $allOrNothing)

Parameters

bool $allOrNothing

isAllOrNothing()

isMigrationTableCreated()

createMigrationTable()

getDateTime(string $version)

Parameters

string $version

generateVersionNumber(DateTimeInterface|null $now = null)

Parameters

DateTimeInterface|null $now

connect()

Explicitely opens the database connection. This is done to play nice with DBAL's MasterSlaveConnection. Which, in some cases, connects to a follower when fetching the executed migrations. If a follower is lagging significantly behind that means the migrations system may see unexecuted migrations that were actually executed earlier.

dispatchMigrationEvent(string $eventName, string $direction, bool $dryRun)

Parameters

string $eventName
string $direction
bool $dryRun

dispatchVersionEvent(Version $version, string $eventName, string $direction, bool $dryRun)

Parameters

Version $version
string $eventName
string $direction
bool $dryRun

dispatchEvent(string $eventName, EventArgs|null $args = null)

Parameters

string $eventName
EventArgs|null $args

getNumberOfExecutedMigrations()

getNumberOfAvailableMigrations()

getLatestVersion()

string[] getMigratedVersions()

Return Value

string[]

string[] getAvailableVersions()

Return Value

string[]

getCurrentVersion()

Version[] registerMigrationsFromDirectory(string $path)

Parameters

string $path

Return Value

Version[]

registerMigration(string $version, string $class)

Parameters

string $version
string $class

Exceptions

MigrationException

Version[] registerMigrations(array $migrations)

Parameters

array $migrations

Return Value

Version[]

Version[] getMigrations()

Return Value

Version[]

getVersion(string $version)

Parameters

string $version

hasVersion(string $version)

Parameters

string $version

Version[] getMigrationsToExecute(string $direction, string $to)

Parameters

string $direction
string $to

Return Value

Version[]

getPrevVersion()

getNextVersion()

getRelativeVersion(string $version, int $delta)

Parameters

string $version
int $delta

getDeltaVersion(string $delta)

Parameters

string $delta

setOutputWriter(OutputWriter $outputWriter)

Parameters

OutputWriter $outputWriter

getOutputWriter()

getQueryWriter()

getDependencyFactory()

load(string $file)

Parameters

string $file

Exceptions

FileNotFound

protected setConfiguration(array $config)

Parameters

array $config

protected getDirectoryRelativeToFile(string $file, string $input)

Parameters

string $file
string $input

protected doLoad(string $file)

Parameters

string $file