Download the PHP package progminer/maintenance-screen without Composer
On this page you can find all versions of the php package progminer/maintenance-screen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download progminer/maintenance-screen
More information about progminer/maintenance-screen
Files in progminer/maintenance-screen
Package maintenance-screen
Short Description The "Maintenance mode" screen library
License MIT
Informations about the package maintenance-screen
maintenance-screen
The "Maintenance mode" screen library
Install
Via Composer
For using some included classes you also need to install more requrements:
-
For
MaintenanceScreen\FileLoader\YamlFileLoader
- Symfony Yaml: - For
ProgMinerUtils\TemplateRenderer\TwigTemplateRenderer
- Twig:
Usage
An instance of MaintenanceScreen\MaintenanceScreen
consists of configurations array,
MaintenanceScreen\TranslatorProvider\TranslatorProviderInterface
instance
and ProgMinerUtils\TemplateRenderer\TemplateRendererInterface
instance.
This example step by step illustrates how works with the MaintenanceScreen\MaintenanceScreen
.
Example
In first order you have to write uses, include a vendor/autoload.php
(ommited), etc.
Also you could make configuration array for MaintenanceScreen\MaintenanceScreen
.
Here you have to make MaintenanceScreen\TranslatorProvider\TranslatorProviderInterface
instance
and you have two included methods:
- Use translations from array (
MaintenanceScreen\TranslatorProvider\ArrayTranslatorProvider
class) - Use translations from config files (
MaintenanceScreen\TranslatorProvider\FilesystemTranslatorProvider
class)
A simple example for first method here:
Also you can create class that implements MaintenanceScreen\TranslatorProvider\ITranslatorProvider
.
Now you have to make a ProgMinerUtils\TemplateRenderer\TemplateRendererInterface
instance,
for example, ProgMinerUtils\TemplateRenderer\CallableTemplateRenderer
:
And, finally, MaintenanceScreen\MaintenanceScreen
instance:
When you have an instance of MaintenanceScreen\MaintenanceScreen
you can render and/or send rendered Symfony\Component\HttpFoundation\Response
:
-
Rendering:
- Sending:
Both methods have not required argument $request
- instance of class Symfony\Component\HttpFoundation\Request
.
If it is not provided this methods calls a Symfony\Component\HttpFoundation\Request::createFromGlobals
method for getting current request.
Todo
- Add more file loaders
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Eridan Domoratskiy
- All Contributors
API Documentation
This projects API documentation is built using Sami and available at https://progminer.github.io/maintenance-screen/master/.
Build
In order to build the documentation first get Sami as a phar file:
Next build the documentation:
The API Documentation will be generated into the docs
folder.
If you would like to preview it locally you can easily do so
with the built-in PHP server:
Then visit http://localhost:3000/master/ to view.
License
The MIT License (MIT). Please see License File for more information.
All versions of maintenance-screen with dependencies
progminer/util-template-renderer Version ^1.0
symfony/config Version ^4.0
symfony/http-foundation Version ^4.0