/** * Gets the supported formats for the archiver * * @return array array of formats mapped to extensions */ public static function SupportedFormats() { $formats = array(); $strategy = new GitPHP_Archive_Tar(); if ($strategy->Valid()) { $formats[GITPHP_COMPRESS_TAR] = $strategy->Extension(); } $strategy = new GitPHP_Archive_Zip(); if ($strategy->Valid()) { $formats[GITPHP_COMPRESS_ZIP] = $strategy->Extension(); } $strategy = new GitPHP_Archive_Bzip2(); if ($strategy->Valid()) { $formats[GITPHP_COMPRESS_BZ2] = $strategy->Extension(); } $strategy = new GitPHP_Archive_Gzip(); if ($strategy->Valid()) { $formats[GITPHP_COMPRESS_GZ] = $strategy->Extension(); } return $formats; }