ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilCertificateUtilHelper Class Reference

Just a wrapper class to create Unit Test for other classes. More...

+ Collaboration diagram for ilCertificateUtilHelper:

Public Member Functions

 __construct ()
 
 deliverData (string $data, string $fileName, string $mimeType)
 
 prepareFormOutput (string $string)
 
 convertImage (string $from, string $to, string $geometry='')
 
 stripSlashes (string $string)
 
 zipAndDeliver (array $streams, string $download_filename)
 
 getDir (string $copyDirectory)
 
 unzip (string $file, string $zip_output_path, bool $overwrite)
 
 delDir (string $path)
 
 moveUploadedFile (string $file, string $name, string $target, bool $raise_errors=true, string $mode='move_uploaded')
 
 getImagePath (string $img, string $module_path="", string $mode="output", bool $offline=false)
 

Private Attributes

readonly ILIAS Filesystem Util Convert LegacyImages $image_converter
 
readonly ILIAS Filesystem Util Archive Archives $archives
 
readonly ILIAS FileDelivery Services $delivery
 

Detailed Description

Just a wrapper class to create Unit Test for other classes.

Can be remove when the static method calls have been removed

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 31 of file ilCertificateUtilHelper.php.

Constructor & Destructor Documentation

◆ __construct()

ilCertificateUtilHelper::__construct ( )

Definition at line 37 of file ilCertificateUtilHelper.php.

References $DIC.

38  {
39  global $DIC;
40  $this->image_converter = $DIC->fileConverters()->legacyImages();
41  $this->archives = $DIC->archives();
42  $this->delivery = $DIC->fileDelivery();
43  }
global $DIC
Definition: shib_login.php:26

Member Function Documentation

◆ convertImage()

ilCertificateUtilHelper::convertImage ( string  $from,
string  $to,
string  $geometry = '' 
)

Definition at line 59 of file ilCertificateUtilHelper.php.

References null.

63  : void {
64  $this->image_converter->convertToFormat(
65  $from,
66  $to,
67  ImageOutputOptions::FORMAT_JPG,
68  $geometry === '' ? null : (int) $geometry,
69  $geometry === '' ? null : (int) $geometry,
70  );
71  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ delDir()

ilCertificateUtilHelper::delDir ( string  $path)

Definition at line 105 of file ilCertificateUtilHelper.php.

References ilFileUtils\delDir().

105  : void
106  {
108  }
$path
Definition: ltiservices.php:29
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ deliverData()

ilCertificateUtilHelper::deliverData ( string  $data,
string  $fileName,
string  $mimeType 
)

Definition at line 45 of file ilCertificateUtilHelper.php.

References ilUtil\deliverData().

45  : void
46  {
48  $data,
49  $fileName,
50  $mimeType
51  );
52  }
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
+ Here is the call graph for this function:

◆ getDir()

ilCertificateUtilHelper::getDir ( string  $copyDirectory)

Definition at line 89 of file ilCertificateUtilHelper.php.

References ilFileUtils\getDir().

89  : array
90  {
91  return ilFileUtils::getDir($copyDirectory);
92  }
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
+ Here is the call graph for this function:

◆ getImagePath()

ilCertificateUtilHelper::getImagePath ( string  $img,
string  $module_path = "",
string  $mode = "output",
bool  $offline = false 
)

Definition at line 129 of file ilCertificateUtilHelper.php.

References ilUtil\getImagePath().

134  : string {
135  return ilUtil::getImagePath(
136  $img,
137  $module_path,
138  $mode,
139  $offline
140  );
141  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ moveUploadedFile()

ilCertificateUtilHelper::moveUploadedFile ( string  $file,
string  $name,
string  $target,
bool  $raise_errors = true,
string  $mode = 'move_uploaded' 
)
Exceptions
ilException

Definition at line 113 of file ilCertificateUtilHelper.php.

References ilFileUtils\moveUploadedFile().

119  : bool {
121  $file,
122  $name,
123  $target,
124  $raise_errors,
125  $mode
126  );
127  }
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
+ Here is the call graph for this function:

◆ prepareFormOutput()

ilCertificateUtilHelper::prepareFormOutput ( string  $string)

Definition at line 54 of file ilCertificateUtilHelper.php.

References ilLegacyFormElementsUtil\prepareFormOutput().

54  : string
55  {
57  }
static prepareFormOutput($a_str, bool $a_strip=false)
+ Here is the call graph for this function:

◆ stripSlashes()

ilCertificateUtilHelper::stripSlashes ( string  $string)

Definition at line 73 of file ilCertificateUtilHelper.php.

References ilUtil\stripSlashes().

73  : string
74  {
75  return ilUtil::stripSlashes($string);
76  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

◆ unzip()

ilCertificateUtilHelper::unzip ( string  $file,
string  $zip_output_path,
bool  $overwrite 
)

Definition at line 94 of file ilCertificateUtilHelper.php.

94  : Unzip
95  {
96  return $this->archives->unzip(
97  Streams::ofResource(fopen($file, 'rb')),
98  $this->archives->unzipOptions()
99  ->withOverwrite($overwrite)
100  ->withZipOutputPath($zip_output_path)
101  ->withDirectoryHandling(ZipDirectoryHandling::KEEP_STRUCTURE)
102  );
103  }

◆ zipAndDeliver()

ilCertificateUtilHelper::zipAndDeliver ( array  $streams,
string  $download_filename 
)
Parameters
list<Streams>$streams

Definition at line 81 of file ilCertificateUtilHelper.php.

81  : void
82  {
83  $this->delivery->delivery()->attached(
84  $this->archives->zip($streams)->get(),
85  $download_filename
86  );
87  }

Field Documentation

◆ $archives

readonly ILIAS Filesystem Util Archive Archives ilCertificateUtilHelper::$archives
private

Definition at line 34 of file ilCertificateUtilHelper.php.

◆ $delivery

readonly ILIAS FileDelivery Services ilCertificateUtilHelper::$delivery
private

Definition at line 35 of file ilCertificateUtilHelper.php.

◆ $image_converter

readonly ILIAS Filesystem Util Convert LegacyImages ilCertificateUtilHelper::$image_converter
private

Definition at line 33 of file ilCertificateUtilHelper.php.


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