PHP Class Horde_Db_Migration_Migrator, horde

Author: Mike Naberezny ([email protected])
Author: Derek DeVries ([email protected])
Author: Chuck Hagenbuch ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_direction string
$_migrationsPath string
$_schemaTableName string
$_targetVersion integer

Public Methods

Method Description
__construct ( Horde_Db_Adapter $connection, Horde_Log_Logger $logger = null, array $options = [] ) Constructor.
down ( string $targetVersion = null )
getCurrentVersion ( ) : integer
getTargetVersion ( ) : integer
migrate ( string $targetVersion = null )
setInflector ( Horde_Support_Inflector $inflector )
setLogger ( Horde_Log_Logger $logger )
setMigrationsPath ( string $migrationsPath )
up ( string $targetVersion = null )

Protected Methods

Method Description
_assertUniqueMigrationVersion ( array $migrations, integer $version )
_doMigrate ( ) Performs the migration.
_getMigrationClass ( string $migrationName, integer $version ) : Horde_Db_Migration_Base Actually returns object, and not class.
_getMigrationClasses ( ) : array
_getMigrationFiles ( ) : array Returns the list of migration files.
_getMigrationVersionAndName ( string $migrationFile ) : array
_hasReachedTargetVersion ( $version ) : boolean
_initializeSchemaInformation ( )
_isDown ( ) : boolean
_isIrrelevantMigration ( integer $version ) : boolean
_isUp ( ) : boolean
_setSchemaVersion ( integer $version )

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Db_Adapter $connection, Horde_Log_Logger $logger = null, array $options = [] )
$connection Horde_Db_Adapter A DB connection object.
$logger Horde_Log_Logger A logger object.
$options array Additional options for the migrator: - migrationsPath: directory with the migration files. - schemaTableName: table for storing the schema version.

_assertUniqueMigrationVersion() protected method

protected _assertUniqueMigrationVersion ( array $migrations, integer $version )
$migrations array
$version integer

_doMigrate() protected method

Performs the migration.
protected _doMigrate ( )

_getMigrationClass() protected method

Actually returns object, and not class.
protected _getMigrationClass ( string $migrationName, integer $version ) : Horde_Db_Migration_Base
$migrationName string
$version integer
return Horde_Db_Migration_Base

_getMigrationClasses() protected method

protected _getMigrationClasses ( ) : array
return array

_getMigrationFiles() protected method

Returns the list of migration files.
protected _getMigrationFiles ( ) : array
return array

_getMigrationVersionAndName() protected method

protected _getMigrationVersionAndName ( string $migrationFile ) : array
$migrationFile string
return array ($version, $name)

_hasReachedTargetVersion() protected method

protected _hasReachedTargetVersion ( $version ) : boolean
return boolean

_initializeSchemaInformation() protected method

_isDown() protected method

protected _isDown ( ) : boolean
return boolean

_isIrrelevantMigration() protected method

protected _isIrrelevantMigration ( integer $version ) : boolean
$version integer
return boolean

_isUp() protected method

protected _isUp ( ) : boolean
return boolean

_setSchemaVersion() protected method

protected _setSchemaVersion ( integer $version )
$version integer

down() public method

public down ( string $targetVersion = null )
$targetVersion string

getCurrentVersion() public method

public getCurrentVersion ( ) : integer
return integer

getTargetVersion() public method

public getTargetVersion ( ) : integer
return integer

migrate() public method

public migrate ( string $targetVersion = null )
$targetVersion string

setInflector() public method

public setInflector ( Horde_Support_Inflector $inflector )
$inflector Horde_Support_Inflector

setLogger() public method

public setLogger ( Horde_Log_Logger $logger )
$logger Horde_Log_Logger

setMigrationsPath() public method

public setMigrationsPath ( string $migrationsPath )
$migrationsPath string Path to migration files.

up() public method

public up ( string $targetVersion = null )
$targetVersion string

Property Details

$_direction protected property

protected string $_direction
return string

$_migrationsPath protected property

protected string $_migrationsPath
return string

$_schemaTableName protected property

protected string $_schemaTableName
return string

$_targetVersion protected property

protected int $_targetVersion
return integer