Add PharArchiver support for file compression

Adds support for file extensions tar.gz and tar.bz2 where file
is compressed if used, also use zip compression if possible.

Compression support is not added to zip file as Phar doc explicitly
says it is not supported on file level, and compression would then
have to be exposed differently as it uses same file name.

(cherry picked from commit 79023ddea0920ffd7318d9858b5bf1d94f257e50)