1 | <?php |
||
8 | class Writer { |
||
9 | /** @var string header info */ |
||
10 | protected $header = 'Dokuwiki\'s Main Configuration File - Local Settings'; |
||
11 | |||
12 | /** @var string the file where the config will be saved to */ |
||
13 | protected $savefile; |
||
14 | |||
15 | /** |
||
16 | * Writer constructor. |
||
17 | */ |
||
18 | public function __construct() { |
||
22 | |||
23 | /** |
||
24 | * Save the given settings |
||
25 | * |
||
26 | * @param Setting[] $settings |
||
27 | * @throws \Exception |
||
28 | */ |
||
29 | public function save($settings) { |
||
54 | |||
55 | /** |
||
56 | * Update last modified time stamp of the config file |
||
57 | * |
||
58 | * Will invalidate all DokuWiki caches |
||
59 | * |
||
60 | * @throws \Exception when the config isn't writable |
||
61 | */ |
||
62 | public function touch() { |
||
67 | |||
68 | /** |
||
69 | * Configuration is considered locked if there is no local settings filename |
||
70 | * or the directory its in is not writable or the file exists and is not writable |
||
71 | * |
||
72 | * @return bool true: locked, false: writable |
||
73 | */ |
||
74 | public function isLocked() { |
||
80 | |||
81 | /** |
||
82 | * Returns the PHP intro header for the config file |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | protected function getHeader() { |
||
102 | } |
||
103 |
If you suppress an error, we recommend checking for the error condition explicitly: