silverstripe-framework/control/FlushRequestFilter.php
Simon Welsh 73b591a79d Correct regression around ?flush
?flush used to work. There's no reason why it shouldn't.
2014-10-30 20:51:05 +11:00

25 lines
561 B
PHP

<?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) {
if(array_key_exists('flush', $request->getVars())) {
foreach(ClassInfo::implementorsOf('Flushable') as $class) {
$class::flush();
}
}
return true;
}
public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model) {
return true;
}
}