ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSimpleSAMLphpConfigTemplateHandler Class Reference

Class ilSimpleSAMLphpConfigTemplateHandler. More...

+ Collaboration diagram for ilSimpleSAMLphpConfigTemplateHandler:

Public Member Functions

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

Protected Attributes

 $fs
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSimpleSAMLphpConfigTemplateHandler::__construct ( \ILIAS\Filesystem\Filesystem  $fs)

ilSimpleSAMLphpConfigTemplateHandler constructor.

Parameters
\ILIAS\Filesystem\Filesystem$fs

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

References $fs.

Member Function Documentation

◆ copy()

ilSimpleSAMLphpConfigTemplateHandler::copy (   $sourcePath,
  $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 28 of file class.ilSimpleSAMLphpConfigTemplateHandler.php.

References ilUtil\getDataDir().

Referenced by ilSimpleSAMLphpWrapper\initConfigFiles().

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

Field Documentation

◆ $fs

ilSimpleSAMLphpConfigTemplateHandler::$fs
protected

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

Referenced by __construct().


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