1. Go to this page and download the library: Download contenir/maintenance-mezzio library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// config/pipeline.php
use Contenir\Maintenance\Mezzio\Middleware\MaintenanceMiddleware;
return static function (Application $app): void {
$app->pipe(ErrorHandler::class);
$app->pipe(ServerUrlMiddleware::class);
// Before any page cache, so cached pages are not served during maintenance.
$app->pipe(MaintenanceMiddleware::class);
// ...page cache, routing, dispatch
};
// config/autoload/maintenance.global.php
return [
'maintenance' => [
// Same path the admin (Contenir CMS) is configured to write.
'file' => '/var/www/shared/maintenance.local.php',
],
];