ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Filesystem\Util\Archive\Archives Class Reference
+ Collaboration diagram for ILIAS\Filesystem\Util\Archive\Archives:

Public Member Functions

 __construct ()
 
 zip (array $file_streams, ?ZipOptions $zip_options=null)
 
 unzip (FileStream $zip, ?UnzipOptions $unzip_options=null)
 
 unzipOptions ()
 
 zipOptions ()
 

Protected Member Functions

 mergeZipOptions (?ZipOptions $zip_options)
 
 mergeUnzipOptions (?UnzipOptions $unzip_options)
 

Private Attributes

ZipOptions $zip_options
 
UnzipOptions $unzip_options
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

@description This class is used to create a zip archive from a list of file-streams. In most cases this will be used inside other Services such as the Filesystem Service or the IRSS.

Definition at line 32 of file Archives.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Filesystem\Util\Archive\Archives::__construct ( )

Definition at line 39 of file Archives.php.

40 {
41 $this->zip_options = $this->zipOptions();
42 $this->unzip_options = $this->unzipOptions();
43 }

References ILIAS\Filesystem\Util\Archive\Archives\unzipOptions(), and ILIAS\Filesystem\Util\Archive\Archives\zipOptions().

+ Here is the call graph for this function:

Member Function Documentation

◆ mergeUnzipOptions()

ILIAS\Filesystem\Util\Archive\Archives::mergeUnzipOptions ( ?UnzipOptions  $unzip_options)
protected

Definition at line 86 of file Archives.php.

87 {
88 if (null === $unzip_options) {
90 }
91 if ($unzip_options->getZipOutputPath() !== null) {
92 $this->unzip_options = $this->unzip_options->withZipOutputPath($unzip_options->getZipOutputPath());
93 }
94
95 return $this->unzip_options
96 ->withOverwrite($unzip_options->isOverwrite())
97 ->withDirectoryHandling($unzip_options->getDirectoryHandling());
98 }
withZipOutputPath(string $zip_output_path)

References ILIAS\Filesystem\Util\Archive\Archives\$unzip_options, ILIAS\Filesystem\Util\Archive\Options\getDirectoryHandling(), ILIAS\Filesystem\Util\Archive\UnzipOptions\getZipOutputPath(), ILIAS\Filesystem\Util\Archive\UnzipOptions\isOverwrite(), and ILIAS\Filesystem\Util\Archive\UnzipOptions\withZipOutputPath().

Referenced by ILIAS\Filesystem\Util\Archive\Archives\unzip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mergeZipOptions()

ILIAS\Filesystem\Util\Archive\Archives::mergeZipOptions ( ?ZipOptions  $zip_options)
protected

◆ unzip()

ILIAS\Filesystem\Util\Archive\Archives::unzip ( FileStream  $zip,
?UnzipOptions  $unzip_options = null 
)

Definition at line 57 of file Archives.php.

57 : Unzip
58 {
59 return new Unzip(
61 $zip
62 );
63 }
mergeUnzipOptions(?UnzipOptions $unzip_options)
Definition: Archives.php:86

References ILIAS\Filesystem\Util\Archive\Archives\mergeUnzipOptions().

+ Here is the call graph for this function:

◆ unzipOptions()

ILIAS\Filesystem\Util\Archive\Archives::unzipOptions ( )

Definition at line 65 of file Archives.php.

66 {
67 return new UnzipOptions();
68 }

Referenced by ILIAS\Filesystem\Util\Archive\Archives\__construct().

+ Here is the caller graph for this function:

◆ zip()

ILIAS\Filesystem\Util\Archive\Archives::zip ( array  $file_streams,
?ZipOptions  $zip_options = null 
)

Definition at line 45 of file Archives.php.

45 : Zip
46 {
47 if (empty($file_streams)) {
48 $file_streams = [Zip::DOT_EMPTY => Streams::ofString('')];
49 }
50
51 return new Zip(
53 ...$file_streams
54 );
55 }
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
mergeZipOptions(?ZipOptions $zip_options)
Definition: Archives.php:75

References ILIAS\Filesystem\Util\Archive\Zip\DOT_EMPTY, ILIAS\Filesystem\Util\Archive\Archives\mergeZipOptions(), and ILIAS\Filesystem\Stream\Streams\ofString().

+ Here is the call graph for this function:

◆ zipOptions()

ILIAS\Filesystem\Util\Archive\Archives::zipOptions ( )

Definition at line 70 of file Archives.php.

71 {
72 return new ZipOptions();
73 }

Referenced by ILIAS\Filesystem\Util\Archive\Archives\__construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $unzip_options

UnzipOptions ILIAS\Filesystem\Util\Archive\Archives::$unzip_options
private

◆ $zip_options

ZipOptions ILIAS\Filesystem\Util\Archive\Archives::$zip_options
private

Definition at line 36 of file Archives.php.

Referenced by ILIAS\Filesystem\Util\Archive\Archives\mergeZipOptions().


The documentation for this class was generated from the following file: