Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fusic/maintenance
Maintenance plugin for CakePHP
https://github.com/fusic/maintenance
Last synced: about 1 month ago
JSON representation
Maintenance plugin for CakePHP
- Host: GitHub
- URL: https://github.com/fusic/maintenance
- Owner: fusic
- Created: 2010-07-10T07:18:39.000Z (over 14 years ago)
- Default Branch: 3.0
- Last Pushed: 2021-03-02T01:43:17.000Z (almost 4 years ago)
- Last Synced: 2024-09-17T20:29:57.406Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 33.2 KB
- Stars: 43
- Watchers: 8
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Maintenance Plugin for CakePHP
## Installation
You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
The recommended way to install composer packages is:
```
composer require fusic/maintenance
```## Usage
```php
// src/Application.php
add(MaintenanceMiddleware::class)
->add(ErrorHandlerMiddleware::class)
->add(AssetMiddleware::class)
->add(RoutingMiddleware::class);return $middleware;
}
``````html
// src/Template/Error/maintenance.ctpmaintenance page.
``````
// tmp/maintenancetouch tmp/maintenance
```## Config
### useXForwardedForIf your system is behind a reverse proxy like load balancer that adds X-Forwarded-For header, set useXForwardedFor as true.
```php
// src/Application.php
use Maintenance\Middleware\MaintenanceMiddleware;public function middleware($middleware)
{
$middleware
->add(new MaintenanceMiddleware([
'allowIp' => [
'127.0.0.1',
],
'useXForwardedFor' => true,
]))
->add(ErrorHandlerMiddleware::class)
->add(AssetMiddleware::class)
->add(RoutingMiddleware::class);
return $middleware;
}
```