|
static | mark ($text, $sign='=') |
|
◆ __construct()
Constructor.
- Parameters
-
string | a file path to the directory containing the migration files |
SchemaVersion | the current schema version persistor |
boolean | verbose or not |
- Returns
- void
◆ announce()
Overridable method used to return a textual representation of a stronger ouput of what's going on in me. You can use me as you would use printf.
- Parameters
-
string | $format | just a dummy value, instead use this method as you would use printf & co. |
◆ execute()
execute |
( |
|
$version, |
|
|
|
$direction, |
|
|
Migration |
$migration = null |
|
) |
| |
Executes a migration's up or down method
- Parameters
-
string | $version | Version to execute |
string | $direction | Up or down |
Migration | $migration | Migration to execute (optional, will be loaded if missing) |
◆ log()
Overridable method used to return a textual representation of what's going on in me. You can use me as you would use printf.
- Parameters
-
string | $format | just a dummy value, instead use this method as you would use printf & co. |
◆ mark()
static mark |
( |
|
$text, |
|
|
|
$sign = '=' |
|
) |
| |
|
static |
Pads and highlights a given text to a specific length with the given sign.
- Parameters
-
◆ migrateTo()
migrateTo |
( |
|
$target_version | ) |
|
Invoking this method will perform the migrations with an index between the current schema version (provided by the SchemaVersion object) and a target version calling the methods #up and #down in sequence.
- Parameters
-
mixed | the target version as an integer or NULL thus migrating to the top migration |
◆ migrationClass()
migrationClass |
( |
|
$migration | ) |
|
|
protected |
Maps a file name to a class name.
- Parameters
-
string | part of the file name |
- Returns
- string the derived class name
◆ migrationClasses()
Returns the collection (an array) of all migrations in this migrator's path.
- Returns
- array an associative array, whose keys are the migration's version and whose values are arrays containing the migration's file and class name.
◆ migrationFiles()
Return all migration file names from my migrations_path.
- Returns
- array a collection of file names
◆ migrationVersionAndName()
migrationVersionAndName |
( |
|
$migration_file | ) |
|
|
protected |
Split a migration file name into that migration's version and name.
- Parameters
-
- Returns
- array an array of two elements containing the migration's version and name.
◆ relevantMigrations()
relevantMigrations |
( |
|
$target_version | ) |
|
Invoking this method will return a list of migrations with an index between the current schema version (provided by the SchemaVersion object) and a target version calling the methods #up and #down in sequence.
- Parameters
-
mixed | the target version as an integer or NULL thus migrating to the top migration |
- Returns
- array an associative array, whose keys are the migration's version and whose values are the migration objects
◆ topVersion()
Returns the top migration's version.
- Returns
- int the top migration's version.
◆ FILE_REGEXP
const FILE_REGEXP = '/\b(\d+)([_-][_a-z0-9]+)+\.php$/' |
The documentation for this class was generated from the following file: