ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

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.

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

40  {
41  $this->zip_options = $this->zipOptions();
42  $this->unzip_options = $this->unzipOptions();
43  }
+ 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.

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(), null, and ILIAS\Filesystem\Util\Archive\UnzipOptions\withZipOutputPath().

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

86  : UnzipOptions
87  {
88  if (null === $unzip_options) {
89  return $this->unzip_options;
90  }
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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withZipOutputPath(string $zip_output_path)
+ 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

Definition at line 75 of file Archives.php.

References ILIAS\Filesystem\Util\Archive\Archives\$zip_options, ILIAS\Filesystem\Util\Archive\Options\getDirectoryHandling(), ILIAS\Filesystem\Util\Archive\ZipOptions\getZipOutputName(), ILIAS\Filesystem\Util\Archive\ZipOptions\getZipOutputPath(), null, and ILIAS\Filesystem\Util\Archive\ZipOptions\withZipOutputName().

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

75  : ZipOptions
76  {
77  if (null === $zip_options) {
78  return $this->zip_options;
79  }
80  return $this->zip_options
82  ->withZipOutputPath($zip_options->getZipOutputPath())
83  ->withDirectoryHandling($zip_options->getDirectoryHandling());
84  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withZipOutputName(string $zip_output_name)
Definition: ZipOptions.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unzip()

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

Definition at line 57 of file Archives.php.

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

57  : Unzip
58  {
59  return new Unzip(
61  $zip
62  );
63  }
mergeUnzipOptions(?UnzipOptions $unzip_options)
Definition: Archives.php:86
+ Here is the call graph for this function:

◆ unzipOptions()

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

Definition at line 65 of file Archives.php.

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

65  : UnzipOptions
66  {
67  return new UnzipOptions();
68  }
+ 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.

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

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  }
mergeZipOptions(?ZipOptions $zip_options)
Definition: Archives.php:75
+ Here is the call graph for this function:

◆ zipOptions()

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

Definition at line 70 of file Archives.php.

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

70  : ZipOptions
71  {
72  return new ZipOptions();
73  }
+ 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: