File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515use Wirecli \Helpers \Installer ;
1616use Wirecli \Helpers \PwConnector ;
1717use Wirecli \Helpers \WsTools as Tools ;
18+ use ZipArchive ;
1819
1920/**
2021 * Class NewCommand
@@ -650,8 +651,15 @@ private function extractProfile($profile) {
650651
651652 try {
652653 $ extractPath = sys_get_temp_dir () . DIRECTORY_SEPARATOR . uniqid (time ()) . DIRECTORY_SEPARATOR ;
653- // TODO: use Symfony ZipArchive class
654- //$extractionSucceeded = $distill->extractWithoutRootDirectory($profile, $extractPath);
654+ $ this ->fs ->mkdir ($ extractPath );
655+
656+ $ zip = new ZipArchive ;
657+ $ extractionSucceeded = false ;
658+
659+ if ($ zip ->open ($ profile ) === TRUE ) {
660+ $ extractionSucceeded = $ zip ->extractTo ($ extractPath );
661+ $ zip ->close ();
662+ }
655663
656664 foreach (new \DirectoryIterator ($ extractPath ) as $ fileInfo ) {
657665 if ($ fileInfo ->isDir () && !$ fileInfo ->isDot ()) {
You can’t perform that action at this time.
0 commit comments