PHPackages                             kefisu/maintenance-bundle - 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. kefisu/maintenance-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

kefisu/maintenance-bundle
=========================

A Symfony Bundle that allows you to put your application into maintenance mode.

03PHP

Since Sep 15Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony Maintenance Bundle
==========================

[](#symfony-maintenance-bundle)

The Symfony Maintenance Bundle provides a simple way to manage maintenance mode for your Symfony application. It allows you to enable or disable maintenance mode and customize the response returned to users when the application is in maintenance mode.

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

[](#installation)

To install the bundle use Composer:

```
composer require kefisu/maintenance-bundle
```

Add the bundle to your `config/bundles.php` file if Symfony doesn't do it automagically:

```
return [
    // ...
    Kefisu\Bundle\MaintenanceBundle\MaintenanceBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

The bundle provides a default configuration that can be customized in your `config/packages/maintenance.yaml` file:

```
maintenance:
  maintenance_file_path: '%kernel.cache_dir%/maintenance'
```

- `maintenance_file_path` - the path to the file where the maintenance mode status is stored when using the file based storage. By default, it writes to your system `tmp` directory

Usage
-----

[](#usage)

### Enable maintenance mode

[](#enable-maintenance-mode)

To enable maintenance mode, run the following command:

```
php bin/console maintenance:enable
```

A secret will be generated for each maintenance mode activation. This secret can be used to bypass the maintenance mode and access the application. The secret is displayed in the command output.

#### Customizing the maintenance mode response

[](#customizing-the-maintenance-mode-response)

You can customize the following maintenance mode response options:

- HTTP Status code, by using the --status option the HTTP Status code that is returned can be customized.
- Duration, by using the --duration option the duration of the maintenance mode can be set in minutes. This will return a Retry-After header with the duration in seconds. If the duration is not set, the Retry-After header will not be set.

### Disable maintenance mode

[](#disable-maintenance-mode)

To disable maintenance mode, run the following command:

```
php bin/console maintenance:disable
```

### Checking maintenance mode status

[](#checking-maintenance-mode-status)

To check if maintenance mode is enabled, run the following command:

```
php bin/console maintenance:status
```

How it works
------------

[](#how-it-works)

### Maintenance Managers

[](#maintenance-managers)

Any implementation of the `Kefisu\Bundle\MaintenanceBundle\Contract\MaintenanceManagerInterface` is responsible for managing the maintenance mode status. The bundle provides a default implementation of this interface for:

- `Kefisu\Bundle\MaintenanceBundle\Service\FileBasedMaintenanceManager` - reads and writes the maintenance mode status to the filesystem. The status is stored in a file named `maintenance` in the project cache directory. (Default)
- `Kefisu\Bundle\MaintenanceBundle\Service\CacheBasedMaintenanceManager` - reads and writes the maintenance mode status to the cache configured for your application. The status is stored in the cache with the key `maintenance`.

### Maintenance Listener

[](#maintenance-listener)

The `Kefisu\Bundle\MaintenanceBundle\EventListener\MaintenanceListener` class listens for kernel requests and checks if maintenance mode is active. If it is, it blocks the request and returns a 503 response. When maintenance mode is disabled, the request is passed to the next listener. If you use the secret generated when you enable maintenance mode, the listener will allow the request to pass through.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/44f9a6e31477244ab219629befe23513039ec46147b1702511678c930bdc5883?d=identicon)[Kefisu](/maintainers/Kefisu)

---

Top Contributors

[![Kefisu](https://avatars.githubusercontent.com/u/32323573?v=4)](https://github.com/Kefisu "Kefisu (6 commits)")

### Embed Badge

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

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

PHPackages © 2026

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