I see there is not a built-in way to copy dirs in PHP. I saw Copy entire contents of a directory to another using php but I could not find any issue with system('cp -R src dest')
.
Is there an issue with using the above system
call? I assume the only "problem" is it will create one extra process for a fraction of a second. Right?
I will clarify, in this scenario, I do not develop an off-the-shelf product that has to be platform independent, nor the src
or dest
are coming from user input, they are 100% clean. Only problem I see (as was pointed out below) is error handling.