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

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

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

Свойство Тип Описание
$migrationsManager Manager
$notes array
$operations array
$sourcePackageKey string
$targetPackageData array
$warnings array

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

Метод Описание
__construct ( Manager $manager, string $packageKey )
execute ( ) : void
getDescription ( ) : string Returns the first line of the migration class doc comment
getIdentifier ( ) : string Returns the identifier of this migration, e.g. 'Neos.Flow-20120126163610'.
getNotes ( ) : array
getSourcePackageKey ( ) : string Returns the package key this migration comes from.
getVersionNumber ( ) : string Returns the version of this migration, e.g. '20120126163610'.
getWarnings ( ) : array
hasNotes ( ) : boolean
hasWarnings ( ) : boolean
prepare ( array $targetPackageData ) : void Resets internal state and sets the target package data.
up ( ) : void Anything that needs to be done in the migration when migrating into the "up" direction needs to go into this method.

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

Метод Описание
applyFileOperations ( ) : void Applies all registered moveFile operations.
applySearchAndReplaceOperations ( ) : void Applies all registered searchAndReplace operations.
deleteFile ( string $pathAndFileName ) : void Delete a file.
moveFile ( string $oldPath, string $newPath ) : void Move a file (or directory) from $oldPath to $newPath.
moveSettingsPaths ( string $sourcePath, string $destinationPath ) Move a settings path from "source" to "destination"; best to be used when package names change.
processConfiguration ( string $configurationType, Closure $processor, boolean $saveResult = false ) : void Apply the given processor to the raw results of loading the given configuration type for the package from YAML. If multiple files exist (context configuration) all are processed independently.
renameClass ( string $oldName, string $newName ) : void Rename a class from $oldName to $newName.
renameMethod ( string $className, string $oldMethodName, string $newMethodName, boolean $withInheritance = true ) : void Rename a class method.
searchAndReplace ( string $search, string $replacement, array | string $filter = ['php', 'yaml', 'html'] ) : void Does a simple search and replace on all (textual) files. The filter array can be used to give file extensions to limit the operation to.
searchAndReplaceRegex ( string $search, string | Closure $replacement, array | string $filter = ['php', 'yaml', 'html'] ) : void Does a regex search and replace on all (textual) files. The filter array can be used to give file extensions to limit the operation to.
showNote ( string $note ) : void This can be used to show a note to the developer.
showWarning ( string $warning ) : void This can be used to show a warning to the developer.

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

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

public __construct ( Manager $manager, string $packageKey )
$manager Manager
$packageKey string

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

Applies all registered moveFile operations.
protected applyFileOperations ( ) : void
Результат void

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

Applies all registered searchAndReplace operations.
protected applySearchAndReplaceOperations ( ) : void
Результат void

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

Delete a file.
protected deleteFile ( string $pathAndFileName ) : void
$pathAndFileName string
Результат void

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

public execute ( ) : void
Результат void

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

Returns the first line of the migration class doc comment
public getDescription ( ) : string
Результат string

getIdentifier() абстрактный публичный Метод

Returns the identifier of this migration, e.g. 'Neos.Flow-20120126163610'.
abstract public getIdentifier ( ) : string
Результат string

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

public getNotes ( ) : array
Результат array

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

Returns the package key this migration comes from.
public getSourcePackageKey ( ) : string
Результат string

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

Returns the version of this migration, e.g. '20120126163610'.
public getVersionNumber ( ) : string
Результат string

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

public getWarnings ( ) : array
Результат array

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

public hasNotes ( ) : boolean
Результат boolean

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

public hasWarnings ( ) : boolean
Результат boolean

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

If $oldPath ends with a * everything starting with $oldPath will be moved into $newPath (which then is created as a directory, if it does not yet exist).
protected moveFile ( string $oldPath, string $newPath ) : void
$oldPath string
$newPath string
Результат void

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

Move a settings path from "source" to "destination"; best to be used when package names change.
protected moveSettingsPaths ( string $sourcePath, string $destinationPath )
$sourcePath string
$destinationPath string

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

Resets internal state and sets the target package data.
public prepare ( array $targetPackageData ) : void
$targetPackageData array
Результат void

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

Apply the given processor to the raw results of loading the given configuration type for the package from YAML. If multiple files exist (context configuration) all are processed independently.
protected processConfiguration ( string $configurationType, Closure $processor, boolean $saveResult = false ) : void
$configurationType string One of ConfigurationManager::CONFIGURATION_TYPE_*
$processor Closure
$saveResult boolean
Результат void

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

This expects fully qualified class names, so proper refactoring can be done.
protected renameClass ( string $oldName, string $newName ) : void
$oldName string
$newName string
Результат void

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

This expects a fully qualified class name, so proper refactoring can be done.
protected renameMethod ( string $className, string $oldMethodName, string $newMethodName, boolean $withInheritance = true ) : void
$className string the class that contains the method to be renamed
$oldMethodName string the method to be renamed
$newMethodName string the new method name
$withInheritance boolean if true, also rename method on child classes
Результат void

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

Does a simple search and replace on all (textual) files. The filter array can be used to give file extensions to limit the operation to.
protected searchAndReplace ( string $search, string $replacement, array | string $filter = ['php', 'yaml', 'html'] ) : void
$search string
$replacement string
$filter array | string either an array with file extensions to consider or the full path to a single file to process
Результат void

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

The patterns are used as is, no quoting is done. A closure can be given for the $replacement variable. It should return a string and is given an array of matches as parameter.
protected searchAndReplaceRegex ( string $search, string | Closure $replacement, array | string $filter = ['php', 'yaml', 'html'] ) : void
$search string
$replacement string | Closure
$filter array | string either an array with file extensions to consider or the full path to a single file to process
Результат void

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

If changes cannot be automated or something needs to be adjusted manually for other reasons, leave a note for the developer. The notes will be shown together after migrations have been run.
См. также: showWarning
protected showNote ( string $note ) : void
$note string
Результат void

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

Similar to showNote, but the output is given a stronger emphasis. The warnings will be shown together after migrations have been run.
См. также: showNote
protected showWarning ( string $warning ) : void
$warning string
Результат void

up() абстрактный публичный Метод

It will be called by the Manager upon migration.
abstract public up ( ) : void
Результат void

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

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

protected Manager,Neos\Flow\Core\Migrations $migrationsManager
Результат Manager

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

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

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

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

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

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

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

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

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

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