mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-06-26 06:29:24 +02:00
API Substitute Zend_Locale with Locale / NumberFormatter API Substitute Zend_Date with IntlDateFormatter API Added DBTIme::Nice12, FormatFromSettings API Added Short() method to DBDate / DBTime / DBDatetime API Add Date::getTimestamp() API Added setSubmittedValue api for FormField API Add second arg to base FormField::setValue() API Major refactor of i18n into component data parts API Implement Resettable interface to reset objects between tests ENHANCEMENT Changed DBField::create_field return type to `static` to support better type hinting ENHANCEMENT i18nTextCollector supports __CLASS__
49 lines
1.0 KiB
PHP
49 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace SilverStripe\Control;
|
|
|
|
use SilverStripe\Core\Flushable;
|
|
use SilverStripe\ORM\DataModel;
|
|
use SilverStripe\Core\ClassInfo;
|
|
|
|
/**
|
|
* Triggers a call to flush() on all implementors of Flushable.
|
|
*/
|
|
class FlushRequestFilter implements RequestFilter
|
|
{
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*
|
|
* @param HTTPRequest $request
|
|
* @param Session $session
|
|
* @param DataModel $model
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function preRequest(HTTPRequest $request, Session $session, DataModel $model)
|
|
{
|
|
if (array_key_exists('flush', $request->getVars())) {
|
|
foreach (ClassInfo::implementorsOf(Flushable::class) as $class) {
|
|
$class::flush();
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*
|
|
* @param HTTPRequest $request
|
|
* @param HTTPResponse $response
|
|
* @param DataModel $model
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function postRequest(HTTPRequest $request, HTTPResponse $response, DataModel $model)
|
|
{
|
|
return true;
|
|
}
|
|
}
|