{
$fdir = is_null($baseDir) ? 'data/links/' . str_replace('.', '_', $file) : commonTools::fixpath($baseDir);
- $tmp = CubeIT_Files::tmpdir();
- $dir = $tmp . '/' . $fdir;
- if (file_exists($dir) && is_file($dir)) {
- unlink($dir);
- }
+ $zipPath = $this->wdir . '/' . $file;
+ $dir = WS_CACHE . '/unzip/' . CubeIT_Files::hashFileAttributes($zipPath);
+
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
- }
- $unzip = new cubeCommandLine('unzip');
- $unzip->setArg(null, $this->wdir . '/' . $file);
- $unzip->setArg('d', $dir);
- $unzip->execute();
-
- if ($moveAssets) {
- `mv $dir/Assets/* $dir`;
- rmdir($dir . '/Assets');
+ CubeIT_Util_Zip::extract($zipPath, $dir);
+ if ($moveAssets) {
+ `mv $dir/Assets/* $dir`;
+ rmdir($dir . '/Assets');
+ }
}
return array('dir' => $dir, 'fdir' => $fdir);