19declare(strict_types=1);
45 if (
null === $logger) {
62 $userCertificate = $userCertificateRepository->fetchActiveCertificate($userId, $objectId);
64 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId .
'/' . $objectId;
65 if (
false === $this->
filesystem->hasDir($dirPath)) {
71 $pdfScalar = $pdfGenerator->generate($userCertificate->getId());
78 $this->
filesystem->write($completePath, $pdfScalar);
89 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId .
'/' . $objectId;
92 $completePath = $dirPath .
'/' . $fileName;
96 $userCertificate = $userCertificateRepository->fetchActiveCertificateForPresentation($userId, $objectId);
112 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId;
114 if (
true === $this->
filesystem->hasDir($dirPath)) {
127 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId;
144 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId .
'/' . $objectId .
'/';
146 $completePath = $dirPath . $fileName;
151 throw new ilException(sprintf(
'Certificate File does not exist in "%s"', $completePath));
Class FileAlreadyExistsException.
Class FileNotFoundException.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
static getValidFilename(string $a_filename)
Component logger with individual log levels by component id.
const CERTIFICATE_FILENAME
deleteUserDirectory(int $userId)
const PERSISTENT_CERTIFICATES_DIRECTORY
createCertificateFile(int $userId, int $objectId)
__construct(?Filesystem $filesystem=null, ?ilLogger $logger=null)
deleteCertificateFile(int $userId, int $objectId)
createCertificateFilePath(int $userId, int $objectId)
deliverCertificate(int $userId, int $objectId)
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
Class ilPdfGeneratorConstantsTest.