ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References ilUtil\getDataDir().

Referenced by ilSimpleSAMLphpWrapper\initConfigFiles().

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)
+ 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 14 of file class.ilSimpleSAMLphpConfigTemplateHandler.php.

Referenced by __construct().


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