ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References ilFileUtils\getDataDir().

Referenced by ilSimpleSAMLphpWrapper\initConfigFiles().

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)
+ 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: