\Pluf\MiddlewareReadOnly

Readonly middleware.

It is intercepting all the POST requests with a message telling that the website is in read only mode.

Optionally, a message at the top of the page is added to inform that the website is in read only mode.

Add the middleware at the top of your middleware list and optionally add a message to be displayed in your configuration file.

Example:

$cfg['middleware_classes'] = array(
'Pluf_Middleware_ReadOnly',
'Pluf_Middleware_Csrf',
'Pluf_Middleware_Session',
'Pluf_Middleware_Translation',
);
$cfg['read_only_mode_message'] = 'The server is in read only mode the '
.'time to be migrated on another host.'
.'Thank you for your patience.';

You can put HTML in your message.

Summary

Methods
Properties
Constants
process_request()
process_response()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

process_request()

process_request(\Pluf_HTTP_Request  $request) : boolean

Process the request.

Parameters

\Pluf_HTTP_Request $request

Returns

boolean —

false

process_response()

process_response(\Pluf_HTTP_Request  $request, \Pluf_HTTP_Response  $response) : \Pluf_HTTP_Response

Process the response of a view.

If configured, add the message to inform that the website is in read only mode.

Parameters

\Pluf_HTTP_Request $request
\Pluf_HTTP_Response $response

Returns

\Pluf_HTTP_Response

The response