Recommend this page to a friend! |
Classes of Andrey Postal | PHP Stuff Versioned | README.md | Download |
|
![]() Stuff VersionedThis is a light library with zero dependency that provides a version manager and interfaces for version control anything and with any desired backend (like file, mysql, mongodb, postgresql...) Installation
Available backendsUsageCreate your versions implementing the VersionInterface. This can be used to version stuff like data seed, data migrations, system updates.... The versioning process is controlled by the ID and can be used dynamically, like to perform versioning based on users or organization. BackendInterface defines the structure needed to persist the versioning progress/history and will be used as checkpoints in the versioning process, ensuring we don't re-execute previous successful versions. The only actual code shipped by this library is the VersionManager which only control the version list and the execution (run process) ensuring that we do not execute the same version id twice. The order of version inclusion in the VersionManager maters and old versions should never change position or be removed. If some old version should not be executed on new environments, you should just skip if by returning 'false' in the check process. Some simple library usage may look like:
And your version implementation may look like:
|