protected function flushConfigurationCachesByChangedFiles(array $changedFiles): void
    {
        $aopProxyClassRebuildIsNeeded = false;
        $aopProxyClassInfluencers = '/(?:Policy|Objects|Settings)(?:\..*)*\.yaml/';

        $objectClassesCache = $this->getCache('Flow_Object_Classes');
        $objectConfigurationCache = $this->getCache('Flow_Object_Configuration');
        $caches = [
            '/Policy\.yaml/' => ['Flow_Security_Authorization_Privilege_Method', 'Flow_Persistence_Doctrine', 'Flow_Persistence_Doctrine_Results', 'Flow_Aop_RuntimeExpressions'],
            '/Routes([^\/]*)\.yaml/' => ['Flow_Mvc_Routing_Route', 'Flow_Mvc_Routing_Resolve'],
            '/Views\.yaml/' => ['Flow_Mvc_ViewConfigurations']
        ];
        $cachesToFlush = [];
        foreach (array_keys($changedFiles) as $pathAndFilename) {
            foreach ($caches as $cacheFilePattern => $cacheNames) {
                if (preg_match($aopProxyClassInfluencers, $pathAndFilename) === 1) {
                    $aopProxyClassRebuildIsNeeded = true;
                }
                if (preg_match($cacheFilePattern, $pathAndFilename) !== 1) {
                    continue;
                }
                foreach ($caches[$cacheFilePattern] as $cacheName) {
                    $cachesToFlush[$cacheName] = $cacheFilePattern;
                }
            }
        }

        foreach ($cachesToFlush as $cacheName => $cacheFilePattern) {
            $this->logger->info(sprintf('A configuration file matching the pattern "%s" has been changed, flushing related cache "%s"', $cacheFilePattern, $cacheName), LogEnvironment::fromMethodName(__METHOD__));
            $this->getCache($cacheName)->flush();
        }

        $this->logger->info('A configuration file has been changed, refreshing compiled configuration cache', LogEnvironment::fromMethodName(__METHOD__));
        $this->configurationManager->refreshConfiguration();

        if ($aopProxyClassRebuildIsNeeded) {
            $this->logger->info('The configuration has changed, triggering an AOP proxy class rebuild.', LogEnvironment::fromMethodName(__METHOD__));
            $objectConfigurationCache->remove('allAspectClassesUpToDate');
            $objectConfigurationCache->remove('allCompiledCodeUpToDate');
            $objectClassesCache->flush();
        }
    }
protected function flushConfigurationCachesByChangedFiles(array $changedFiles): void
    {
        $aopProxyClassRebuildIsNeeded = false;
        $aopProxyClassInfluencers = '/(?:Policy|Objects|Settings)(?:\..*)*\.yaml/';

        $objectClassesCache = $this->getCache('Flow_Object_Classes');
        $objectConfigurationCache = $this->getCache('Flow_Object_Configuration');
        $caches = [
            '/Policy\.yaml/' => ['Flow_Security_Authorization_Privilege_Method', 'Flow_Persistence_Doctrine', 'Flow_Persistence_Doctrine_Results', 'Flow_Aop_RuntimeExpressions'],
            '/Routes([^\/]*)\.yaml/' => ['Flow_Mvc_Routing_Route', 'Flow_Mvc_Routing_Resolve'],
            '/Views\.yaml/' => ['Flow_Mvc_ViewConfigurations']
        ];
        $cachesToFlush = [];
        foreach (array_keys($changedFiles) as $pathAndFilename) {
            foreach ($caches as $cacheFilePattern => $cacheNames) {
                if (preg_match($aopProxyClassInfluencers, $pathAndFilename) === 1) {
                    $aopProxyClassRebuildIsNeeded = true;
                }
                if (preg_match($cacheFilePattern, $pathAndFilename) !== 1) {
                    continue;
                }
                foreach ($caches[$cacheFilePattern] as $cacheName) {
                    $cachesToFlush[$cacheName] = $cacheFilePattern;
                }
            }
        }

        foreach ($cachesToFlush as $cacheName => $cacheFilePattern) {
            $this->logger->info(sprintf('A configuration file matching the pattern "%s" has been changed, flushing related cache "%s"', $cacheFilePattern, $cacheName), LogEnvironment::fromMethodName(__METHOD__));
            $this->getCache($cacheName)->flush();
        }

        $this->logger->info('A configuration file has been changed, refreshing compiled configuration cache', LogEnvironment::fromMethodName(__METHOD__));
        $this->configurationManager->refreshConfiguration();

        if ($aopProxyClassRebuildIsNeeded) {
            $this->logger->info('The configuration has changed, triggering an AOP proxy class rebuild.', LogEnvironment::fromMethodName(__METHOD__));
            $objectConfigurationCache->remove('allAspectClassesUpToDate');
            $objectConfigurationCache->remove('allCompiledCodeUpToDate');
            $objectClassesCache->flush();
        }
    }
