1. Go to this page and download the library: Download nimblephp/maintenance 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/ */
nimblephp / maintenance example snippets
use NimblePHP\Maintenance\Maintenance;
// turn on (optionally with a custom message)
Maintenance::enable('Back in 10 minutes.');
// let yourself through
Maintenance::allowIp('127.0.0.1');
// status / config
Maintenance::isEnabled(); // bool
Maintenance::allowedIps(); // ['127.0.0.1', ...]
Maintenance::message(); // string
Maintenance::isAllowed($ip); // true when off or IP allow-listed
// turn off
Maintenance::disable();