Interchangeable ConfigCache
Blank Lines
Use a common ConfigCacheFactory service
Whitespace fix
Got the whitespace fix wrong :(
Remove service definition and references for config.config_cache_factory altogether, as Router and Translator will still fall back to old behaviour (BC).
Forgot one reference
Remove unused parameters
Move initial cache fill to the ConfigCacheFactory as well.

It is a common pattern for clients of ConfigCache/ConfigCacheFactory to check whether the cache is fresh and if not, fill it. This removes a little bit of repeated code.
Additionally, it gives factory implementations more control over how the cache is written to (for example they can employ other file locking/atomic write strategies).
Basic rework of the ConfigCache and ResourceInterface as outlined in #7176.
Fixups as suggested on GH.
Fix CS violations and scrutinizer feedback
Even more scrutinizer feedback
Renamed the method to comply with CS; it is named like that in Router.php already.
whitespace fix
Use a hash-based approach for detecting changes in directory structures.

That way, we can get consistent results even when files not matching a pattern are added or removed. A change to the directory alone won't change the hash.
The set of resources and their meaning should be opaque for clients of ConfigCache. They never need to deal with it directly, but only carry it to pass it along to a ConfigCache later on. Thus, using array_unique is an optimization only relevant in the cache implementation.
Re-use code we already got
Renamed the two currently available cache implementations
Added abstract base class for factories, plan to use it for a FrameworkBundle specific factory