Use the extractTo function from PharData.
$source is the .gz archive file you want to unzip and $destDir the directory you want to extract them to.
$phar = new PharData($source);
$phar->extractTo($destDir,null,true); // extract all files, overwrites existing files