Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
 
18
declare(strict_types=1);
19
 
20
namespace mod_edusharing;
21
 
22
use dml_exception;
23
 
24
/**
25
 * Class DefaultAppConfig
26
 *
27
 * This is the standard implementation of the AppConfig interface.
28
 * It merely wraps moodle standard functions.
29
 *
30
 * @author Marian Ziegler <ziegler@edu-sharing.net>
31
 * @package mod_edusharing
32
 */
33
class DefaultAppConfig implements AppConfig {
34
    /**
35
     * Function set
36
     *
37
     * Sets an edusharing specific config value
38
     *
39
     * @param string $name
40
     * @param mixed $value
41
     * @return void
42
     */
43
    public function set(string $name, mixed $value): void {
44
        set_config($name, $value, 'edusharing');
45
    }
46
 
47
    /**
48
     * Function get
49
     *
50
     * gets an edusharing specific config value
51
     *
52
     * @param string $name
53
     * @return mixed
54
     * @throws dml_exception
55
     */
56
    public function get(string $name): mixed {
57
        return get_config('edusharing', $name);
58
    }
59
}