unzip.

@param mixed $source
@param mixed $destination
351564
public function unzip($source, $destination)
    {
        @mkdir($destination, 0777, true);

        foreach ((array) glob($source.'/*.zip') as $key => $value) {
            if ($this->zip->open(str_replace('//', '/', $value)) === true) {
                $this->zip->extractTo($destination);
                echo $this->ZipStatusString($this->zip);
                $this->zip->close();
            }
        }
    }
1153268
public function copy(TemporaryFile $source, string $destination): bool
    {
        $readStream = $source->readStream();

        if (realpath($destination)) {
            $tempStream = fopen($destination, 'rb+');
            $success    = stream_copy_to_stream($readStream, $tempStream) !== false;

            if (is_resource($tempStream)) {
                fclose($tempStream);
            }
        } else {
            $success = $this->put($destination, $readStream);
        }

        if (is_resource($readStream)) {
            fclose($readStream);
        }

        return $success;
    }
364790
protected function unzipPHP($zipFile, $destinationDirectory, array $options)
    {
        if (!class_exists('ZipArchive')) {
            throw new Exception('Unable to unzip files using ZipArchive. Please ensure the Zip extension is installed.');
        }
        $zip = new ZipArchive();
        try {
            $flags = 0;
            if (!$options['skipCheck']) {
                $flags |= ZipArchive::CHECKCONS;
            }
            $zipErr = @$zip->open($zipFile, $flags);
            if ($zipErr !== true) {
                throw new Exception($this->describeZipArchiveError($zip, $zipErr));
            }
            if (@$zip->extractTo($destinationDirectory) !== true) {
                throw new Exception($this->describeZipArchiveError($zip, ZipArchive::ER_OK));
            }
            @$zip->close();
            $zip = null;
        } catch (Exception $x) {
            if ($zip !== null) {
                try {
                    @$zip->close();
                } catch (\Exception $foo) {
                }
                $zip = null;
            }
            throw $x;
        }
    }
761230
public function moveFiles(Filesystem $source, Filesystem $destination): void
    {
        foreach ($source->listContents() as $path) {
            if ($path['type'] === 'file') {
                $destination->put($path['path'], $source->read($path['path']));
                $source->delete($path['path']);

                if ($this->timeout_service->isTimeNearlyUp()) {
                    throw new InternalServerErrorException(I18N::translate('The server’s time limit has been reached.'));
                }
            }
        }
    }
1328964
public static function zip($source, $destination) {
		if(!extension_loaded('zip') || !file_exists($source))
			return false;

		$zip = new \ZipArchive();
		if(!$zip->open($destination, \ZIPARCHIVE::CREATE))
			return false;

		$source = str_replace('\\', '/', realpath($source));

		if(is_dir($source)) {
			$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source), \RecursiveIteratorIterator::SELF_FIRST);

			foreach($files as $file) {
				$file = str_replace('\\', '/', realpath($file));

				if(is_dir($file))
					$zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
				elseif(is_file($file))
					$zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
			}
		}
		elseif(is_file($source))
			$zip->addFromString(basename($source), file_get_contents($source));

		return $zip->close();
	}
906420
public function uncompress($source, $target)
    {
        $bz = @bzopen($source, 'r');
        $fh = @fopen($target, 'wb');

        if ($fh === false || $bz === false) {
            return false;
        }

        while (!feof($bz)) {
            if (fwrite($fh, bzread($bz, 1024)) === false) {
                return false;
            }
        }

        fclose($fh);
        bzclose($bz);

        return true;
    }
554446
public function extract($archive, $destination)
	{
		$this->data = null;
		$this->metadata = null;

		$this->data = file_get_contents($archive);

		if (!$this->data)
		{
			throw new \RuntimeException('Unable to read archive');
		}

		$this->getTarInfo($this->data);

		for ($i = 0, $n = count($this->metadata); $i < $n; $i++)
		{
			$type = strtolower($this->metadata[$i]['type']);

			if ($type == 'file' || $type == 'unix file')
			{
				$buffer = $this->metadata[$i]['data'];
				$path = Path::clean($destination . '/' . $this->metadata[$i]['name']);

				// Make sure the destination folder exists
				if (!Folder::create(dirname($path)))
				{
					throw new \RuntimeException('Unable to create destination');
				}

				if (File::write($path, $buffer) === false)
				{
					throw new \RuntimeException('Unable to write entry');
				}
			}
		}

		return true;
	}
288722
public function unzip($file, $path)
    {
        if (ends_with($file, '.zip')) {
            $this->message("Unzipping to {$file}");

            $this->unzipFile($file, $path);
        }
    }
713755
public static function unZip($zip_file, $destination)
    {
        $zip = new \ZipArchive();
        $archive = $zip->open($zip_file);

        if ($archive === true) {
            Folder::create($destination);

            $unzip = $zip->extractTo($destination);


            if (!$unzip) {
                self::$error = self::ZIP_EXTRACT_ERROR;
                Folder::delete($destination);
                $zip->close();
                return false;
            }

            $package_folder_name = preg_replace('#\./$#', '', $zip->getNameIndex(0));
            $zip->close();

            return $destination . '/' . $package_folder_name;
        }

        self::$error = self::ZIP_EXTRACT_ERROR;
        self::$error_zip = $archive;
        return false;
    }
458873
public function copy($source, $destination = null)
    {
        if ($destination === null) {
            $destination = basename($source);
        }

        $this->toCopy[] = array($source, $destination);

        return $this;
    }
959821
private function copyThenRemove($source, $target)
    {
        if (!is_dir($source)) {
            copy($source, $target);
            $this->unlink($source);

            return;
        }

        $it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
        $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
        $this->ensureDirectoryExists($target);

        foreach ($ri as $file) {
            $targetPath = $target.DIRECTORY_SEPARATOR.$ri->getSubPathName();
            if ($file->isDir()) {
                $this->ensureDirectoryExists($targetPath);
            } else {
                copy($file->getPathname(), $targetPath);
            }
        }

        $this->removeDirectoryPhp($source);
    }
849631
private function extract(string $sourceFile, string $destinationDir): self
    {
        $p = new \PharData($sourceFile);
        $p->extractTo($destinationDir);

        return $this;
    }
146982
public function moveFile($source, $destination)
    {
        @rename($source, $destination);

        if (!$this->isFileExist($destination)) {
            throw new EbayEnterprise_Catalog_Exception_Feed_File("Can not move $source to $destination");
        }
    }
154259
public static List<String> unzip(final File zipFile, final String destination) {
    return unzip(zipFile, destination, null);
  }
1055572
def uncompress_files(original, destination):
    
    with zipfile.ZipFile(original) as zips:
        extract_path = os.path.join(destination)
        zips.extractall(extract_path)
1220028
public function move($target, $source)
    {
        $this->copy($target, $source);

        $this->delete($target);
    }
217332
public function copy($source, $destination)
    {
        $contents = $this('file', $source)->getContent();

        $template = $this->engine->compile($contents);
        $code = $template($this->schema);
        $code = str_replace('\\\\', '\\', $code);
        $code = str_replace('\}', '}', $code);
        $code = str_replace('\{', '{', $code);
        $code = str_replace('{ ', '{', $code);
		$code = preg_replace('/\n\s*\n\s*\n/', "\n\n", $code);

        Index::info('Installing to' . $destination);

        $this('file', $destination)->setContent($code);

        return $this;
    }