19declare(strict_types=1);
32 private readonly
int $objectId,
33 private readonly
string $certificatePath,
35 private readonly
string $installationId =
IL_INST_ID
42 if (
'crs' === $iliasType) {
44 } elseif (
'tst' === $iliasType) {
46 } elseif (
'exc' === $iliasType) {
48 } elseif (
'sahs' === $iliasType) {
58 $certificateId = $this->objectId;
60 $directory = $this->webDirectory . $this->certificatePath . time() .
61 '__' . $this->installationId .
'__' . $type .
'__' . $certificateId .
'__certificate/';
76 fwrite($fh, $pdfdata);
78 $this->files_added_to_archive =
true;
86 if (!$this->files_added_to_archive) {
87 throw new IOException(
'No files added to archive directory');
91 ) .
'__' . $this->installationId .
'__' . $this->typeInFileName .
'__' . $this->objectId .
'__certificates.zip';
92 $zipFilePath = $this->webDirectory . $this->certificatePath . $zipFile;
Indicates general problems with the input or output operations.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static zip(string $a_dir, string $a_file, bool $compress_content=false)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static _lookupType(int $id, bool $reference=false)
readonly string $typeInFileName
addPDFtoArchiveDirectory(string $pdfdata, string $dir, string $filename)
Adds PDF data as a file to a given directory.
__construct(private readonly int $objectId, private readonly string $certificatePath, private readonly string $webDirectory=CLIENT_WEB_DIR, private readonly string $installationId=IL_INST_ID)
zipCertificatesInArchiveDirectory(string $dir, bool $deliver=true)
bool $files_added_to_archive