45 $this->
logger = $DIC->logger()->mcst();
76 Option $user_selected_option,
80 $download_name =
$input[0];
83 $this->
logger->debug(
"Interaction -> input[0] download name MUST BE FULL PATH=> " . $download_name->getValue());
84 $this->
logger->debug(
"Interaction -> input[1] zip name MUST BE THE NAME WITHOUT EXTENSION. => " . $zip_name->getValue());
86 if ($user_selected_option->
getValue() != self::OPTION_DOWNLOAD) {
87 $this->
logger->info(
'Download canceled');
89 $filesystem =
$DIC->filesystem()->temp();
92 }
catch (\InvalidArgumentException
$e) {
95 if (!is_null(
$path) && $filesystem->has(
$path)) {
96 $filesystem->deleteDir(dirname(
$path));
102 $this->
logger->info(
"Delivering File.");
105 $zip_name = $zip_name->getValue();
107 $ending = substr($zip_name, -4);
108 if ($ending !=
".zip") {
110 $this->
logger->info(
"Add .zip extension");
117 return new ThunkValue();
The legacy path helper provides convenient functions for the integration of the filesystem service wi...
static createRelativePath(string $absolute_path)
Creates a relative path from an absolute path which starts with a valid storage location.
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
Component logger with individual log levels by component id.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.