2012-05-09 14:26:29 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A request filter is an object that's executed before and after a
|
|
|
|
* request occurs. By returning 'false' from the preRequest method,
|
|
|
|
* request execution will be stopped from continuing
|
|
|
|
*
|
|
|
|
* @author marcus@silverstripe.com.au
|
|
|
|
* @license BSD License http://silverstripe.org/bsd-license/
|
2013-11-29 05:12:47 +01:00
|
|
|
* @package framework
|
|
|
|
* @subpackage control
|
2012-05-09 14:26:29 +02:00
|
|
|
*/
|
|
|
|
interface RequestFilter {
|
2014-03-04 05:43:17 +01:00
|
|
|
|
2012-05-09 14:26:29 +02:00
|
|
|
/**
|
|
|
|
* Filter executed before a request processes
|
|
|
|
*
|
2014-03-04 05:43:17 +01:00
|
|
|
* @param SS_HTTPRequest $request Request container object
|
|
|
|
* @param Session $session Request session
|
|
|
|
* @param DataModel $model Current DataModel
|
|
|
|
* @return boolean Whether to continue processing other filters. Null or true will continue processing (optional)
|
2012-05-09 14:26:29 +02:00
|
|
|
*/
|
|
|
|
public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Filter executed AFTER a request
|
2014-03-04 05:43:17 +01:00
|
|
|
*
|
|
|
|
* @param SS_HTTPRequest $request Request container object
|
|
|
|
* @param SS_HTTPResponse $response Response output object
|
|
|
|
* @param DataModel $model Current DataModel
|
|
|
|
* @return boolean Whether to continue processing other filters. Null or true will continue processing (optional)
|
2012-05-09 14:26:29 +02:00
|
|
|
*/
|
|
|
|
public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model);
|
2014-03-04 05:43:17 +01:00
|
|
|
}
|