PHP Класс Neos\Flow\Core\Migrations\Manager

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$currentPackageData array ..)
$eventCallbacks array Callbacks to be invoked when an event is triggered
$ignoredPackageCategories array
$migrations AbstractMigration[]
$packagesData array
$packagesPath string

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Описание методов

commitMigration() защищенный Метод

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
Результат string

getCurrentPackageKey() публичный Метод

public getCurrentPackageKey ( ) : string
Результат string

getMigrations() защищенный Метод

protected getMigrations ( string $versionNumber = null ) : AbstractMigration[]
$versionNumber string if specified only the migration with the specified version is returned
Результат AbstractMigration[]

getPackagesData() защищенный Метод

protected getPackagesData ( string $packageKey = null ) : array
$packageKey string if specified, only the package data for the given key is returned
Результат array in the format [' ['packageKey' => '', 'category' => , 'path' => '', 'meta' => '', 'composerManifest' => ''], [...]]

getStatus() публичный Метод

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
Результат array in the format [ => ['migration' => , 'state' => ], [...]]

hasMigrationApplied() защищенный Метод

Whether or not the given $migration has been applied to the current package
protected hasMigrationApplied ( AbstractMigration $migration ) : boolean
$migration AbstractMigration
Результат boolean

importMigrationLogFromGitHistory() защищенный Метод

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
Результат string

initialize() защищенный Метод

Initialize the manager: read package information and register migrations.
protected initialize ( ) : void
Результат void

markMigrationApplied() защищенный Метод

Whether or not the given migration has been applied in the given path
protected markMigrationApplied ( AbstractMigration $migration ) : boolean
$migration AbstractMigration
Результат boolean

migrate() публичный Метод

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
Результат void

migratePackage() защищенный Метод

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
Результат void

on() публичный Метод

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() защищенный Метод

Look for code migration files in the given package path and register them for further action.
protected registerMigrationFiles ( string $packagePath ) : void
$packagePath string
Результат void

setPackagesPath() публичный Метод

The level directly inside is expected to consist of package "categories" (Framework, Application, Plugins, ...).
public setPackagesPath ( string $packagesPath ) : void
$packagesPath string
Результат void

shouldPackageBeSkippedByDefault() защищенный Метод

By default we skip "TYPO3.*" and "Neos.*" packages and all packages of the ignored categories (@see ignoredPackageCategories)
protected shouldPackageBeSkippedByDefault ( ) : boolean
Результат boolean

triggerEvent() защищенный Метод

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 writeComposerManifest ( ) : void
Результат void

Описание свойств

$currentPackageData защищенное свойство

..)
protected array $currentPackageData
Результат array

$eventCallbacks защищенное свойство

Callbacks to be invoked when an event is triggered
См. также: triggerEvent()
protected array $eventCallbacks
Результат array

$ignoredPackageCategories защищенное свойство

protected array $ignoredPackageCategories
Результат array

$migrations защищенное свойство

protected AbstractMigration[],Neos\Flow\Core\Migrations $migrations
Результат AbstractMigration[]

$packagesData защищенное свойство

protected array $packagesData
Результат array

$packagesPath защищенное свойство

protected string $packagesPath
Результат string