Download the PHP package serlo-org/athene2-versioning without Composer
On this page you can find all versions of the php package serlo-org/athene2-versioning. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download serlo-org/athene2-versioning
More information about serlo-org/athene2-versioning
Files in serlo-org/athene2-versioning
Package athene2-versioning
Short Description Zend Framework 2 Module that provides versioning components for Athene2
License MIT
Homepage https://github.com/serlo-org/athene2-versioning
Informations about the package athene2-versioning
athene2-versioning
Installation
athene2-versioning only officially supports installation through Composer. For Composer documentation, please refer to getcomposer.org.
Install the module:
Using the versioning module
The versioning module enables you to manage repositories which contain revisions. Each repository has n revisions and one or zero HEAD revision. The HEAD revision is the current revision of that repository. The default implementation of the VersioningManager is Doctrine friendly!
Features
- Doctrine implementation (using the ObjectManager)
- Bundled with zfc-rbac for authorization
- Events
Understanding how it works
The versioning module consists of one Versioning\Manager\VersioningManager
, who implements the Versioning\Manager\VersioningManagerInterface
. He manages models or entities which implement the Versioning\Entity\RepositoryInterface
and the Versioning\Entity\RevisionInterface
.
Let's implement those entity interfaces!
You can find example implementations here!
RevisionInterface
RepositoryInterface
Well, that wasn't so hard, was it?
Using the RepositoryManager
The default RepositoryManager
implementation is bundled with Doctrine, ZF2 EventManager and zfc-rbac.
Setting up permissions
Not everyone should be allowed to commit, reject and accept revisions, right? Therefore, the RepositoryManager
is able to handle permissions via zfc-rbac!
To set up permissions, you will need to add some config data to your module.config.php:
Important: The revision is always passed to zfc-rbac as a context object for usage with e.g. Assertions!
Create a new Revision and fill it with data!
Trash a revision
Someone made a mistake? Just reject the revision!
Check out a revision
Do you approve of a certain revision? Go ahead and check it out!
Hooking into Events
The VersioningManager fires events for both failure and success:
There are also other events available, like:
VersioningEvent::COMMIT
andVersioningEvent::COMMIT_UNAUTHORIZED
VersioningEvent::REJECT
andVersioningEvent::REJECT_UNAUTHORIZED
VersioningEvent::CHECKOUT
andVersioningEvent::CHECKOUT_UNAUTHORIZED
To be done
There are a more things to come:
- A beautiful UI to manage your repositories
- A RESTful API
- Better docs
All versions of athene2-versioning with dependencies
zendframework/zend-mvc Version ~2.3
zendframework/zend-servicemanager Version ~2.3
zendframework/zend-filter Version ~2.3
zendframework/zend-form Version ~2.3
zendframework/zend-stdlib Version ~2.3
zendframework/zend-eventmanager Version ~2.3
zendframework/zend-paginator Version ~2.3
zendframework/zend-authentication Version ~2.3
zendframework/zend-validator Version ~2.3
doctrine/common Version ~2.4
doctrine/doctrine-module Version ~0.8
doctrine/doctrine-orm-module Version ~0.8
serlo-org/athene2-common Version dev-master
zf-commons/zfc-rbac Version 2.3