The PHP File System library provides a set of useful and robust filesystem abstractions that you can quickly drop into your own project to save you time and effort.
Add this to your composer.json
file:
{% highlight json %} { "require": { "ganbarodigital/php-file-system": "^1.0" } } {% endhighlight %}
and then run composer update
.