MaintenanceFilter
extends Filter
in package
Route filter that intercepts requests during maintenance mode.
Table of Contents
Properties
- $_customView : string|null
- $_manager : MaintenanceManager
- $_postFn : Closure|null
- $_preFn : Closure|null
Methods
- __construct() : mixed
- post() : mixed|null
- pre() : mixed|null
- checkMaintenance() : mixed|null
- Check if site is in maintenance mode and handle accordingly
- containsDirectoryTraversal() : bool
- Check if a path contains directory traversal patterns
- getClientIp() : string
- Get the client's IP address
- getDefaultMaintenancePage() : string
- Get default maintenance page HTML
- renderMaintenancePage() : string
- Render the maintenance mode page
Properties
$_customView
private
string|null
$_customView
$_manager
private
MaintenanceManager
$_manager
$_postFn
private
Closure|null
$_postFn
$_preFn
private
Closure|null
$_preFn
Methods
__construct()
public
__construct(MaintenanceManager $manager[, string|null $customView = null ]) : mixed
Parameters
- $manager : MaintenanceManager
- $customView : string|null = null
-
Path to custom maintenance view
post()
public
post(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|nullpre()
public
pre(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|nullcheckMaintenance()
Check if site is in maintenance mode and handle accordingly
private
checkMaintenance(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|null —Returns maintenance page or null to continue
containsDirectoryTraversal()
Check if a path contains directory traversal patterns
private
containsDirectoryTraversal(string $path) : bool
Parameters
- $path : string
-
Path to validate
Return values
bool —True if directory traversal detected
getClientIp()
Get the client's IP address
private
getClientIp() : string
Return values
stringgetDefaultMaintenancePage()
Get default maintenance page HTML
private
getDefaultMaintenancePage() : string
Return values
stringrenderMaintenancePage()
Render the maintenance mode page
private
renderMaintenancePage() : string