xref: /dokuwiki/lib/plugins/config/core/Setting/SettingSavedir.php (revision d4f83172d9533c4d84f450fe22ef630816b21d75)
10a5b05ebSAndreas Gohr<?php
20a5b05ebSAndreas Gohr
30a5b05ebSAndreas Gohrnamespace dokuwiki\plugin\config\core\Setting;
40a5b05ebSAndreas Gohr
50a5b05ebSAndreas Gohr/**
60a5b05ebSAndreas Gohr * Class setting_savedir
70a5b05ebSAndreas Gohr */
88c7c53b0SAndreas Gohrclass SettingSavedir extends SettingString
98c7c53b0SAndreas Gohr{
100a5b05ebSAndreas Gohr    /** @inheritdoc */
11*d868eb89SAndreas Gohr    public function update($input)
12*d868eb89SAndreas Gohr    {
130a5b05ebSAndreas Gohr        if ($this->isProtected()) return false;
140a5b05ebSAndreas Gohr
150a5b05ebSAndreas Gohr        $value = is_null($this->local) ? $this->default : $this->local;
160a5b05ebSAndreas Gohr        if ($value == $input) return false;
170a5b05ebSAndreas Gohr
180a5b05ebSAndreas Gohr        if (!init_path($input)) {
190a5b05ebSAndreas Gohr            $this->error = true;
200a5b05ebSAndreas Gohr            $this->input = $input;
210a5b05ebSAndreas Gohr            return false;
220a5b05ebSAndreas Gohr        }
230a5b05ebSAndreas Gohr
240a5b05ebSAndreas Gohr        $this->local = $input;
250a5b05ebSAndreas Gohr        return true;
260a5b05ebSAndreas Gohr    }
270a5b05ebSAndreas Gohr}
28