jc-it/yii2-maintenance-mode

Maintenance mode implementation for Yii2

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0.0 2021-12-24 12:31 UTC

This package is not auto-updated.

Last update: 2022-08-06 14:06:02 UTC


README

This extension provides a maintenance mode implementation for Yii2.

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require jc-it/yii2-maintenance-mode

or add

"jc-it/yii2-maintenance-mode": "^<latest version>"

to the require section of your composer.json file.

Configuration

  • Add maintenance mode as component
...
'bootstrap' => ['maintenance'],
'components' => [
    'maintenance' => [
        'class' => \JCIT\maintenance\components\MaintenanceMode::class,
    ],
],
  • Add the console controller
class MaintenanceController extens \JCIT\maintenance\controllers\Maintenance
  • Add a Maintenance action to your SiteController (i.e.)
class SiteController extends \yii\web\Controller
{
    public function actions(): array
    {
        return [
            'maintenance' => \JCIT\maintenance\actions\Maintenance::class,
        ];      
    }
}

TODO

  • Add tests

Credits