I agree with Marc B, the main considerations that I think of are:
Deployment environment ... Using Shell connects you to an environment in which shell commands can be executed, and tar is available. Using Phar is nice, because if the extension is installed, you have to be kind. With the shell, you are also tied to Linux unless you include the logic in windows.
In addition, there are security problems ... Although, of course, you can run shell commands from php without introducing vulnerabilities, now this allows attackers to run a command if you do not accidentally clear the data well enough. In addition, tar will die if you run out of free space with someone who knows what, and if you are using Phar, you should get a reasonable error message from php indicating a problem, not just a bad return code.
One of the advantages of the shell is that if you run the command asynchronously and get the stream from stdout, you can track the progress, sort of.
In any case, half a dozen of one, 6 of the other ...
source share