]> git.joonet.de Git - adminer.git/commitdiff
Unsubstite constants (PHP 5 is now required)
authorJakub Vrana <jakub@vrana.cz>
Tue, 23 Feb 2021 11:42:11 +0000 (12:42 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 23 Feb 2021 11:42:11 +0000 (12:42 +0100)
adminer/drivers/mysql.inc.php
adminer/include/bootstrap.inc.php
adminer/include/pdo.inc.php
compile.php

index a2728941922a91b1584e9091e9777a4775a82103..ebb5106b443106b9d1eb47a168cf7a2e9550dffe 100644 (file)
@@ -266,7 +266,7 @@ if (!defined("DRIVER")) {
                        }
 
                        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);
                        }
                }
index a178e3ae16600bd5e4780873df8dd92c9424f068..8eaff3991574ad9079a95cb7a21241e304669b47 100644 (file)
@@ -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";
 
index d7da9caa596ca4a9f973e5e3bdfcc2eb05c61082..a42812153f92844ab0898084708d1be94dff28b7 100644 (file)
@@ -13,14 +13,14 @@ if (extension_loaded('pdo')) {
                }
                
                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);*/
@@ -84,11 +84,11 @@ if (extension_loaded('pdo')) {
                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() {
index eb68525326f75496f50278843f1792d433fcb35b..73f2edb54a645d8bcbcfc8d966279a578760b630 100755 (executable)
@@ -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";