PHPackages                             triopsi/maintenance - 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. [Framework](/categories/framework)
4. /
5. triopsi/maintenance

ActiveCakephp-plugin[Framework](/categories/framework)

triopsi/maintenance
===================

Maintenance plugin for CakePHP

v1.0.0(3y ago)076MITPHPPHP &gt;=7.4

Since Mar 8Pushed 3y ago2 watchersCompare

[ Source](https://github.com/triopsi/triopsi-Maintenance)[ Packagist](https://packagist.org/packages/triopsi/maintenance)[ RSS](/packages/triopsi-maintenance/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Maintenance plugin for CakePHP
==============================

[](#maintenance-plugin-for-cakephp)

A maintenance mode for your CakePHP application. With this plugin you can put your app into maintenance mode. With a whitelist you can also determine who can still access your application. It comes to you with a component, console and middleware.

> ⚠️ This tool should not be used if the DB connection or your application goes down completely due to upgrades. There it would fail hard. It should only be used for soft maintenance work.

 [![](under_maintenance.png)](under_maintenance.png)

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require triopsi/maintenance

```

Load Plugin via bin/bake
------------------------

[](#load-plugin-via-binbake)

Via the load task you are able to load plugins in your application.php. You can do this by running:

```
bin/cake plugin load Maintenance

```

### Manually Installing

[](#manually-installing)

If the plugin you want to install is not available on packagist.org, you can clone or copy the plugin code into your plugins directory. */plugin/*

Put this in the application.php in the bootstrap method:

```
$this->addPlugin('Maintenance');
```

If we were installing the plugin manually you would need to modify our application’s composer.json file to contain the following information:

```
 "autoload": {
        "psr-4": {
            ...
            "Maintenance\\": "plugins/Maintenance/src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            ...
            "Maintenance\\Test\\": "plugins/Maintenance/tests/"
        }
    },

```

Additionally, you will need to tell Composer to refresh its autoloading cache:

```
php composer.phar dumpautoload

```

Customizing
-----------

[](#customizing)

Make sure you have a template file in `/templates/Error/` named `maintenance.php`.

Configs:

- `className`: Sets the view classname.Accepts either a short name (Ajax) a plugin name (MyPlugin.Ajax) or a fully namespaced name (App\\View\\AppView) or null to use the View class provided by CakePHP.
- `templatePath`: Sets path for template file. e.g. /template/Error.
- `statusCode`: HTTP Response Code for the http header.
- `templateLayout`: Layoutname or false for use default layout.
- `templateFileName`: Teamplet name for maintenance mode.
- `templateExtension`: View template extension.
- `contentType`: Response Type. The MIME type of the resource or the data.
- `api_prefix`: API Url Suffix. Maintenance Mode are disable for this prefix. Type false for disable exceptions.

Those can be used to adjust the content of the maintenance mode page.

Maintenance Component
---------------------

[](#maintenance-component)

This component adds functionality on top:

- A flash message shows you if you are currently whitelisted in case maintenance mode is active (and you just don't see it due to the whitelisting).

### How to setup

[](#how-to-setup)

```
// In your App Controller Class (/src/Controller/AppController)
public function initialize() {
    ...
    $this->loadComponent( 'Maintenance.Maintenance' );
}
```

### Diable the Flash message

[](#diable-the-flash-message)

Write in the `/config/app.php` a variable like:

```
maintenance => array(
	'flash' => false
)

```

or in the initialize method in `/src/Controller/AppController`:

```
Cake\Core\Configure::write( 'maintenance.flash', false )

```

Instead of a flash message, something else can also be triggered. A view variable named `maintenance_mode` is written in the component. With the help of this variable it is possible to query the status in the template files. This could look something like this:

```
// in the layout or view file:

```

MaintenanceMode Commands
------------------------

[](#maintenancemode-commands)

This should be the preferred way of enabling and disabling the maintenance mode for your application.

Commands

- status
- activate
- deactivate
- whitelist
- reset

### Help Page

[](#help-page)

```
Usage:
cake maintenance_mode [-d 0] [-h] [-q] [-r] [-v]  []

Options:

--duration, -d  Duration in minutes - optional.
--help, -h      Display this help.
--quiet, -q     Enable quiet output.
--remove, -r    Remove IP Addresses from whitelist.
--verbose, -v   Enable verbose output.

Arguments:

activity      See the current status (choices: status|activate|deactivate|reset|whitelist)
ip_addresses  A comma separated list of ip addresses for the whitelist.
(optional)

```

### Examples

[](#examples)

Example for activating the maintenance mode:

```
./bin/cake maintenance_mode activate

```

Or with Timout (5 minutes)

```
./bin/cake maintenance_mode -d 5 activate

```

Disable maintenance mode

```
./bin/cake maintenance_mode deativate

```

Or Reset the mode (disable maintenance mode and delete all whitelist ip addresses)

```
./bin/cake maintenance_mode reset

```

Add ip address in the whitelist

```
./bin/cake maintenance_mode whitelist 127.0.0.1

```

Add ip addresses in the whitelist

```
./bin/cake maintenance_mode whitelist 127.0.0.1,127.0.0.2,127.0.0.3

```

Remove a ip address from the whitelist

```
./bin/cake maintenance_mode -r whitelist 127.0.0.1

```

List all ip addresses

```
./bin/cake maintenance_mode whitelist

```

Get status

```
./bin/cake maintenance_mode status

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/958bb343d04c0eda9b612d3a763b25a83cf8d8d7bcf7b36437d8a047c550716c?d=identicon)[triopsi](/maintainers/triopsi)

---

Top Contributors

[![triopsi](https://avatars.githubusercontent.com/u/5702824?v=4)](https://github.com/triopsi "triopsi (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/triopsi-maintenance/health.svg)

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

###  Alternatives

[cakephp/debug_kit

CakePHP Debug Kit

86514.0M138](/packages/cakephp-debug-kit)[cakephp/bake

Bake plugin for CakePHP

11211.2M158](/packages/cakephp-bake)[friendsofcake/bootstrap-ui

Bootstrap front-end framework support for CakePHP

3492.1M32](/packages/friendsofcake-bootstrap-ui)[cakephp/app

CakePHP skeleton app

3831.7M1](/packages/cakephp-app)[cakephp/localized

CakePHP Localized Plugin

218595.6k5](/packages/cakephp-localized)[cakephp/acl

Acl Plugin for CakePHP framework

109553.9k15](/packages/cakephp-acl)

PHPackages © 2026

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