PHP Class Neos\Flow\Core\Migrations\Manager

Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$currentPackageData array ..)
$eventCallbacks array Callbacks to be invoked when an event is triggered
$ignoredPackageCategories array
$migrations AbstractMigration[]
$packagesData array
$packagesPath string

Méthodes publiques

Méthode Description
getCurrentPackageKey ( ) : string
getStatus ( string $packageKey = null, string $versionNumber = null ) : array Returns the migration status for all packages.
migrate ( string $packageKey = null, string $versionNumber = null, boolean $force = false ) : void This iterates over available migrations and applies them to the existing packages if - the package needs the migration - is a clean git working copy
on ( string $eventIdentifier, Closure $callback ) Attaches a new event handler
setPackagesPath ( string $packagesPath ) : void Allows to set the packages path.

Méthodes protégées

Méthode Description
commitMigration ( AbstractMigration $migration, string $commitMessageNotice = null ) : string Commit changes done to the package described by $packageData. The migration that was did the changes is given with $versionNumber and $versionPackageKey and will be recorded in the commit message.
getMigrations ( string $versionNumber = null ) : AbstractMigration[]
getPackagesData ( string $packageKey = null ) : array
hasMigrationApplied ( AbstractMigration $migration ) : boolean Whether or not the given $migration has been applied to the current package
importMigrationLogFromGitHistory ( boolean $commitChanges = false ) : string Imports the core migration log from the git history if it has not been imported previously (the "applied-flow-migrations" composer manifest property does not exist)
initialize ( ) : void Initialize the manager: read package information and register migrations.
markMigrationApplied ( AbstractMigration $migration ) : boolean Whether or not the given migration has been applied in the given path
migratePackage ( AbstractMigration $migration, boolean $force = false ) : void Apply the given migration to the package and commit the result.
registerMigrationFiles ( string $packagePath ) : void Look for code migration files in the given package path and register them for further action.
shouldPackageBeSkippedByDefault ( ) : boolean By default we skip "TYPO3.*" and "Neos.*" packages and all packages of the ignored categories (@see ignoredPackageCategories)
triggerEvent ( string $eventIdentifier, array $eventData = null ) Trigger a custom event
writeComposerManifest ( ) : void

Method Details

commitMigration() protected méthode

Commit changes done to the package described by $packageData. The migration that was did the changes is given with $versionNumber and $versionPackageKey and will be recorded in the commit message.
protected commitMigration ( AbstractMigration $migration, string $commitMessageNotice = null ) : string
$migration AbstractMigration
$commitMessageNotice string
Résultat string

getCurrentPackageKey() public méthode

public getCurrentPackageKey ( ) : string
Résultat string

getMigrations() protected méthode

protected getMigrations ( string $versionNumber = null ) : AbstractMigration[]
$versionNumber string if specified only the migration with the specified version is returned
Résultat AbstractMigration[]

getPackagesData() protected méthode

protected getPackagesData ( string $packageKey = null ) : array
$packageKey string if specified, only the package data for the given key is returned
Résultat array in the format [' ['packageKey' => '', 'category' => , 'path' => '', 'meta' => '', 'composerManifest' => ''], [...]]

getStatus() public méthode

Returns the migration status for all packages.
public getStatus ( string $packageKey = null, string $versionNumber = null ) : array
$packageKey string key of the package to migrate, or NULL to migrate all packages
$versionNumber string version of the migration to fetch the status for (e.g. "20120126163610"), or NULL to consider all migrations
Résultat array in the format [ => ['migration' => , 'state' => ], [...]]

hasMigrationApplied() protected méthode

Whether or not the given $migration has been applied to the current package
protected hasMigrationApplied ( AbstractMigration $migration ) : boolean
$migration AbstractMigration
Résultat boolean

importMigrationLogFromGitHistory() protected méthode

Imports the core migration log from the git history if it has not been imported previously (the "applied-flow-migrations" composer manifest property does not exist)
protected importMigrationLogFromGitHistory ( boolean $commitChanges = false ) : string
$commitChanges boolean if TRUE the modified composer manifest is committed - if it changed
Résultat string

initialize() protected méthode

Initialize the manager: read package information and register migrations.
protected initialize ( ) : void
Résultat void

markMigrationApplied() protected méthode

Whether or not the given migration has been applied in the given path
protected markMigrationApplied ( AbstractMigration $migration ) : boolean
$migration AbstractMigration
Résultat boolean

migrate() public méthode

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
Résultat void

migratePackage() protected méthode

Apply the given migration to the package and commit the result.
protected migratePackage ( AbstractMigration $migration, boolean $force = false ) : void
$migration AbstractMigration
$force boolean if TRUE the migration will be applied even if the current package is not a git working copy or contains local changes
Résultat void

on() public méthode

Attaches a new event handler
public on ( string $eventIdentifier, Closure $callback )
$eventIdentifier string one of the EVENT_* constants
$callback Closure a closure to be invoked when the corresponding event was triggered

registerMigrationFiles() protected méthode

Look for code migration files in the given package path and register them for further action.
protected registerMigrationFiles ( string $packagePath ) : void
$packagePath string
Résultat void

setPackagesPath() public méthode

The level directly inside is expected to consist of package "categories" (Framework, Application, Plugins, ...).
public setPackagesPath ( string $packagesPath ) : void
$packagesPath string
Résultat void

shouldPackageBeSkippedByDefault() protected méthode

By default we skip "TYPO3.*" and "Neos.*" packages and all packages of the ignored categories (@see ignoredPackageCategories)
protected shouldPackageBeSkippedByDefault ( ) : boolean
Résultat boolean

triggerEvent() protected méthode

Trigger a custom event
protected triggerEvent ( string $eventIdentifier, array $eventData = null )
$eventIdentifier string one of the EVENT_* constants
$eventData array optional arguments to be passed to the handler closure

writeComposerManifest() protected méthode

protected writeComposerManifest ( ) : void
Résultat void

Property Details

$currentPackageData protected_oe property

..)
protected array $currentPackageData
Résultat array

$eventCallbacks protected_oe property

Callbacks to be invoked when an event is triggered
See also: triggerEvent()
protected array $eventCallbacks
Résultat array

$ignoredPackageCategories protected_oe property

protected array $ignoredPackageCategories
Résultat array

$migrations protected_oe property

protected AbstractMigration[],Neos\Flow\Core\Migrations $migrations
Résultat AbstractMigration[]

$packagesData protected_oe property

protected array $packagesData
Résultat array

$packagesPath protected_oe property

protected string $packagesPath
Résultat string