File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,16 @@ class TarGzExtractor implements ExtractorInterface
2929 */
3030 public function extract (\SplFileInfo $ archive , \SplFileInfo $ destination )
3131 {
32- $ targz = new \PharData ($ archive ->getPathname ());
33- /** @var \PharData $tar */
34- $ tar = $ targz ->decompress ();
35- $ tar ->extractTo ($ destination ->getPathname ());
36- unlink (str_replace ('.tar.gz ' , '.tar ' , $ archive ->getPathname ()));
32+ if (preg_match ('/^win/i ' , PHP_OS )) {
33+ $ targz = new \PharData ($ archive ->getPathname ());
34+ /** @var \PharData $tar */
35+ $ tar = $ targz ->decompress ();
36+ $ tar ->extractTo ($ destination ->getPathname ());
37+ unlink (str_replace ('.tar.gz ' , '.tar ' , $ archive ->getPathname ()));
38+ } else {
39+ exec ('tar xzf ' . $ archive ->getPathname () . ' -C ' . $ destination ->getPathname ());
40+ }
41+
3742 return true ;
3843 }
3944
You can’t perform that action at this time.
0 commit comments