mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-17020 pgsql: silenced php warnings
This commit is contained in:
parent
6e22a695d8
commit
ba98912f8c
1 changed files with 28 additions and 0 deletions
|
@ -13,6 +13,8 @@ class pgsql_native_moodle_database extends moodle_database {
|
|||
protected $debug = false;
|
||||
protected $bytea_oid = null;
|
||||
|
||||
protected $last_debug;
|
||||
|
||||
/**
|
||||
* Detects if all needed PHP stuff installed.
|
||||
* Note: can be used before connect()
|
||||
|
@ -147,6 +149,32 @@ class pgsql_native_moodle_database extends moodle_database {
|
|||
parent::dispose();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called before each db query.
|
||||
* @param string $sql
|
||||
* @param array array of parameters
|
||||
* @param int $type type of query
|
||||
* @param mixed $extrainfo driver specific extra information
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
|
||||
parent::query_start($sql, $params, $type, $extrainfo);
|
||||
// pgsql driver tents to send debug to output, we do not need that ;-)
|
||||
$this->last_debug = error_reporting(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called immediately after each db query.
|
||||
* @param mixed db specific result
|
||||
* @return void
|
||||
*/
|
||||
protected function query_end($result) {
|
||||
//reset original debug level
|
||||
error_reporting($this->last_debug);
|
||||
parent::query_end($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns database server info array
|
||||
* @return array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue