MDL-37658 add new logging API with basic implemenation
[moodle.git] / admin / tool / log / store / database / settings.php
CommitLineData
7eaca5a8
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 * External database log store settings.
19 *
20 * @package logstore_database
21 * @copyright 2013 Petr Skoda {@link http://skodak.org}
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24
25defined('MOODLE_INTERNAL') || die();
26
27if ($hassiteconfig) {
28 $options = array(
29 '' => get_string('choose'),
30 'native/mysqli' => moodle_database::get_driver_instance('mysqli', 'native')->get_name(),
31 'native/mariadb'=> moodle_database::get_driver_instance('mariadb', 'native')->get_name(),
32 'native/pgsql' => moodle_database::get_driver_instance('pgsql', 'native')->get_name(),
33 'native/oci' => moodle_database::get_driver_instance('oci', 'native')->get_name(),
34 'native/sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native')->get_name(),
35 'native/mssql' => moodle_database::get_driver_instance('mssql', 'native')->get_name(),
36 );
37
38 // TODO: Localise these settings.
39
40 $settings->add(new admin_setting_configselect('logstore_database/dbdriver', 'dbdriver', '', '', $options));
41
42 $settings->add(new admin_setting_configtext('logstore_database/dbhost', 'dbhost', '', ''));
43 $settings->add(new admin_setting_configtext('logstore_database/dbuser', 'dbuser', '', ''));
44 $settings->add(new admin_setting_configtext('logstore_database/dbpass', 'dbpass', '', ''));
45 $settings->add(new admin_setting_configtext('logstore_database/dbname', 'dbname', '', ''));
46 $settings->add(new admin_setting_configtext('logstore_database/dbname', 'dbprefix', '', ''));
47
48 $settings->add(new admin_setting_configcheckbox('logstore_database/dbpersist', 'dbpersist', '', '0'));
49 $settings->add(new admin_setting_configtext('logstore_database/dbsocket', 'dbsocket', '', ''));
50 $settings->add(new admin_setting_configtext('logstore_database/dbport', 'dbport', '', ''));
51 $settings->add(new admin_setting_configtext('logstore_database/dbschema', 'dbschema', '', ''));
52 $settings->add(new admin_setting_configtext('logstore_database/dbcollation', 'dbcollation', '', ''));
53
54}