Download the PHP package contenir/contenir-workflow-mezzio without Composer
On this page you can find all versions of the php package contenir/contenir-workflow-mezzio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package contenir-workflow-mezzio
contenir/contenir-workflow-mezzio
Formerly contenir/contenir-workflow; the old package is abandoned in favour of this one.
Database-driven workflow system for Mezzio that generates routes and navigation from a hierarchical page structure, for Contenir CMS.
Your application supplies a tree of resources (pages, articles, ...). For each
resource a workflow decides its route (path, middleware, defaults) and its
navigation page (label, sitemap change frequency and priority). The
ResourceStrategy walks the tree once, caches the result, and the routes are
registered with the Mezzio Application either when it is created (delegator
factory) or on the first request (middleware).
Requirements
- PHP 8.3, 8.4 or 8.5
- mezzio/mezzio 3.18+
- laminas/laminas-servicemanager 3.22+
- laminas/laminas-cache 3.12+ with a storage adapter that can store arrays
The 0.x release remains available from the 0.x branch and the v0.1.0 tag;
see UPGRADE-2.0.md.
Install
With laminas-component-installer
the Contenir\Workflow\ConfigProvider is added to your configuration
automatically. It registers ResourceStrategy, WorkflowPluginManager and
WorkflowMiddleware.
Usage
1. Implement ResourceInterface on your entity
2. Provide the resource tree with a ResourceAdapterInterface
3. Configure the workflow manager
4. Handle the routed request
Each route carries the resource's primary keys as the id default, which the
router passes to the request as an attribute:
Public API
| Class | Purpose |
|---|---|
ResourceInterface |
A routable resource: slug, primary keys, type, id, children |
Repository\ResourceAdapterInterface |
Supplies the top-level resources |
Workflow\WorkflowInterface |
Turns one resource into a route config and a navigation config |
Workflow\AbstractWorkflow |
Base workflow: route id <type>-<id>, path from slug, navigation defaults |
Workflow\AbstractPageWorkflow |
Page route logic: routes a resource to its own getMiddleware() (or $middleware) |
Workflow\PageWorkflow |
The default page workflow (final): monthly, priority 0.6 |
Workflow\WorkflowPluginManager |
Plugin manager for workflows (page, Page, PageWorkflow) |
Workflow\WorkflowFactory |
Factory for workflows with a no-argument constructor |
Strategy\ResourceStrategyInterface |
getRouteConfig(), getNavigationConfig(), clearCache() |
Strategy\AbstractResourceStrategy |
Walks the tree and caches; extend it to customise (getWorkflowType(), getNavigationPage()) |
Strategy\ResourceStrategy |
The default strategy (final) |
Factory\WorkflowApplicationDelegatorFactory |
Registers the routes when the Application is created |
Middleware\WorkflowMiddleware |
Registers the routes on the first request instead |
ConfigProvider and the Factory\* classes |
Container wiring |
Every concrete class is final; the abstract classes and interfaces above
are the extension points.
The docs folder covers each area in detail:
- Configuration
- Resources and adapters
- Workflows
- Route registration
- Navigation
- Caching
Development
The QA toolchain is contenir/contenir-qa-tools.
Mago is a standalone binary, installed
separately (brew install mago).
License
MIT. See LICENSE.
All versions of contenir-workflow-mezzio with dependencies
laminas/laminas-cache Version ^3.12
laminas/laminas-cache-storage-adapter-filesystem Version ^2.4
laminas/laminas-diactoros Version ^3.3
laminas/laminas-servicemanager Version ^3.22
mezzio/mezzio Version ^3.18
psr/container Version ^1.1 || ^2.0
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0.2
psr/http-server-middleware Version ^1.0.2