-
Notifications
You must be signed in to change notification settings - Fork 8
Maintenance
Note: This documentation covers Inphinit 1.0. For the 2.1 documentation, visit: https://inphinit.github.io/en/docs/maintenance.html
For active maintenance you can set true in 'maintenance' => on ./system/application/Config/config.php file, example:
'appdata_expires' => 86400,
'development' => false,
'maintenance' => trueThis will disable the routes and the ready event (see Events)
For facilitate you can create a Route and use Inphinit\Experimental\Maintenance class
The
Inphinit\Experimental\Maintenanceclass is Experimental, but the maintenance mode is not experimental.
Usage:
-
./system/main.php<?php use Inphinit\Route; //Navigate to http://localhost/[project_name]/maintenance-on for enable maintenance mode Route::set('GET', '/maintenance-on', 'MaintenanceExample:on'); //Navigate to http://localhost/[project_name]/maintenance-off for disable maintenance mode Route::set('GET', '/maintenance-off', 'MaintenanceExample:off');
-
./system/application/Controller/MaintenanceExample.php<?php namespace Controller; use Inphinit\App; use Inphinit\Experimental\Maintenance; class MaintenanceExample { public function on() { //Disabled Routes and 'ready' event Maintenance::down(); return 'Maintenance is ON'; } public function off() { //enable Routes and 'ready' event Maintenance::up(); return 'Maintenance is OFF'; } }
For simplicity you can use Closures, put this in your ./system/main.php:
<?php
use Inphinit\Route;
use Inphinit\Experimental\Maintenance;
//Navegue até http://localhost/[project_name]/maintenance-on para habilitar o modo de manutenção
Route::set('GET', '/maintenance-on', function () {
//Disabled Routes and 'ready' event
Maintenance::down();
return 'Maintenance is ON';
});
//Navegue até http://localhost/[project_name]/maintenance-off para desabilitar o modo de manutenção
Route::set('GET', '/maintenance-off', function () {
//enable Routes and 'ready' event
Maintenance::up();
return 'Maintenance is OFF';
});Inphinit the PHP Framework is writed using PSR-1, PSR-2 and PSR-4, you can use Controllers, Views, Routes
- Getting Started
- About
- Performance
- Directory Structure
- Constants
- Routing
- Controllers
- Views
- Events
- HTTP Response
- HTTP Request
- HTTP Redirect
- HTTP Content Negotiation
- Storage and Files
- Rest
- Maintenance
- Regular Expression
- Response Cache
- DOM, XML, HTML, JSON and Arrays
- QuerySelector (CSS-selectors) with PHP
- Configuration
- Instalação
- Sobre
- Desempenho
- Estrutura das pastas
- Constantes
- Rotas
- Usando Controllers
- Usando Views
- Eventos
- Resposta HTTP
- Requisição HTTP
- Redirecionamento HTTP
- Negociação de Conteúdo HTTP
- Armazenamento e Arquivos
- Usando Rest
- Manutenção
- Expressão Regular
- Cache Resposta
- DOM, XML, HTML, JSON e Arrays
- QuerySelector (seletores-CSS) com PHP
- Configuração