ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
classs.ilCertificateBackgroundImageDelete.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
9
14
18 private $fileService;
19
25 {
26 $this->certificatePath = $certificatePath;
27 $this->fileService = $fileService;
28 }
29
30 public function deleteBackgroundImage(string $version)
31 {
32 if (file_exists($this->fileService->getBackgroundImageThumbPath())) {
33 unlink($this->fileService->getBackgroundImageThumbPath());
34 }
35
36 $filename = $this->certificatePath . 'background_' . $version . '.jpg';
37 if (file_exists($filename)) {
38 unlink($filename);
39 }
40
41 if (file_exists($this->fileService->getBackgroundImageTempfilePath())) {
42 unlink($this->fileService->getBackgroundImageTempfilePath());
43 }
44 }
45}
$filename
Definition: buildRTE.php:89
An exception for terminatinating execution or to throw for unit testing.
__construct(string $certificatePath, ilCertificateBackgroundImageFileService $fileService)