/** * Makes sure that the AOP proxies are rebuilt if a policy has changed. * * Note: This is not an advice but a method which is used as a slot for a signal * sent by the system file monitor defined in the bootstrap scripts. * * @param string $fileMonitorIdentifier Identifier of the File Monitor * @param array $changedFiles A list of full paths to changed files * @return void */ public function triggerAopProxyRebuildingByChangedFiles($fileMonitorIdentifier, array $changedFiles) { if ($fileMonitorIdentifier !== 'Flow_PolicyFiles') { return; } $this->systemLogger->log('The security policies have changed, thus triggering an AOP proxy class rebuild.', LOG_INFO); $this->flushCachesByTag(\TYPO3\Flow\Cache\CacheManager::getClassTag()); $this->flushCachesByTag(\TYPO3\Flow\Cache\CacheManager::getClassTag('TYPO3\\Flow\\Security\\Aspect\\PolicyEnforcementAspect')); }
/** * @test */ public function getClassTagRendersTagWhichCanBeUsedToTagACacheEntryWithACertainClass() { $identifier = 'someCacheIdentifier'; $backend = $this->getMock(\TYPO3\Flow\Cache\Backend\AbstractBackend::class, array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'), array(), '', false); $this->getMock(\TYPO3\Flow\Cache\Frontend\StringFrontend::class, array('__construct', 'get', 'set', 'has', 'remove', 'getByTag'), array($identifier, $backend)); $this->assertEquals('%CLASS%TYPO3_Foo_Bar_Baz', \TYPO3\Flow\Cache\CacheManager::getClassTag('TYPO3\\Foo\\Bar\\Baz')); }
/** * @test */ public function getClassTagRendersTagWhichCanBeUsedToTagACacheEntryWithACertainClass() { $this->assertEquals('%CLASS%TYPO3_Foo_Bar_Baz', \TYPO3\Flow\Cache\CacheManager::getClassTag('TYPO3\\Foo\\Bar\\Baz')); }