ILIAS  release_8 Revision v8.24
ilRenderedImage Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilRenderedImage:

Public Member Functions

 __construct (string $img_path, bool $is_temporary=true)
 Constructor. More...
 
 getImagePath ()
 Gets the absolute path to the rendered image. More...
 
 isTemporary ()
 Defines whether the image is temporary and can be deleted after the preview was created. More...
 
 delete ()
 Deletes the image file if it is temporary. More...
 

Private Attributes

string $img_path = null
 The absolute path to the image. More...
 
bool $is_temporary = true
 Defines whether the image is temporary and can be deleted after the preview was created from the image. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Represents an image that was created from a preview renderer and that can be further processed to create the preview.

Author
Stefan Born stefa.nosp@m.n.bo.nosp@m.rn@ph.nosp@m.zh.c.nosp@m.h
Version
$Id$

Definition at line 27 of file class.ilRenderedImage.php.

Constructor & Destructor Documentation

◆ __construct()

ilRenderedImage::__construct ( string  $img_path,
bool  $is_temporary = true 
)

Constructor.

Parameters
string$img_pathThe absolute path to the image.
bool$is_temporaryDefines whether the image is temporary and can be deleted after the preview was created.

Definition at line 46 of file class.ilRenderedImage.php.

47 {
48 $this->img_path = $img_path;
49 $this->is_temporary = $is_temporary;
50 }
bool $is_temporary
Defines whether the image is temporary and can be deleted after the preview was created from the imag...
string $img_path
The absolute path to the image.

References $img_path, and $is_temporary.

Member Function Documentation

◆ delete()

ilRenderedImage::delete ( )

Deletes the image file if it is temporary.

Definition at line 75 of file class.ilRenderedImage.php.

75 : void
76 {
77 // only delete if not temporary
78 if ($this->isTemporary() && is_file($this->getImagePath())) {
79 @unlink($this->getImagePath());
80 }
81 }
getImagePath()
Gets the absolute path to the rendered image.
isTemporary()
Defines whether the image is temporary and can be deleted after the preview was created.

References getImagePath(), and isTemporary().

+ Here is the call graph for this function:

◆ getImagePath()

ilRenderedImage::getImagePath ( )

Gets the absolute path to the rendered image.

Returns
string The absolute path to the rendered image.

Definition at line 57 of file class.ilRenderedImage.php.

57 : ?string
58 {
59 return $this->img_path;
60 }

References $img_path.

Referenced by delete().

+ Here is the caller graph for this function:

◆ isTemporary()

ilRenderedImage::isTemporary ( )

Defines whether the image is temporary and can be deleted after the preview was created.

Returns
bool true, if the image is temporary and can be deleted after the preview was created; otherwise, false.

Definition at line 67 of file class.ilRenderedImage.php.

67 : bool
68 {
70 }

References $is_temporary.

Referenced by delete().

+ Here is the caller graph for this function:

Field Documentation

◆ $img_path

string ilRenderedImage::$img_path = null
private

The absolute path to the image.

Definition at line 32 of file class.ilRenderedImage.php.

Referenced by __construct(), and getImagePath().

◆ $is_temporary

bool ilRenderedImage::$is_temporary = true
private

Defines whether the image is temporary and can be deleted after the preview was created from the image.

Definition at line 38 of file class.ilRenderedImage.php.

Referenced by __construct(), and isTemporary().


The documentation for this class was generated from the following file: