Maintenance mode module for CodeIgniter 4 with CLI
$ composer require codeigniterext/maintenancemode
or
$ composer require codeigniterext/maintenancemode:dev-master
Now you can use the following commands from the command prompt
$ php spark mm:publish
$ php spark mm:down
$ php spark mm:status
$ php spark mm:up
Run the following command from the command prompt, and it will copy views (error_503.php) into your application
$ php spark mm:publish
edit application/Config/Events.php and add the new line top of the code for maintenance mode check:
Events::on('post_controller_constructor', 'CodeigniterExt\MaintenanceMode\Controllers\MaintenanceMode::check');
...
edit application/Config/Filters.php and add the new line in $aliases array:
public $aliases = [
'maintenancemode' => \CodeigniterExt\MaintenanceMode\Filters\MaintenanceMode::class,
...
]
and add "maintenancemode" in $globals['before'] array:
public $globals = [
'before' => [
'maintenancemode',
...
],
'after' => [
...
],
];