[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
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 * Helper class locally used. 19 * 20 * @package logstore_database 21 * @copyright 2014 onwards Ankit Agarwal 22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 */ 24 25 namespace logstore_database; 26 defined('MOODLE_INTERNAL') || die(); 27 28 29 /** 30 * Helper class locally used. 31 * 32 * @copyright 2014 onwards Ankit Agarwal 33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 34 */ 35 class helper { 36 /** 37 * Returns list of fully working database drivers present in system. 38 * @return array 39 */ 40 public static function get_drivers() { 41 return array( 42 '' => get_string('choosedots'), 43 'native/mysqli' => \moodle_database::get_driver_instance('mysqli', 'native')->get_name(), 44 'native/mariadb' => \moodle_database::get_driver_instance('mariadb', 'native')->get_name(), 45 'native/pgsql' => \moodle_database::get_driver_instance('pgsql', 'native')->get_name(), 46 'native/oci' => \moodle_database::get_driver_instance('oci', 'native')->get_name(), 47 'native/sqlsrv' => \moodle_database::get_driver_instance('sqlsrv', 'native')->get_name(), 48 'native/mssql' => \moodle_database::get_driver_instance('mssql', 'native')->get_name() 49 ); 50 } 51 52 /** 53 * Get a list of edu levels. 54 * 55 * @return array 56 */ 57 public static function get_level_options() { 58 return array( 59 \core\event\base::LEVEL_TEACHING => get_string('teaching', 'logstore_database'), 60 \core\event\base::LEVEL_PARTICIPATING => get_string('participating', 'logstore_database'), 61 \core\event\base::LEVEL_OTHER => get_string('other', 'logstore_database'), 62 ); 63 } 64 65 /** 66 * Get a list of database actions. 67 * 68 * @return array 69 */ 70 public static function get_action_options() { 71 return array( 72 'c' => get_string('create', 'logstore_database'), 73 'r' => get_string('read', 'logstore_database'), 74 'u' => get_string('update', 'logstore_database'), 75 'd' => get_string('delete') 76 ); 77 } 78 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |