19declare(strict_types=1);
34 private readonly \ILIAS\Filesystem\Util\Archive\Archives
$archives;
35 private readonly \ILIAS\FileDelivery\Services
$delivery;
40 $this->image_converter =
$DIC->fileConverters()->legacyImages();
41 $this->archives =
$DIC->archives();
42 $this->delivery =
$DIC->fileDelivery();
64 $this->image_converter->convertToFormat(
68 $geometry ===
'' ? null : (
int) $geometry,
69 $geometry ===
'' ? null : (
int) $geometry,
81 public function zipAndDeliver(array $streams,
string $download_filename): void
83 $this->delivery->delivery()->attached(
84 $this->archives->zip($streams)->get(),
89 public function getDir(
string $copyDirectory): array
94 public function unzip(
string $file,
string $zip_output_path,
bool $overwrite):
Unzip
96 return $this->archives->unzip(
97 Streams::ofResource(fopen($file,
'rb')),
98 $this->archives->unzipOptions()
99 ->withOverwrite($overwrite)
100 ->withZipOutputPath($zip_output_path)
101 ->withDirectoryHandling(ZipDirectoryHandling::KEEP_STRUCTURE)
117 bool $raise_errors =
true,
118 string $mode =
'move_uploaded'
131 string $module_path =
"",
132 string $mode =
"output",
133 bool $offline =
false
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Just a wrapper class to create Unit Test for other classes.
getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
zipAndDeliver(array $streams, string $download_filename)
readonly ILIAS Filesystem Util Convert LegacyImages $image_converter
stripSlashes(string $string)
deliverData(string $data, string $fileName, string $mimeType)
convertImage(string $from, string $to, string $geometry='')
getDir(string $copyDirectory)
unzip(string $file, string $zip_output_path, bool $overwrite)
moveUploadedFile(string $file, string $name, string $target, bool $raise_errors=true, string $mode='move_uploaded')
prepareFormOutput(string $string)
readonly ILIAS FileDelivery Services $delivery
readonly ILIAS Filesystem Util Archive Archives $archives
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Util class various functions, usage as namespace.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...