ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSimpleSAMLphpConfigTemplateHandler Class Reference
+ Collaboration diagram for ilSimpleSAMLphpConfigTemplateHandler:

Public Member Functions

 __construct (private Filesystem $fs)
 
 copy (string $sourcePath, string $destinationPath, array $placeholders=[])
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSimpleSAMLphpConfigTemplateHandler::__construct ( private Filesystem  $fs)

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

26 {
27 }

Member Function Documentation

◆ copy()

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

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

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

References ilFileUtils\getDataDir().

+ Here is the call graph for this function:

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