PHPackages                             contenir/maintenance-laminas-mvc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. contenir/maintenance-laminas-mvc

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

contenir/maintenance-laminas-mvc
================================

Laminas MVC adapter for contenir/maintenance — short-circuits dispatch with 503 when maintenance mode is active.

v0.3.1(4w ago)029MITPHPPHP ^8.1 || ^8.2 || ^8.3

Since May 5Pushed 4w agoCompare

[ Source](https://github.com/contenir/maintenance-laminas-mvc)[ Packagist](https://packagist.org/packages/contenir/maintenance-laminas-mvc)[ RSS](/packages/contenir-maintenance-laminas-mvc/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (6)Used By (0)

contenir/maintenance-laminas-mvc
================================

[](#contenirmaintenance-laminas-mvc)

Laminas MVC adapter for [`contenir/maintenance`](https://github.com/contenir/maintenance).

When the admin (Contenir CMS) toggles maintenance mode, this adapter short-circuits dispatch in the consuming Site with a 503 response — until the flag is cleared.

Install
-------

[](#install)

```
composer require contenir/maintenance-laminas-mvc
```

Wire-up
-------

[](#wire-up)

### 1. Register the module

[](#1-register-the-module)

```
// config/modules.config.php
return [
    // ...other modules
    'Contenir\\Maintenance\\Laminas\\Mvc',
];
```

If you have `laminas/laminas-component-installer` installed, this happens automatically.

### 2. Point at the shared state file

[](#2-point-at-the-shared-state-file)

```
// config/autoload/maintenance.local.php
return [
    'maintenance' => [
        // Same path the admin (Contenir CMS) is configured to write.
        'file' => '/var/www/shared/maintenance.local.php',
    ],
];
```

That's the minimum. With nothing else set, the adapter will return a plain 503 page with the configured message whenever maintenance is active.

### 3. (Optional) Bypass for operators

[](#3-optional-bypass-for-operators)

```
// config/autoload/maintenance.local.php
return [
    'maintenance' => [
        'file'   => '/var/www/shared/maintenance.local.php',
        'bypass' => static function (\Laminas\Mvc\MvcEvent $event): bool {
            // Return true to let the request through despite maintenance mode.
            // E.g. allow authenticated super-admins:
            $auth = $event->getApplication()->getServiceManager()->get('auth');
            return $auth->hasIdentity() && $auth->getIdentity()->isSuperAdmin();
        },
    ],
];
```

### 4. (Optional) Customise the response body

[](#4-optional-customise-the-response-body)

```
'maintenance' => [
    'body_template' => file_get_contents(__DIR__ . '/../templates/maintenance.html'),
    'retry_after'   => 1800, // seconds, sent as Retry-After header
],
```

`body_template` is a `sprintf` format string with a single `%s` for the escaped message text. If you need anything more elaborate (full layout, view helpers, translation), replace the `MaintenanceListener` service with your own factory.

Listener priority
-----------------

[](#listener-priority)

The listener attaches at `MvcEvent::EVENT_DISPATCH` priority `10000` so it runs before route → controller dispatch and before any other listener that hasn't asked for higher priority. The exact value is exposed as `Module::DISPATCH_PRIORITY` if you need to coordinate with another listener.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

29d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f377cb072a13f76c1b06d272c1f21f41903b3a90d9e1c5c6d928a955fe815441?d=identicon)[peptolab](/maintainers/peptolab)

---

Top Contributors

[![simon-mundy](https://avatars.githubusercontent.com/u/46739456?v=4)](https://github.com/simon-mundy "simon-mundy (6 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/contenir-maintenance-laminas-mvc/health.svg)

```
[![Health](https://phpackages.com/badges/contenir-maintenance-laminas-mvc/health.svg)](https://phpackages.com/packages/contenir-maintenance-laminas-mvc)
```

###  Alternatives

[magento/community-edition

Magento 2 (Open Source)

12.1k53.0k12](/packages/magento-community-edition)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.0k4.9k](/packages/shlinkio-shlink)[rwoverdijk/assetmanager

An assetmanager module for Laminas.

2142.1M49](/packages/rwoverdijk-assetmanager)[kokspflanze/bjy-authorize

Laminas\\Acl based firewall system for Mezzio dispatch protection

20194.8k4](/packages/kokspflanze-bjy-authorize)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