protected function flushConfigurationCachesByChangedFiles ( array $ changedFiles ) : void { $ aopProxyClassRebuildIsNeeded = false ; $ aopProxyClassInfluencers = '/(?:Policy|Objects|Settings)(?:\..*)*\.yaml/' ; $ objectClassesCache = $ this -> getCache ( 'Flow_Object_Classes' ) ; $ objectConfigurationCache = $ this -> getCache ( 'Flow_Object_Configuration' ) ; $ caches = [ '/Policy\.yaml/' => [ 'Flow_Security_Authorization_Privilege_Method' , 'Flow_Persistence_Doctrine' , 'Flow_Persistence_Doctrine_Results' , 'Flow_Aop_RuntimeExpressions' ] , '/Routes([^\/]*)\.yaml/' => [ 'Flow_Mvc_Routing_Route' , 'Flow_Mvc_Routing_Resolve' ] , '/Views\.yaml/' => [ 'Flow_Mvc_ViewConfigurations' ] ] ; $ cachesToFlush = [ ] ; foreach ( array_keys ( $ changedFiles ) as $ pathAndFilename ) { foreach ( $ caches as $ cacheFilePattern => $ cacheNames ) { if ( preg_match ( $ aopProxyClassInfluencers , $ pathAndFilename ) === 1 ) { $ aopProxyClassRebuildIsNeeded = true ; } if ( preg_match ( $ cacheFilePattern , $ pathAndFilename ) !== 1 ) { continue ; } foreach ( $ caches [ $ cacheFilePattern ] as $ cacheName ) { $ cachesToFlush [ $ cacheName ] = $ cacheFilePattern ; } } } foreach ( $ cachesToFlush as $ cacheName => $ cacheFilePattern ) { $ this -> logger -> info ( sprintf ( 'A configuration file matching the pattern "%s" has been changed, flushing related cache "%s"' , $ cacheFilePattern , $ cacheName ) , LogEnvironment :: fromMethodName ( __METHOD__ ) ) ; $ this -> getCache ( $ cacheName ) -> flush ( ) ; } $ this -> logger -> info ( 'A configuration file has been changed, refreshing compiled configuration cache' , LogEnvironment :: fromMethodName ( __METHOD__ ) ) ; $ this -> configurationManager -> refreshConfiguration ( ) ; if ( $ aopProxyClassRebuildIsNeeded ) { $ this -> logger -> info ( 'The configuration has changed, triggering an AOP proxy class rebuild.' , LogEnvironment :: fromMethodName ( __METHOD__ ) ) ; $ objectConfigurationCache -> remove ( 'allAspectClassesUpToDate' ) ; $ objectConfigurationCache -> remove ( 'allCompiledCodeUpToDate' ) ; $ objectClassesCache -> flush ( ) ; } }
Flushes caches as needed if settings, routes or policies have changed

@param array $changedFiles A list of full paths to changed files
@return void
@see flushSystemCachesByChangedFiles()
Flushes caches as needed if settings routes or policies have changed