本文整理汇总了PHP中TYPO3\Flow\Persistence\PersistenceManagerInterface::clearState方法的典型用法代码示例。如果您正苦于以下问题:PHP PersistenceManagerInterface::clearState方法的具体用法?PHP PersistenceManagerInterface::clearState怎么用?PHP PersistenceManagerInterface::clearState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Persistence\PersistenceManagerInterface
的用法示例。
在下文中一共展示了PersistenceManagerInterface::clearState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendRequest
/**
* Sends the given HTTP request
*
* @param Http\Request $httpRequest
* @return Http\Response
* @throws Http\Exception
* @api
*/
public function sendRequest(Http\Request $httpRequest)
{
$requestHandler = $this->bootstrap->getActiveRequestHandler();
if (!$requestHandler instanceof FunctionalTestRequestHandler) {
throw new Http\Exception('The browser\'s internal request engine has only been designed for use within functional tests.', 1335523749);
}
$this->securityContext->clearContext();
$this->validatorResolver->reset();
$response = new Http\Response();
$requestHandler->setHttpRequest($httpRequest);
$requestHandler->setHttpResponse($response);
$objectManager = $this->bootstrap->getObjectManager();
$baseComponentChain = $objectManager->get(\TYPO3\Flow\Http\Component\ComponentChain::class);
$componentContext = new ComponentContext($httpRequest, $response);
if (version_compare(PHP_VERSION, '6.0.0') >= 0) {
try {
$baseComponentChain->handle($componentContext);
} catch (\Throwable $throwable) {
$this->prepareErrorResponse($throwable, $response);
}
} else {
try {
$baseComponentChain->handle($componentContext);
} catch (\Exception $exception) {
$this->prepareErrorResponse($exception, $response);
}
}
$session = $this->bootstrap->getObjectManager()->get(\TYPO3\Flow\Session\SessionInterface::class);
if ($session->isStarted()) {
$session->close();
}
$this->persistenceManager->clearState();
return $response;
}
示例2: clearState
/**
* This method is used internal as a callback method to clear doctrine states
*
* @param integer $iteration
* @return void
*/
protected function clearState($iteration)
{
if ($iteration % 1000 === 0) {
$this->persistenceManager->clearState();
}
}