ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSimpleSAMLphpConfigTemplateHandler.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
12 protected $fs;
13
19 {
20 $this->fs = $fs;
21 }
22
28 public function copy($sourcePath, $destinationPath, array $placeholders = [])
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 }
46}
An exception for terminatinating execution or to throw for unit testing.
__construct(\ILIAS\Filesystem\Filesystem $fs)
ilSimpleSAMLphpConfigTemplateHandler constructor.
copy($sourcePath, $destinationPath, array $placeholders=[])
static getDataDir()
get data directory (outside webspace)
Class FlySystemFileAccessTest.
Class BaseForm.