Esempio n. 1
0
 /**
  * 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 !== 'FLOW3_PolicyFiles') {
         return;
     }
     $this->systemLogger->log('The security policies have changed, thus triggering an AOP proxy class rebuild.', LOG_INFO);
     $this->flushCachesByTag(\TYPO3\FLOW3\Cache\CacheManager::getClassTag());
     $this->flushCachesByTag(\TYPO3\FLOW3\Cache\CacheManager::getClassTag('TYPO3\\FLOW3\\Security\\Aspect\\PolicyEnforcementAspect'));
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function getClassTagRendersTagWhichCanBeUsedToTagACacheEntryWithACertainClass()
 {
     $identifier = 'someCacheIdentifier';
     $backend = $this->getMock('TYPO3\\FLOW3\\Cache\\Backend\\AbstractBackend', array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'), array(), '', FALSE);
     $this->getMock('TYPO3\\FLOW3\\Cache\\Frontend\\StringFrontend', array('__construct', 'get', 'set', 'has', 'remove', 'getByTag'), array($identifier, $backend));
     $this->assertEquals('%CLASS%TYPO3_Foo_Bar_Baz', \TYPO3\FLOW3\Cache\CacheManager::getClassTag('TYPO3\\Foo\\Bar\\Baz'));
 }