Skip to content

Commit

Permalink
Unsubstite constants (PHP 5 is now required)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Feb 23, 2021
1 parent 205305d commit af1a908
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion adminer/drivers/mysql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function select_db($database) {
}

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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion adminer/include/bootstrap.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function adminer_errors($errno, $errstr) {
}

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";

Expand Down
10 changes: 5 additions & 5 deletions adminer/include/pdo.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ function __construct() {
}

function dsn($dsn, $username, $password, $options = array()) {
$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
$options[PDO::ATTR_STATEMENT_CLASS] = array('Min_PDOStatement');
try {
$this->pdo = new PDO($dsn, $username, $password, $options);
} catch (Exception $ex) {
auth_error(h($ex->getMessage()));
}
$this->pdo->setAttribute(3, 0); // 3 - PDO::ATTR_ERRMODE, 0 - PDO::ERRMODE_SILENT
$this->pdo->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
$this->server_info = @$this->pdo->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
$this->server_info = @$this->pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
}

/*abstract function select_db($database);*/
Expand Down Expand Up @@ -84,11 +84,11 @@ class Min_PDOStatement extends PDOStatement {
var $_offset = 0, $num_rows;

function fetch_assoc() {
return $this->fetch(2); // PDO::FETCH_ASSOC
return $this->fetch(PDO::FETCH_ASSOC);
}

function fetch_row() {
return $this->fetch(3); // PDO::FETCH_NUM
return $this->fetch(PDO::FETCH_NUM);
}

function fetch_field() {
Expand Down
2 changes: 1 addition & 1 deletion compile.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function adminer_errors($errno, $errstr) {
}

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__) . "/externals/JsShrink/jsShrink.php";

Expand Down

0 comments on commit af1a908

Please sign in to comment.