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

ActiveSymfony-bundle

corley/maintenance-bundle
=========================

Corley Maintenance Bundle

0.5.1(3y ago)22229.9k↓13.1%17[1 issues](https://github.com/matatirosolutions/CorleyMaintenanceBundle/issues)[1 PRs](https://github.com/matatirosolutions/CorleyMaintenanceBundle/pulls)MITPHPPHP &gt;=8.1

Since Apr 25Pushed 3y ago5 watchersCompare

[ Source](https://github.com/matatirosolutions/CorleyMaintenanceBundle)[ Packagist](https://packagist.org/packages/corley/maintenance-bundle)[ RSS](/packages/corley-maintenance-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (20)Used By (0)

Corley Maintenance Bundle
=========================

[](#corley-maintenance-bundle)

A unified way of putting a web application under maintenance using web server strategies. The maintenance mode will cut off all requests and it will replies with a static html file and a 503 header (Service Unavailable).

Those conditions will ensure that a load balancer cut an instance off during a maintenance

[![Build Status](https://camo.githubusercontent.com/77371e17a3e13317b3b6aea562c708262aca9660fde78048100c5e5a2e269f2c/68747470733a2f2f7472617669732d63692e6f72672f6d6174617469726f736f6c7574696f6e732f436f726c65794d61696e74656e616e636542756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matatirosolutions/CorleyMaintenanceBundle)

Install
-------

[](#install)

In `composer.json` add the requirement.

The current version requires at least PHP 8.1 and a supported (as at time of release) version of Symfony (4.4, 5.4, 6.0 and 6.1).

```
"require": {
    "corley/maintenance-bundle": "^0.5"
}
```

To support earlier versions e.g. SF 3.4, 4.2, 4.3, 5.1 etc or PHP greater than 7.2 but less than 8.1 you will need to use:

```
"require": {
    "corley/maintenance-bundle": "^0.4"
}
```

To support earlier versions still, e.g. SF 2.x, 3.3, 4.1 etc or PHP less than 7.2 you will need to use:

```
"require": {
    "corley/maintenance-bundle": "^0.2"
}
```

This version can also be used for more recent Symfony versions, e.g. with 3.4 or 4.4 but is not compatible with Symfony 5 - only `0.3` or greater can be used there because of changes to the event structure in Symfony 5.0.

For pre-Flex applications register the bundle in `AppKernel.php`

```
public function registerBundles()
{
    ...
    $bundles = array(
        ...
        new Corley\MaintenanceBundle\CorleyMaintenanceBundle(),
    );
    ...
    return $bundles;
}
```

For projects built with recent versions of Flex, a default recipe will be generated which will add the bundle to your `bundles.php`. In older versions of Flex you may need to do this yourself

```
Corley\MaintenanceBundle\CorleyMaintenanceBundle::class => ['all' => true],
```

Maintenance mode
----------------

[](#maintenance-mode)

When you want to put your web application under maintenance

```
bin/console corley:maintenance:lock on
```

Restore the application status

```
bin/console corley:maintenance:lock off
```

Configure your web server
-------------------------

[](#configure-your-web-server)

If you use Apache2 you have to add a few lines to your `.htaccess`, for nginx just add dedicated lines to web app configuration. Make sure that those lines precede any other rewrite rule. The `mod_rewrite` module in Apache2 has to be installed and enabled.

In order to obtain your configuration options use the console

### Apache2

[](#apache2)

```
bin/console corley:maintenance:dump-apache
```

### Nginx

[](#nginx)

```
bin/console corley:maintenance:dump-nginx
```

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

[](#configuration)

You can configure the bundle in order to change the default behaviour (all options have a default value)

For projects not using Flex

```
# config.yml
corley_maintenance:
    page: %kernel.root_dir%/../web/maintenance.dist.html
    hard_lock: lock.html
    symlink: false
    web: %kernel.root_dir%/../web
```

For Flex projects

```
# config/packages/corley.yml
corley_maintenance:
    page: %kernel.project_dir%/templates/maintenance.dist.html
    hard_lock: lock.html
    symlink: false
```

Options:

- `page` is the original maintenance page (default: `vendor/corley/maintenance-bundle/Corley/MaintenanceBundle/Resources/views/maintenance.html`)
- `symlink` If you want to use symlinks instead hardcopy strategy (default: hardcopy)
- `hard_lock` Is the name used in order to lock the website (default: `hard.lock`)
- `web` public folder. Prior to 0.4 this defaulted to `%kernel.root_dir%/../web`, since 0.4.0 the new default is `%kernel.project_dir%/public` as the `%kernel.root_dir%` parameter has been deprecated since Symfony 4.2, and was removed in 5.1. If your project's public folder is still `web` (or some other folder) set this in the config file.
- `soft_lock` Is the name used in order to lock the website (using app layer)
- `whitelist` Authorized connections \[soft-lock only\]
    - `paths` A list of paths that skip the maintenance lock
    - `ips` A list of ips that skip the maintenance lock

Soft locking
------------

[](#soft-locking)

The soft locking strategy uses the php layer in order to lock down the website. This means that the application must work in order to lock down the web site.

The soft lock runs at `kernel.request` and stops other event propagation.

When you want to put your web application under maintenance using a soft-locking strategy:

```
bin/console corley:maintenance:soft-lock on
```

Restore the application status

```
bin/console corley:maintenance:soft-lock off
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 61.3% 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 ~164 days

Recently: every ~230 days

Total

19

Last Release

1446d ago

PHP version history (3 changes)0.1.0PHP &gt;=5.3.2

0.3PHP &gt;=7.2

0.5PHP &gt;=8.1

### Community

Maintainers

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

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

---

Top Contributors

[![wdalmut](https://avatars.githubusercontent.com/u/551974?v=4)](https://github.com/wdalmut "wdalmut (57 commits)")[![steveWinter](https://avatars.githubusercontent.com/u/1171712?v=4)](https://github.com/steveWinter "steveWinter (26 commits)")[![armellin](https://avatars.githubusercontent.com/u/16577708?v=4)](https://github.com/armellin "armellin (6 commits)")[![zerai](https://avatars.githubusercontent.com/u/2405279?v=4)](https://github.com/zerai "zerai (1 commits)")[![roberthurkala](https://avatars.githubusercontent.com/u/26058866?v=4)](https://github.com/roberthurkala "roberthurkala (1 commits)")[![IwfY](https://avatars.githubusercontent.com/u/357897?v=4)](https://github.com/IwfY "IwfY (1 commits)")[![piannelli](https://avatars.githubusercontent.com/u/226801?v=4)](https://github.com/piannelli "piannelli (1 commits)")

---

Tags

bundlemaintenancephpsymfonysymfony-bundlenginxmaintenanceapacheapache2Maintenance management503

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)

PHPackages © 2026

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