ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSimpleSAMLphpConfigTemplateHandler Class Reference

Class ilSimpleSAMLphpConfigTemplateHandler. More...

+ Collaboration diagram for ilSimpleSAMLphpConfigTemplateHandler:

Public Member Functions

 __construct (Filesystem $fs)
 ilSimpleSAMLphpConfigTemplateHandler constructor. More...
 
 copy (string $sourcePath, string $destinationPath, array $placeholders=[])
 

Protected Attributes

 $fs
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSimpleSAMLphpConfigTemplateHandler::__construct ( Filesystem  $fs)

Member Function Documentation

◆ copy()

ilSimpleSAMLphpConfigTemplateHandler::copy ( string  $sourcePath,
string  $destinationPath,
array  $placeholders = [] 
)
Parameters
string$sourcePath
string$destinationPath
array$placeholdersA key value map where the key should be the name of a placeholder, and the value is a primitive type or a callable

Definition at line 30 of file class.ilSimpleSAMLphpConfigTemplateHandler.php.

30 : void
31 {
32 if (!$this->fs->has($destinationPath)) {
33 $templateContents = file_get_contents($sourcePath);
34
35 foreach ($placeholders as $placeholder => $value) {
36 if (is_callable($value)) {
37 $value = $value();
38 }
39
40 $templateContents = str_replace('[[' . $placeholder . ']]', $value, $templateContents);
41 }
42
43 // Does not work because of .sec renaming of PHP files
44 //$this->fs->put($destinationPath, $templateContents);
45 file_put_contents(ilUtil::getDataDir() . '/' . $destinationPath, $templateContents);
46 }
47 }
static getDataDir()
get data directory (outside webspace)

References ilUtil\getDataDir().

+ Here is the call graph for this function:

Field Documentation

◆ $fs

ilSimpleSAMLphpConfigTemplateHandler::$fs
protected

Definition at line 14 of file class.ilSimpleSAMLphpConfigTemplateHandler.php.

Referenced by __construct().


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