classes/phing/tasks/ext/UntarTask.php
private function initTar(PhingFile $tarfile)
    {
        $compression = null;
        $tarfileName = $tarfile->getName();
        $mode = strtolower(substr($tarfileName, strrpos($tarfileName, '.')));

        $compressions = [
            'gz' => ['.gz', '.tgz',],
            'bz2' => ['.bz2',],
        ];
        foreach ($compressions as $algo => $ext) {
            if (in_array($mode, $ext)) {
                $compression = $algo;
                break;
            }
        }

        return new Archive_Tar($tarfile->getAbsolutePath(), $compression);
    }
private function initTar(PhingFile $tarfile)
    {
        $compression = null;
        $tarfileName = $tarfile->getName();
        $mode = strtolower(substr($tarfileName, strrpos($tarfileName, '.')));

        $compressions = [
            'gz' => ['.gz', '.tgz',],
            'bz2' => ['.bz2',],
        ];
        foreach ($compressions as $algo => $ext) {
            if (in_array($mode, $ext)) {
                $compression = $algo;
                break;
            }
        }

        return new Archive_Tar($tarfile->getAbsolutePath(), $compression);
    }
private function initTar ( PhingFile $ tarfile ) { $ compression = null ; $ tarfileName = $ tarfile -> getName ( ) ; $ mode = strtolower ( substr ( $ tarfileName , strrpos ( $ tarfileName , '.' ) ) ) ; $ compressions = [ 'gz' => [ '.gz' , '.tgz' , ] , 'bz2' => [ '.bz2' , ] , ] ; foreach ( $ compressions as $ algo => $ ext ) { if ( in_array ( $ mode , $ ext ) ) { $ compression = $ algo ; break ; } } return new Archive_Tar ( $ tarfile -> getAbsolutePath ( ) , $ compression ) ; }
Init a Archive_Tar class with correct compression for the given file.

@param  PhingFile $tarfile
@return Archive_Tar the tar class instance
Init a Archive_Tar class with correct compression for the given file .