ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Filesystem\Util\Archive\UnzipOptions Class Reference
+ Inheritance diagram for ILIAS\Filesystem\Util\Archive\UnzipOptions:
+ Collaboration diagram for ILIAS\Filesystem\Util\Archive\UnzipOptions:

Public Member Functions

 getZipOutputPath ()
 
 withZipOutputPath (string $zip_output_path)
 
 isOverwrite ()
 
 withOverwrite (bool $overwrite)
 
 getMaxCompressionRatio ()
 
 withMaxCompressionRatio (int $max_compression_ratio)
 
 getRatioCheckMinUncompressedSize ()
 
 withRatioCheckMinUncompressedSize (int $ratio_check_min_uncompressed_size)
 
 getMaxAmountOfEntries ()
 
 withMaxAmountOfEntries (int $max_amount_of_entries)
 
 getMaxUncompressedSize ()
 
 withMaxUncompressedSize (int $max_uncompressed_size)
 
- Public Member Functions inherited from ILIAS\Filesystem\Util\Archive\Options
 getIgnoredPathSnippets ()
 @description like __MACOSX, will filter out all paths which contain one of those snippets More...
 
 withDirectoryHandling (ZipDirectoryHandling $top_dir_handling)
 
 getDirectoryHandling ()
 

Data Fields

const UNLIMITED = 0
 @description Disables a numeric limit (ratio, entry-count or size). More...
 
const DEFAULT_MAX_COMPRESSION_RATIO = 100
 @description Reject archives whose overall uncompressed/compressed ratio exceeds this value. More...
 
const DEFAULT_RATIO_CHECK_MIN_UNCOMPRESSED_SIZE = 33554432
 @description The ratio check is only applied once the total uncompressed size exceeds this floor, so small but highly compressible archives are never rejected. More...
 
const DEFAULT_MAX_AMOUNT_OF_ENTRIES = 100000
 @description Reject archives with more than this many entries (entry-count bomb). More...
 
const DEFAULT_MAX_UNCOMPRESSED_SIZE = 4294967296
 @description Reject archives whose total uncompressed size exceeds this value. More...
 

Protected Attributes

string $zip_output_path = null
 
- Protected Attributes inherited from ILIAS\Filesystem\Util\Archive\Options
ZipDirectoryHandling $top_directory_handling = ZipDirectoryHandling::KEEP_STRUCTURE
 

Private Attributes

bool $flat = false
 
bool $overwrite = false
 
int $max_compression_ratio = self::DEFAULT_MAX_COMPRESSION_RATIO
 
int $ratio_check_min_uncompressed_size = self::DEFAULT_RATIO_CHECK_MIN_UNCOMPRESSED_SIZE
 
int $max_amount_of_entries = self::DEFAULT_MAX_AMOUNT_OF_ENTRIES
 
int $max_uncompressed_size = self::DEFAULT_MAX_UNCOMPRESSED_SIZE
 

Detailed Description

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

Definition at line 26 of file UnzipOptions.php.

Member Function Documentation

◆ getMaxAmountOfEntries()

ILIAS\Filesystem\Util\Archive\UnzipOptions::getMaxAmountOfEntries ( )

Definition at line 116 of file UnzipOptions.php.

