It would be neat if you could utilize the Gaufrette library for filesystem abstraction. https://github.com/KnpLabs/Gaufrette