ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSimpleSAMLphpConfigTemplateHandler Class Reference

Class ilSimpleSAMLphpConfigTemplateHandler. More...

+ Collaboration diagram for ilSimpleSAMLphpConfigTemplateHandler:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSimpleSAMLphpConfigTemplateHandler::__construct ( private readonly Filesystem  $fs)

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

30  {
31  }

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 36 of file class.ilSimpleSAMLphpConfigTemplateHandler.php.

References ilFileUtils\getDataDir().

Referenced by ilSimpleSAMLphpWrapper\initConfigFiles().

36  : void
37  {
38  if (!$this->fs->has($destinationPath)) {
39  $templateContents = file_get_contents($sourcePath);
40 
41  foreach ($placeholders as $placeholder => $value) {
42  if (is_callable($value)) {
43  $value = $value();
44  }
45 
46  $templateContents = str_replace('[[' . $placeholder . ']]', $value, $templateContents);
47  }
48 
49  // Does not work because of .sec renaming of PHP files
50  //$this->fs->put($destinationPath, $templateContents);
51  file_put_contents(ilFileUtils::getDataDir() . '/' . $destinationPath, $templateContents);
52  }
53  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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