2014-08-16 02:51:17 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Triggers a call to flush() on all implementors of Flushable.
|
|
|
|
*
|
|
|
|
* @package framework
|
|
|
|
* @subpackage control
|
|
|
|
*/
|
|
|
|
class FlushRequestFilter implements RequestFilter {
|
|
|
|
|
|
|
|
public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) {
|
2014-10-30 10:51:05 +01:00
|
|
|
if(array_key_exists('flush', $request->getVars())) {
|
2014-08-16 02:51:17 +02:00
|
|
|
foreach(ClassInfo::implementorsOf('Flushable') as $class) {
|
|
|
|
$class::flush();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2015-09-28 11:21:08 +02:00
|
|
|
}
|
2014-08-16 02:51:17 +02:00
|
|
|
|
|
|
|
public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|