Download the PHP package tobento/service-migration without Composer
On this page you can find all versions of the php package tobento/service-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-migration
Migration Service
The Migration Service provides a flexible way for handling migrations for PHP applications.
Table of Contents
- Getting started
- Requirements
- Highlights
- Simple Example
- Documentation
- Migration
- Create Migration
- Actions
- Callable
- Dir Copy
- Dir Delete
- Fail
- Files Copy
- Files Delete
- File String Replacer
- Null
- PDO Exec
- Custom Actions
- Process Actions
- Migrator
- Create Migrator
- Install Migration
- Uninstall Migration
- Get Installed Migrations
- Migration Result
- Migration Results
- Migration
- Credits
Getting started
Add the latest version of the Migration service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Simple Example
Create a migration
Install / Uninstall migration
Documentation
Migration
Create Migration
Your migration class must implement the MigrationInterface:
Actions
Callable
The calls the specified callable on process.
Dir Copy
Use the DirCopy::class action to copy a directory to another destination.
Dir Delete
Use the DirDelete::class action to delete a directory.
Fail
The does always fail on action process, throwing a , which might be useful in some cases.
Files Copy
Use the FilesCopy::class action to copy files to another directory.
Files Delete
Use the FilesDelete::class action to delete files.
File String Replacer
Use the FileStringReplacer::class to replace strings from a file.
Null
The does nothing at all, which might be useful in some cases.
PDO Exec
Use the PdoExec::class to execute pdo statements.
Custom Actions
Below is an example of writing a custom action.
Process Actions
You might process an action without using the migrator.
Migrator
Create Migrator
Install Migration
You might want to uninstall if the install has failed.
Uninstall Migration
You might want to uninstall only if the migration has been installed before.
Get Installed Migrations
Migration Result
The migrator install and uninstall method returns the migration result object on success:
Get the migration processed
Get the migration actions processed
Migration Results
You might want to store your results as to get it later to show the migrations processed.
Credits
- Tobias Strub
- All Contributors
All versions of service-migration with dependencies
psr/container Version ^2.0
tobento/service-autowire Version ^1.0
tobento/service-filesystem Version ^1.0
tobento/service-file-creator Version ^1.0