19 declare(strict_types=1);
40 if (null === $filesystem) {
41 $filesystem = $DIC->filesystem()->storage();
45 if (null === $logger) {
46 $logger = $DIC->logger()->root();
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());
73 $completePath = $dirPath .
'/' . $objectId .
'_' . self::CERTIFICATE_FILENAME;
78 $this->
filesystem->write($completePath, $pdfScalar);
89 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId .
'/' . $objectId;
90 $fileName = $objectId .
'_' . self::CERTIFICATE_FILENAME;
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;
129 $completePath = $dirPath .
'/' . $objectId .
'_' . self::CERTIFICATE_FILENAME;
144 $dirPath = self::PERSISTENT_CERTIFICATES_DIRECTORY . $userId .
'/' . $objectId .
'/';
145 $fileName = $objectId .
'_' . self::CERTIFICATE_FILENAME;
146 $completePath = $dirPath . $fileName;
151 throw new ilException(sprintf(
'Certificate File does not exist in "%s"', $completePath));
__construct(?Filesystem $filesystem=null, ?ilLogger $logger=null)
Class ilPdfGeneratorConstantsTest.
deleteCertificateFile(int $userId, int $objectId)
deliverCertificate(int $userId, int $objectId)
static getValidFilename(string $a_filename)
const CERTIFICATE_FILENAME
const PERSISTENT_CERTIFICATES_DIRECTORY
deleteUserDirectory(int $userId)
createCertificateFile(int $userId, int $objectId)
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
createCertificateFilePath(int $userId, int $objectId)
Class FlySystemFileAccessTest disabled disabled disabled.