This can help to decompress the data from tar archive in certain cases, hope this helps somebody
<?php
$tarName = 'example.ini';
try {
/** For files with tar.gz extensions **/
$phar = new \PharData($path, 0, $tarName);
} catch ($e) {
/** Decode the file first **/
$decodedFile = file_put_contents($path, gzdecode(file_get_contents($path)));
/** create PharData object second **/
$phar = new \PharData($path, 0, $tarName);
}
?>