ILIAS  release_8 Revision v8.19
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)
 
 copy (string $sourcePath, string $destinationPath, array $placeholders=[])
 

Protected Attributes

Filesystem $fs
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSimpleSAMLphpConfigTemplateHandler::__construct ( Filesystem  $fs)

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

References $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 is the name of a placeholder, and the value is a primitive type or a callable

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

References ilFileUtils\getDataDir().

Referenced by ilSimpleSAMLphpWrapper\initConfigFiles().

41  : void
42  {
43  if (!$this->fs->has($destinationPath)) {
44  $templateContents = file_get_contents($sourcePath);
45 
46  foreach ($placeholders as $placeholder => $value) {
47  if (is_callable($value)) {
48  $value = $value();
49  }
50 
51  $templateContents = str_replace('[[' . $placeholder . ']]', $value, $templateContents);
52  }
53 
54  // Does not work because of .sec renaming of PHP files
55  //$this->fs->put($destinationPath, $templateContents);
56  file_put_contents(ilFileUtils::getDataDir() . '/' . $destinationPath, $templateContents);
57  }
58  }
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

Filesystem ilSimpleSAMLphpConfigTemplateHandler::$fs
protected

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

Referenced by __construct().


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