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
29
29
*/
30
30
public function extract (\SplFileInfo $ archive , \SplFileInfo $ destination )
31
31
{
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
+
37
42
return true ;
38
43
}
39
44
You can’t perform that action at this time.
0 commit comments