Repository¶
Service Name: Services::REPOSITORY
The repository service must either implement RepositoryInterface
directly or extend
AbstractRepository
, which provides some convenient boilerplate functionality.
The Repository Provider` must also provide the Services::REPOSITORY_FILESYSTEM
and
:php:const`Services::MIGRATION_FACTORY` services.
The default implementation for this service is DirectoryRepository
. And unless you need to load migrations
for another source other than the filesystem, or from multiple folders at a time, the default implementation should
cover the needs of most migration libraries.
Repository Filesystem¶
Service Name: Services::REPOSITORY_FILESYSTEM
This service must be a instance of League\Flysystem\FilesystemInterface
and is used both to load the migrations and
also to create them (the latter with the migrations:create command). Its root must therefore point to the folder
where those migrations will be located.
By default the repository’s folder can be customized by end-users by using the configuration option “migrations.directory”.
Migration Factory¶
Service Name: Services::MIGRATION_FACTORY
This service must implement FactoryInterface
. It’s used to instantiate all migrations that are loaded by
the repository, which is useful for example if the migration class needs certain dependencies to be injected.
The default implementation used for this service is SimpleFactory
.