Unsubstite constants (PHP 5 is now required)

This commit is contained in:
Jakub Vrana 2021-02-23 12:42:11 +01:00
parent 205305d6b5
commit af1a908f56
4 changed files with 8 additions and 8 deletions

View file

@ -266,7 +266,7 @@ if (!defined("DRIVER")) {
} }
function query($query, $unbuffered = false) { function query($query, $unbuffered = false) {
$this->pdo->setAttribute(1000, !$unbuffered); // 1000 - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY $this->pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, !$unbuffered);
return parent::query($query, $unbuffered); return parent::query($query, $unbuffered);
} }
} }

View file

@ -4,7 +4,7 @@ function adminer_errors($errno, $errstr) {
} }
error_reporting(6135); // errors and warnings error_reporting(6135); // errors and warnings
set_error_handler('adminer_errors', 2); // 2 - E_WARNING set_error_handler('adminer_errors', E_WARNING);
include "../adminer/include/coverage.inc.php"; include "../adminer/include/coverage.inc.php";

View file

@ -13,14 +13,14 @@ if (extension_loaded('pdo')) {
} }
function dsn($dsn, $username, $password, $options = array()) { function dsn($dsn, $username, $password, $options = array()) {
$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
$options[PDO::ATTR_STATEMENT_CLASS] = array('Min_PDOStatement');
try { try {
$this->pdo = new PDO($dsn, $username, $password, $options); $this->pdo = new PDO($dsn, $username, $password, $options);
} catch (Exception $ex) { } catch (Exception $ex) {
auth_error(h($ex->getMessage())); auth_error(h($ex->getMessage()));
} }
$this->pdo->setAttribute(3, 0); // 3 - PDO::ATTR_ERRMODE, 0 - PDO::ERRMODE_SILENT $this->server_info = @$this->pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
$this->pdo->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
$this->server_info = @$this->pdo->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
} }
/*abstract function select_db($database);*/ /*abstract function select_db($database);*/
@ -84,11 +84,11 @@ if (extension_loaded('pdo')) {
var $_offset = 0, $num_rows; var $_offset = 0, $num_rows;
function fetch_assoc() { function fetch_assoc() {
return $this->fetch(2); // PDO::FETCH_ASSOC return $this->fetch(PDO::FETCH_ASSOC);
} }
function fetch_row() { function fetch_row() {
return $this->fetch(3); // PDO::FETCH_NUM return $this->fetch(PDO::FETCH_NUM);
} }
function fetch_field() { function fetch_field() {

View file

@ -5,7 +5,7 @@ function adminer_errors($errno, $errstr) {
} }
error_reporting(6135); // errors and warnings error_reporting(6135); // errors and warnings
set_error_handler('adminer_errors', 2); // 2 - E_WARNING set_error_handler('adminer_errors', E_WARNING);
include dirname(__FILE__) . "/adminer/include/version.inc.php"; include dirname(__FILE__) . "/adminer/include/version.inc.php";
include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php"; include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";