zeitounator/ezpublish — comment on commit 39d62493760e22fbc2ee0d5abe904b7d80408ee5
File:  line 0
By glye:

Ok, I see your point, but the eZFile class is still the wrong place for cache specific code. It's not just about CacheDir either, there are other cases where for example the CacheDir is a relative path, but one or more specific caches are absolute paths. That is, they exist outside of CacheDir.

So to do it cleanly, we could add a parameter that is an array of paths, which are to be considered as valid paths in the root check. It would be the responsibility of the code that calls eZFile::recursiveDelete() to pass the correct paths. So for example eZCache::clearItem() would pass CacheDir, if and only if it is absolute.