Consider using the Filesystem Symfony component
javiereguiluz opened this issue · comments
Please note: I don't know if this is aligned with the goals of this library, so please ignore this issue at will :)
I was reviewing the new extractWithoutRootDirectory()
method and I found this line of code that renames the directory using the PHP rename()
function.
However, if you take a look at the rename() method of the Filesystem component you'll see that usually you have to make some additional checks, you have to silence PHP errors/warnings and you have to throw appropriate exceptions when an error occurs.
So this issue is just a proposal to use Fileystem Symfony component (or any other similar PHP component or library) for this low level file operations.
Yeah, I have been trying to use as less dependencies as possible, but if the library starts doing operations with the filesystem, I agree that it should use a third-party library. I plan to make a couple more methods that will operate with the filesystem, so it makes even more sense. Thanks for the suggestion!
@javiereguiluz v0.7.1 now uses the Filesystem component, much more clean!