/** @var FilesystemFactory $factory */
$factory =
$this->container->
get('filesystem.factory'
);
$localFilesytem =
$factory->
createLocalFilesystem();
$remoteFilesystem =
$factory->
createLocalFilesystem();
/** @var PathBuilder $pathBuilder */
$pathBuilder =
$this->container->
get('path.builder'
);
$debug = false;
$step =
new UnpackStep($localFilesytem,
$remoteFilesystem,
$pathBuilder,
$debug);
$offset = 0;
$total = 0;
do { $result =
$step->
run($offset,
$total);
if ($result instanceof ErrorResult
) { throw new Exception($result->
getMessage(), 0,
$result->
getException());
} $offset =
$result->
getOffset();
$total =
$result->
getTotal();
} while ($result instanceof ValidResult
);
}