Properties

$_direction

$_direction : string

Type

string

$_migrationsPath

$_migrationsPath : string

Type

string

$_targetVersion

$_targetVersion : integer

Type

integer

$_schemaTableName

$_schemaTableName : string

Type

string

Methods

__construct()

__construct(\Horde_Db_Adapter  $connection, \Horde_Log_Logger  $logger = null, array  $options = array()) 

Constructor.

Parameters

\Horde_Db_Adapter $connection

A DB connection object.

\Horde_Log_Logger $logger

A logger object.

array $options

Additional options for the migrator:

  • migrationsPath: directory with the migration files.
  • schemaTableName: table for storing the schema version.

Throws

\Horde_Db_Migration_Exception

migrate()

migrate(string  $targetVersion = null) 

Parameters

string $targetVersion

up()

up(string  $targetVersion = null) 

Parameters

string $targetVersion

down()

down(string  $targetVersion = null) 

Parameters

string $targetVersion

getCurrentVersion()

getCurrentVersion() : integer

Returns

integer

getTargetVersion()

getTargetVersion() : integer

Returns

integer

setMigrationsPath()

setMigrationsPath(string  $migrationsPath) 

Parameters

string $migrationsPath

Path to migration files.

setLogger()

setLogger(\Horde_Log_Logger  $logger) 

Parameters

\Horde_Log_Logger $logger

setInflector()

setInflector(\Horde_Support_Inflector  $inflector) 

Parameters

\Horde_Support_Inflector $inflector

_doMigrate()

_doMigrate() 

Performs the migration.

_getMigrationClasses()

_getMigrationClasses() : array

Returns

array

_assertUniqueMigrationVersion()

_assertUniqueMigrationVersion(array  $migrations, integer  $version) 

Parameters

array $migrations
integer $version

Throws

\Horde_Db_Migration_Exception

_getMigrationFiles()

_getMigrationFiles() : array

Returns the list of migration files.

Returns

array

_getMigrationClass()

_getMigrationClass(string  $migrationName, integer  $version) : \Horde_Db_Migration_Base

Actually returns object, and not class.

Parameters

string $migrationName
integer $version

Returns

\Horde_Db_Migration_Base

_getMigrationVersionAndName()

_getMigrationVersionAndName(string  $migrationFile) : array

Parameters

string $migrationFile

Returns

array —

($version, $name)

_initializeSchemaInformation()

_initializeSchemaInformation() 

_setSchemaVersion()

_setSchemaVersion(integer  $version) 

Parameters

integer $version

_isUp()

_isUp() : boolean

Returns

boolean

_isDown()

_isDown() : boolean

Returns

boolean

_hasReachedTargetVersion()

_hasReachedTargetVersion(  $version) : boolean

Parameters

$version

Returns

boolean

_isIrrelevantMigration()

_isIrrelevantMigration(integer  $version) : boolean

Parameters

integer $version

Returns

boolean