Merge branch 'MDL-77433-master' of https://github.com/ferranrecio/moodle
[moodle.git] / lib / dml / auroramysql_native_moodle_database.php
blob3000913847ace91a6758e0fc7403a5cb3af7ad36
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.
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/>.
17 /**
18 * Native Aurora MySQL class representing moodle database interface.
20 * @package core_dml
21 * @copyright 2020 Lafayette College ITS
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 defined('MOODLE_INTERNAL') || die();
27 require_once(__DIR__.'/moodle_database.php');
28 require_once(__DIR__.'/mysqli_native_moodle_database.php');
29 require_once(__DIR__.'/mysqli_native_moodle_recordset.php');
30 require_once(__DIR__.'/mysqli_native_moodle_temptables.php');
32 /**
33 * Native Aurora MySQL class representing moodle database interface.
35 * @package core_dml
36 * @copyright 2020 Lafayette College ITS
37 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 class auroramysql_native_moodle_database extends mysqli_native_moodle_database {
41 /** @var bool is compressed row format supported cache */
42 protected $compressedrowformatsupported = false;
44 /**
45 * Returns localised database type name.
47 * Returns localised database type name. Can be used before connect().
48 * @return string
50 public function get_name(): ?string {
51 return get_string('nativeauroramysql', 'install');
54 /**
55 * Returns localised database configuration help.
57 * Returns localised database configuration help. Can be used before connect().
58 * @return string
60 public function get_configuration_help(): ?string {
61 return get_string('nativeauroramysql', 'install');
64 /**
65 * Returns the database vendor.
67 * Returns the database vendor. Can be used before connect().
68 * @return string The db vendor name, usually the same as db family name.
70 public function get_dbvendor(): ?string {
71 return 'mysql';
74 /**
75 * Returns more specific database driver type
77 * Returns more specific database driver type. Can be used before connect().
78 * @return string db type mysqli, pgsql, oci, mssql, sqlsrv
80 protected function get_dbtype(): ?string {
81 return 'auroramysql';
84 /**
85 * It is time to require transactions everywhere.
87 * MyISAM is NOT supported!
89 * @return bool
91 protected function transactions_supported(): ?bool {
92 if ($this->external) {
93 return parent::transactions_supported();
95 return true;