Download the PHP package nimblephp/maintenance without Composer

On this page you can find all versions of the php package nimblephp/maintenance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package maintenance

nimblephp/maintenance

Maintenance mode for NimblePHP. While enabled, every request gets a 503 page except requests from allow-listed IP addresses.

Requires nimblephp/settings — the whole configuration (on/off, message, allowed IPs, retry-after) is stored there, so this module ships no migration and no table of its own.

Contents

Translations

The maintenance page title and default message are translated via the framework translation system (keys module.maintenance.title and module.maintenance.message), shipped for en and pl, and rendered in the current language. A custom message set with Maintenance::enable('...') overrides the translated default.

Installation

The settings module migration must have been run (it provides the storage table).

CLI

The module ships console commands (auto-registered via the module system). A fresh install needs nothing in the database — maintenance:on creates the settings rows:

Usage (PHP)

When enabled, MaintenanceMiddleware (registered at high priority) intercepts requests in beforeController: allow-listed IPs pass through, everyone else gets a 503 with a Retry-After header. The check fails open — any error while reading the state lets the request through, so a misconfiguration can't brick the site.

View / overriding the page

The page is rendered through the framework view service from the container, so whatever view module is installed renders it transparently:

Override the page with maintenance.view:

A flat name (e.g. test) maps to App/View/test.twig under Twig or App/View/test.phtml under the base renderer. Your view receives title, message, lang and retryAfter. If the view service or the view file is unavailable, a built-in 503 page is rendered as a fallback, so the module always works — even without a view module installed.

Configuration keys (in settings)

Key Type Default
maintenance.enabled bool false
maintenance.message string generic message
maintenance.allowed_ips json (array) []
maintenance.retry_after int (seconds) 3600

The client IP is read from REMOTE_ADDR. Behind a proxy/load balancer, make sure that reflects the real client (or add the proxy IP to the allow-list).


All versions of maintenance with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
nimblephp/framework Version >=0.4.13
nimblephp/settings Version >=0.0.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nimblephp/maintenance contains the following files

Loading the files please wait ...