116 : int
117 {
119 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$max_amount_of_entries.

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

+ Here is the caller graph for this function:

◆ getMaxCompressionRatio()

ILIAS\Filesystem\Util\Archive\UnzipOptions::getMaxCompressionRatio ( )

Definition at line 92 of file UnzipOptions.php.

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$max_compression_ratio.

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

+ Here is the caller graph for this function:

◆ getMaxUncompressedSize()

ILIAS\Filesystem\Util\Archive\UnzipOptions::getMaxUncompressedSize ( )

Definition at line 128 of file UnzipOptions.php.

128 : int
129 {
131 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$max_uncompressed_size.

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

+ Here is the caller graph for this function:

◆ getRatioCheckMinUncompressedSize()

ILIAS\Filesystem\Util\Archive\UnzipOptions::getRatioCheckMinUncompressedSize ( )

◆ getZipOutputPath()

ILIAS\Filesystem\Util\Archive\UnzipOptions::getZipOutputPath ( )

Definition at line 68 of file UnzipOptions.php.

68 : ?string
69 {
71 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$zip_output_path.

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

+ Here is the caller graph for this function:

◆ isOverwrite()

ILIAS\Filesystem\Util\Archive\UnzipOptions::isOverwrite ( )

Definition at line 80 of file UnzipOptions.php.

80 : bool
81 {
82 return $this->overwrite;
83 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$overwrite.

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

+ Here is the caller graph for this function:

◆ withMaxAmountOfEntries()

ILIAS\Filesystem\Util\Archive\UnzipOptions::withMaxAmountOfEntries ( int  $max_amount_of_entries)

Definition at line 121 of file UnzipOptions.php.

121 : self
122 {
123 $clone = clone $this;
124 $clone->max_amount_of_entries = max(self::UNLIMITED, $max_amount_of_entries);
125 return $clone;
126 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$max_amount_of_entries.

◆ withMaxCompressionRatio()

ILIAS\Filesystem\Util\Archive\UnzipOptions::withMaxCompressionRatio ( int  $max_compression_ratio)

Definition at line 97 of file UnzipOptions.php.

97 : self
98 {
99 $clone = clone $this;
100 $clone->max_compression_ratio = max(self::UNLIMITED, $max_compression_ratio);
101 return $clone;
102 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$max_compression_ratio.

◆ withMaxUncompressedSize()

ILIAS\Filesystem\Util\Archive\UnzipOptions::withMaxUncompressedSize ( int  $max_uncompressed_size)

Definition at line 133 of file UnzipOptions.php.

133 : self
134 {
135 $clone = clone $this;
136 $clone->max_uncompressed_size = max(self::UNLIMITED, $max_uncompressed_size);
137 return $clone;
138 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$max_uncompressed_size.

◆ withOverwrite()

ILIAS\Filesystem\Util\Archive\UnzipOptions::withOverwrite ( bool  $overwrite)

Definition at line 85 of file UnzipOptions.php.

85 : self
86 {
87 $clone = clone $this;
88 $clone->overwrite = $overwrite;
89 return $clone;
90 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$overwrite.

◆ withRatioCheckMinUncompressedSize()

ILIAS\Filesystem\Util\Archive\UnzipOptions::withRatioCheckMinUncompressedSize ( int  $ratio_check_min_uncompressed_size)

Definition at line 109 of file UnzipOptions.php.

109 : self
110 {
111 $clone = clone $this;
112 $clone->ratio_check_min_uncompressed_size = max(0, $ratio_check_min_uncompressed_size);
113 return $clone;
114 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$ratio_check_min_uncompressed_size.

◆ withZipOutputPath()

ILIAS\Filesystem\Util\Archive\UnzipOptions::withZipOutputPath ( string  $zip_output_path)

Definition at line 73 of file UnzipOptions.php.

73 : self
74 {
75 $clone = clone $this;
76 $clone->zip_output_path = $zip_output_path;
77 return $clone;
78 }

References ILIAS\Filesystem\Util\Archive\UnzipOptions\$zip_output_path.

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

+ Here is the caller graph for this function:

Field Documentation

◆ $flat

bool ILIAS\Filesystem\Util\Archive\UnzipOptions::$flat = false
private

Definition at line 61 of file UnzipOptions.php.

◆ $max_amount_of_entries

int ILIAS\Filesystem\Util\Archive\UnzipOptions::$max_amount_of_entries = self::DEFAULT_MAX_AMOUNT_OF_ENTRIES
private

◆ $max_compression_ratio

int ILIAS\Filesystem\Util\Archive\UnzipOptions::$max_compression_ratio = self::DEFAULT_MAX_COMPRESSION_RATIO
private

◆ $max_uncompressed_size

int ILIAS\Filesystem\Util\Archive\UnzipOptions::$max_uncompressed_size = self::DEFAULT_MAX_UNCOMPRESSED_SIZE
private

◆ $overwrite

bool ILIAS\Filesystem\Util\Archive\UnzipOptions::$overwrite = false
private

◆ $ratio_check_min_uncompressed_size

int ILIAS\Filesystem\Util\Archive\UnzipOptions::$ratio_check_min_uncompressed_size = self::DEFAULT_RATIO_CHECK_MIN_UNCOMPRESSED_SIZE
private

◆ $zip_output_path

string ILIAS\Filesystem\Util\Archive\UnzipOptions::$zip_output_path = null
protected

◆ DEFAULT_MAX_AMOUNT_OF_ENTRIES

const ILIAS\Filesystem\Util\Archive\UnzipOptions::DEFAULT_MAX_AMOUNT_OF_ENTRIES = 100000

@description Reject archives with more than this many entries (entry-count bomb).

Definition at line 49 of file UnzipOptions.php.

◆ DEFAULT_MAX_COMPRESSION_RATIO

const ILIAS\Filesystem\Util\Archive\UnzipOptions::DEFAULT_MAX_COMPRESSION_RATIO = 100

@description Reject archives whose overall uncompressed/compressed ratio exceeds this value.

A deflate decompression bomb reaches ~1000:1, while legitimate archives (already compressed media, office documents, ...) stay well below 100:1.

Definition at line 38 of file UnzipOptions.php.

◆ DEFAULT_MAX_UNCOMPRESSED_SIZE

const ILIAS\Filesystem\Util\Archive\UnzipOptions::DEFAULT_MAX_UNCOMPRESSED_SIZE = 4294967296

@description Reject archives whose total uncompressed size exceeds this value.

Without an absolute ceiling the ratio alone allows DEFAULT_MAX_COMPRESSION_RATIO times the upload limit to be written, which grows with post_max_size. 4 GiB is the point where an archive requires Zip64; legitimate ILIAS imports stay well below it. Installations that really do import larger archives can raise or disable the limit per call.

Definition at line 58 of file UnzipOptions.php.

◆ DEFAULT_RATIO_CHECK_MIN_UNCOMPRESSED_SIZE

const ILIAS\Filesystem\Util\Archive\UnzipOptions::DEFAULT_RATIO_CHECK_MIN_UNCOMPRESSED_SIZE = 33554432

@description The ratio check is only applied once the total uncompressed size exceeds this floor, so small but highly compressible archives are never rejected.

Definition at line 44 of file UnzipOptions.php.

◆ UNLIMITED

const ILIAS\Filesystem\Util\Archive\UnzipOptions::UNLIMITED = 0

@description Disables a numeric limit (ratio, entry-count or size).

A value of 0 means "no limit".

Definition at line 31 of file UnzipOptions.php.

Referenced by ILIAS\Filesystem\Util\Archive\Unzip\calculateIsWithinLimits().


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