◆ __construct()
ILIAS\Filesystem\Util\Archive\Zip::__construct |
( |
protected ZipOptions |
$options, |
|
|
|
$streams |
|
) |
| |
◆ addPath()
ILIAS\Filesystem\Util\Archive\Zip::addPath |
( |
string |
$path, |
|
|
?string |
$path_inside_zip = null |
|
) |
| |
- Deprecated:
- in general, it should be avoided to operate with correct paths in the file system.
it is also usually not necessary to zip whole directories, as a ZIP can be seen as an "on-the-fly" compilation of different streams. However, since ILIAS still relies on zipping entire directories in many places, this method is still offered for the moment.
Definition at line 147 of file Zip.php.
References ILIAS\Filesystem\Util\Archive\Zip\addStream().
Referenced by ILIAS\Filesystem\Util\Archive\Zip\addStream().
149 $path_inside_zip ??= basename(
$path);
152 $this->zip->addEmptyDir(rtrim(dirname($path_inside_zip),
'/') .
'/');
155 Streams::ofResource(fopen(
$path,
'rb')),
addStream(FileStream $stream, string $path_inside_zip)
◆ addStream()
ILIAS\Filesystem\Util\Archive\Zip::addStream |
( |
FileStream |
$stream, |
|
|
string |
$path_inside_zip |
|
) |
| |
◆ buildTempPath()
ILIAS\Filesystem\Util\Archive\Zip::buildTempPath |
( |
| ) |
|
|
private |
◆ get()
ILIAS\Filesystem\Util\Archive\Zip::get |
( |
| ) |
|
◆ registerShutdownFunction()
ILIAS\Filesystem\Util\Archive\Zip::registerShutdownFunction |
( |
\Closure |
$c | ) |
|
|
private |
◆ storeZIPtoFilesystem()
ILIAS\Filesystem\Util\Archive\Zip::storeZIPtoFilesystem |
( |
| ) |
|
|
private |
Definition at line 99 of file Zip.php.
References $path.
Referenced by ILIAS\Filesystem\Util\Archive\Zip\addStream(), and ILIAS\Filesystem\Util\Archive\Zip\get().
101 foreach ($this->streams as $path_inside_zip => $stream) {
102 $path = $stream->getMetadata(
'uri');
103 if ($this->store_counter === 0) {
104 $this->zip->open($this->zip_output_file);
106 if (is_int($path_inside_zip)) {
107 $path_inside_zip = basename((
string)
$path);
110 if (
$path ===
'php://memory') {
111 $this->zip->addFromString($path_inside_zip, (
string) $stream);
113 } elseif (is_file(
$path)) {
114 $this->zip->addFile(
$path, $path_inside_zip);
121 $this->store_counter === $this->iteration_limit
122 || count(get_resources(
'stream')) > ($this->iteration_limit * 0.9)
125 $this->store_counter = 0;
127 $this->store_counter++;
◆ $iteration_limit
int ILIAS\Filesystem\Util\Archive\Zip::$iteration_limit |
|
private |
◆ $path_counter
int ILIAS\Filesystem\Util\Archive\Zip::$path_counter = 1 |
|
private |
◆ $store_counter
int ILIAS\Filesystem\Util\Archive\Zip::$store_counter = 1 |
|
private |
◆ $streams
array ILIAS\Filesystem\Util\Archive\Zip::$streams |
|
private |
◆ $zip
ZipArchive ILIAS\Filesystem\Util\Archive\Zip::$zip |
|
protected |
◆ $zip_output_file
string ILIAS\Filesystem\Util\Archive\Zip::$zip_output_file = '' |
|
private |
◆ DOT_EMPTY
const ILIAS\Filesystem\Util\Archive\Zip::DOT_EMPTY = '.empty' |
The documentation for this class was generated from the following file:
- components/ILIAS/Filesystem/src/Util/Archive/Zip.php