PHPackages                             daycry/maintenancemode - 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. daycry/maintenancemode

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

daycry/maintenancemode
======================

Maintenance mode for CodeIgniter 4

v3.0.0(1mo ago)69.1k↑265.6%3[3 PRs](https://github.com/daycry/maintenancemode/pulls)MITPHPPHP &gt;=8.2CI passing

Since May 10Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/daycry/maintenancemode)[ Packagist](https://packagist.org/packages/daycry/maintenancemode)[ Docs](https://github.com/daycry/maintenancemode)[ RSS](/packages/daycry-maintenancemode/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (6)Versions (25)Used By (0)

Maintenance Mode for CodeIgniter 4
==================================

[](#maintenance-mode-for-codeigniter-4)

> Production-grade maintenance mode for CodeIgniter 4 — typed, testable, and ready for distributed deployments.

### Package

[](#package)

[![Latest Stable Version](https://camo.githubusercontent.com/49d4b662e5e624a71f89583bf54fa4594569d01e9e06c8d380a653897cf0116c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461796372792f6d61696e74656e616e63656d6f64652e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/daycry/maintenancemode)[![Total Downloads](https://camo.githubusercontent.com/ec6e4c7c423517019317218a31ab187e7163494751daf4763c8e00111b5f10a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461796372792f6d61696e74656e616e63656d6f64652e737667)](https://packagist.org/packages/daycry/maintenancemode)[![Monthly Downloads](https://camo.githubusercontent.com/82ac2c6b47411a8fd1ef881d2812a86d46587c2a51c07799ba0bc9079808543d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6461796372792f6d61696e74656e616e63656d6f64652e737667)](https://packagist.org/packages/daycry/maintenancemode)[![PHP Version Require](https://camo.githubusercontent.com/d126c17f7f0e1818ce1dc0a936f3781895027f6a09970eabf9fdab3074d65e9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6461796372792f6d61696e74656e616e63656d6f64652f7068703f636f6c6f723d383839326266)](https://packagist.org/packages/daycry/maintenancemode)[![License](https://camo.githubusercontent.com/c6862316937645a485fe34aa30ce58d42ca6d937760b54bb1e0f48409aba05aa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6461796372792f6d61696e74656e616e63656d6f6465)](https://github.com/daycry/maintenancemode/blob/master/LICENSE)

### Quality

[](#quality)

[![PHPUnit](https://github.com/daycry/maintenancemode/actions/workflows/phpunit.yml/badge.svg)](https://github.com/daycry/maintenancemode/actions/workflows/phpunit.yml)[![PHPStan](https://github.com/daycry/maintenancemode/actions/workflows/phpstan.yml/badge.svg)](https://github.com/daycry/maintenancemode/actions/workflows/phpstan.yml)[![Psalm](https://github.com/daycry/maintenancemode/actions/workflows/psalm.yml/badge.svg)](https://github.com/daycry/maintenancemode/actions/workflows/psalm.yml)[![Rector](https://github.com/daycry/maintenancemode/actions/workflows/rector.yml/badge.svg)](https://github.com/daycry/maintenancemode/actions/workflows/rector.yml)[![Code Style](https://github.com/daycry/maintenancemode/actions/workflows/code-style.yml/badge.svg)](https://github.com/daycry/maintenancemode/actions/workflows/code-style.yml)[![CodeQL](https://github.com/daycry/maintenancemode/actions/workflows/codeql.yml/badge.svg)](https://github.com/daycry/maintenancemode/actions/workflows/codeql.yml)[![Coverage Status](https://camo.githubusercontent.com/ab847ae225fd4e91992d5fa779c2ef3ddb1ef438cf968253d31b2af6a8edd90f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6461796372792f6d61696e74656e616e63656d6f64652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/daycry/maintenancemode?branch=master)

### Community

[](#community)

[![GitHub stars](https://camo.githubusercontent.com/dd70d0d1448676c6f473024b77a72f5860e3786653ad4ac64de2edae9398fe38/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6461796372792f6d61696e74656e616e63656d6f64653f7374796c653d736f6369616c)](https://github.com/daycry/maintenancemode/stargazers)[![Donate](https://camo.githubusercontent.com/b57c445af971e3e99c2d0ccdbf4fa7faa4358ba27fecc8f68459b30289f82eda/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d626c75652e737667)](https://www.paypal.com/donate?business=SYC5XDT23UZ5G&no_recurring=0&item_name=Thank+you%21&currency_code=EUR)

Highlights
----------

[](#highlights)

- 🛡 **Timing-safe bypass** — `hash_equals()` for every secret/cookie comparison.
- 🚦 **Multiple bypass paths** — IP / CIDR (IPv4 + IPv6), URL secret, signed cookie, route allow-list.
- 🗓 **Scheduled windows** — `--start` / `--end`, auto-deactivation on the next request.
- 📦 **Pluggable storage** — `cache` (Redis/Memcached/file via CI4 Cache) or `file` driver, switch with one config flag.
- 🔌 **Framework events** — `maintenance.activated`, `.deactivated`, `.bypassed`, `.access_denied`, `.scheduled.expired`.
- 🧱 **JSON or HTML** — content-negotiated 503 (or 302 redirect) per request.
- 🧪 **149 unit tests**, PHPStan + Psalm + Rector clean, PHP 8.2 / 8.3 / 8.4.

Install
-------

[](#install)

```
composer require daycry/maintenancemode
php spark mm:publish
```

Then wire the filter in `app/Config/Filters.php`:

```
public array $aliases = [
    'maintenance' => \Daycry\Maintenance\Filters\Maintenance::class,
];

public array $globals = [
    'before' => ['maintenance'],
];
```

Quick start
-----------

[](#quick-start)

```
# Activate (with an allow-listed IP, a secret URL bypass, and a 30 min ETA)
php spark mm:down --message "Upgrading the database" \
                  --ip "203.0.113.5" \
                  --secret "ops-token" \
                  --duration 30

# Inspect state
php spark mm:status

# Bring the site back up
php spark mm:up
```

```
# Schedule a window
php spark mm:down --start "2026-05-10 02:00" --end "2026-05-10 04:00"

# Skip 503 for healthchecks (config option)
$config->bypassRoutes = ['/health', '/api/webhooks/*'];

# Force JSON response on /api/* routes
$config->jsonRoutes = ['/api/*'];

# Render a custom view for THIS window
php spark mm:down --render errors/html/branded_503

# Redirect to a status page instead of 503
php spark mm:down --redirect https://status.example.com
```

Documentation
-------------

[](#documentation)

Everything else lives in [`docs/`](docs/README.md):

- [Installation &amp; first run](docs/installation.md)
- [Full configuration reference](docs/configuration.md)
- [CLI commands](docs/commands.md)
- [Bypass methods &amp; priority](docs/bypass.md)
- [Filter &amp; framework events](docs/filters-and-events.md)
- [Storage drivers (cache / file)](docs/storage-drivers.md)
- [Architecture](docs/architecture.md)
- [Security model](docs/security.md)
- [Troubleshooting](docs/troubleshooting.md) · [FAQ](docs/faq.md) · [Upgrade guide](docs/upgrade.md) · [Roadmap](docs/roadmap.md)

### Examples

[](#examples)

- [Basic maintenance](docs/examples/basic-maintenance.md)
- [Scheduled window](docs/examples/scheduled-window.md)
- [JSON 503 for APIs](docs/examples/api-json-response.md)
- [Slack / PagerDuty notifications](docs/examples/webhook-notifications.md)
- [Multi-tenant *(planned)*](docs/examples/multi-tenant.md)
- [Cloudflare / CDN trusted proxies *(planned)*](docs/examples/cdn-cloudflare.md)

Quality bar
-----------

[](#quality-bar)

This package treats the toolchain as part of the contract. Every push runs:

WorkflowToolWhat it guards[PHPUnit](.github/workflows/phpunit.yml)PHPUnit · matrix PHP 8.2 / 8.3 / 8.4 + lowest-depsBehaviour[Code Style](.github/workflows/code-style.yml)PHP-CS-Fixer (CodeIgniter 4 ruleset)Formatting[PHPStan](.github/workflows/phpstan.yml)PHPStan level 6Static types[Psalm](.github/workflows/psalm.yml)Psalm error level 6Static types &amp; dead code[Rector](.github/workflows/rector.yml)Rector dry-runRefactor drift[CodeQL](.github/workflows/codeql.yml)GitHub CodeQL (Actions)Supply-chain (workflow injection, secret leaks)Reproduce them locally with `composer ci`.

Contributing
------------

[](#contributing)

Bug reports, feature requests and PRs are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md)first. For security issues, follow [SECURITY.md](SECURITY.md) — please **don't**file them as public issues.

License
-------

[](#license)

[MIT](LICENSE) · made for the CodeIgniter 4 community.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance89

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 94.5% 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 ~101 days

Recently: every ~175 days

Total

19

Last Release

56d ago

Major Versions

v0.9.0 → v1.0.42021-05-10

v1.3.2 → v2.0.02025-08-04

v2.0.1 → v3.0.02026-05-08

PHP version history (3 changes)v1.0.0PHP &gt;=7.2

v1.2.0PHP &gt;=7.4

v1.3.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b0f66565d5c9ca3c84fb294e04f8d5e0b9a867d9c06f83b95bf168bd6fcf9bc?d=identicon)[daycry](/maintainers/daycry)

---

Top Contributors

[![daycry](https://avatars.githubusercontent.com/u/7590335?v=4)](https://github.com/daycry "daycry (69 commits)")[![maheshwari-vaibhav](https://avatars.githubusercontent.com/u/61326537?v=4)](https://github.com/maheshwari-vaibhav "maheshwari-vaibhav (4 commits)")

---

Tags

maintenancecodeigniter4503downtime

### Embed Badge

![Health badge](/badges/daycry-maintenancemode/health.svg)

```
[![Health](https://phpackages.com/badges/daycry-maintenancemode/health.svg)](https://phpackages.com/packages/daycry-maintenancemode)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

3014.6M26](/packages/vaimo-composer-patches)[codeigniter4/tasks

Task Scheduler for CodeIgniter 4

124177.3k1](/packages/codeigniter4-tasks)[corley/maintenance-bundle

Corley Maintenance Bundle

22233.9k](/packages/corley-maintenance-bundle)[codeigniter4/settings

Settings library for CodeIgniter 4

95589.6k34](/packages/codeigniter4-settings)[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78263.0k5](/packages/brussens-yii2-maintenance-mode)[codeigniter4/devkit

Development toolkit for CodeIgniter libraries and projects

69201.9k121](/packages/codeigniter4-devkit)

PHPackages © 2026

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