diff --git a/adminer/drivers/mongo.inc.php b/adminer/drivers/mongo.inc.php index 177c90de..15e147ef 100644 --- a/adminer/drivers/mongo.inc.php +++ b/adminer/drivers/mongo.inc.php @@ -8,10 +8,10 @@ if (isset($_GET["mongo"])) { if (class_exists('MongoDB\Driver\Manager')) { class Db { - var $extension = "MongoDB", $server_info = MONGODB_VERSION, $affected_rows, $error, $last_id; + public $extension = "MongoDB", $server_info = MONGODB_VERSION, $affected_rows, $error, $last_id; /** @var MongoDB\Driver\Manager */ - var $_link; - var $_db, $_db_name; + public $_link; + public $_db, $_db_name; function connect($uri, $options) { $this->_link = new \MongoDB\Driver\Manager($uri, $options); @@ -53,7 +53,7 @@ if (isset($_GET["mongo"])) { } class Result { - var $num_rows; + public $num_rows; private $rows = array(), $offset = 0, $charset = array(); function __construct($result) { @@ -285,9 +285,9 @@ if (isset($_GET["mongo"])) { static $possibleDrivers = array("mongodb"); static $jush = "mongo"; - var $editFunctions = array(array("json")); + public $editFunctions = array(array("json")); - var $operators = array( + public $operators = array( "=", "!=", ">", diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index 8626bdcc..246953f8 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -13,7 +13,7 @@ if (isset($_GET["mssql"])) { define('Adminer\DRIVER', "mssql"); if (extension_loaded("sqlsrv")) { class Db { - var $extension = "sqlsrv", $server_info, $affected_rows, $errno, $error; + public $extension = "sqlsrv", $server_info, $affected_rows, $errno, $error; private $link, $result; private function get_error() { @@ -107,7 +107,7 @@ if (isset($_GET["mssql"])) { } class Result { - var $num_rows; + public $num_rows; private $result, $offset = 0, $fields; function __construct($result) { @@ -158,7 +158,7 @@ if (isset($_GET["mssql"])) { } elseif (extension_loaded("pdo_sqlsrv")) { class Db extends PdoDb { - var $extension = "PDO_SQLSRV"; + public $extension = "PDO_SQLSRV"; function connect($server, $username, $password) { $this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password); @@ -173,7 +173,7 @@ if (isset($_GET["mssql"])) { } elseif (extension_loaded("pdo_dblib")) { class Db extends PdoDb { - var $extension = "PDO_DBLIB"; + public $extension = "PDO_DBLIB"; function connect($server, $username, $password) { $this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)), $username, $password); @@ -191,7 +191,7 @@ if (isset($_GET["mssql"])) { static $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB"); static $jush = "mssql"; - var $editFunctions = array( + public $editFunctions = array( array( "date|time" => "getdate", ), array( @@ -200,11 +200,11 @@ if (isset($_GET["mssql"])) { ) ); - var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); - var $functions = array("len", "lower", "round", "upper"); - var $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); - var $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT"; - var $generated = array("PERSISTED", "VIRTUAL"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); + public $functions = array("len", "lower", "round", "upper"); + public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); + public $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT"; + public $generated = array("PERSISTED", "VIRTUAL"); function __construct($connection) { parent::__construct($connection); diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index d4c67ce3..8e7e9a9f 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -8,7 +8,7 @@ if (!defined('Adminer\DRIVER')) { // MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable if (extension_loaded("mysqli")) { class Db extends \MySQLi { - var $extension = "MySQLi"; + public $extension = "MySQLi"; function __construct() { parent::init(); @@ -60,7 +60,7 @@ if (!defined('Adminer\DRIVER')) { } elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) { class Db { - var + public $extension = "MySQL", ///< @var string extension name $server_info, ///< @var string server version $affected_rows, ///< @var int number of affected rows @@ -185,7 +185,7 @@ if (!defined('Adminer\DRIVER')) { } class Result { - var $num_rows; ///< @var int number of rows in the result + public $num_rows; ///< @var int number of rows in the result private $result, $offset = 0; /** Constructor @@ -230,7 +230,7 @@ if (!defined('Adminer\DRIVER')) { } elseif (extension_loaded("pdo_mysql")) { class Db extends PdoDb { - var $extension = "PDO_MySQL"; + public $extension = "PDO_MySQL"; function connect($server, $username, $password) { global $adminer; @@ -282,10 +282,10 @@ if (!defined('Adminer\DRIVER')) { static $possibleDrivers = array("MySQLi", "MySQL", "PDO_MySQL"); static $jush = "sql"; ///< @var string JUSH identifier - var $unsigned = array("unsigned", "zerofill", "unsigned zerofill"); - var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"); - var $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper"); - var $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); + public $unsigned = array("unsigned", "zerofill", "unsigned zerofill"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"); + public $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper"); + public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); function __construct($connection) { parent::__construct($connection); diff --git a/adminer/drivers/oracle.inc.php b/adminer/drivers/oracle.inc.php index 9d368844..7b831025 100644 --- a/adminer/drivers/oracle.inc.php +++ b/adminer/drivers/oracle.inc.php @@ -7,9 +7,9 @@ if (isset($_GET["oracle"])) { define('Adminer\DRIVER', "oracle"); if (extension_loaded("oci8")) { class Db { - var $extension = "oci8", $server_info, $affected_rows, $errno, $error; + public $extension = "oci8", $server_info, $affected_rows, $errno, $error; + public $_current_db; private $link, $result; - var $_current_db; function _error($errno, $error) { if (ini_bool("html_errors")) { @@ -83,7 +83,7 @@ if (isset($_GET["oracle"])) { } class Result { - var $num_rows; + public $num_rows; private $result, $offset = 1; function __construct($result) { @@ -124,8 +124,8 @@ if (isset($_GET["oracle"])) { } elseif (extension_loaded("pdo_oci")) { class Db extends PdoDb { - var $extension = "PDO_OCI"; - var $_current_db; + public $extension = "PDO_OCI"; + public $_current_db; function connect($server, $username, $password) { $this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password); @@ -146,7 +146,7 @@ if (isset($_GET["oracle"])) { static $possibleDrivers = array("OCI8", "PDO_OCI"); static $jush = "oracle"; - var $editFunctions = array( + public $editFunctions = array( array( //! no parentheses "date" => "current_date", "timestamp" => "current_timestamp", @@ -157,9 +157,9 @@ if (isset($_GET["oracle"])) { ) ); - var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); - var $functions = array("length", "lower", "round", "upper"); - var $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); + public $functions = array("length", "lower", "round", "upper"); + public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); function __construct($connection) { parent::__construct($connection); diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 4d96cb5e..7b4061bc 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -7,7 +7,7 @@ if (isset($_GET["pgsql"])) { define('Adminer\DRIVER', "pgsql"); if (extension_loaded("pgsql")) { class Db { - var $extension = "PgSQL", $server_info, $affected_rows, $error, $timeout; + public $extension = "PgSQL", $server_info, $affected_rows, $error, $timeout; private $link, $result, $string, $database = true; function _error($errno, $error) { @@ -116,7 +116,7 @@ if (isset($_GET["pgsql"])) { } class Result { - var $num_rows; + public $num_rows; private $result, $offset = 0; function __construct($result) { @@ -152,7 +152,7 @@ if (isset($_GET["pgsql"])) { } elseif (extension_loaded("pdo_pgsql")) { class Db extends PdoDb { - var $extension = "PDO_PgSQL", $timeout; + public $extension = "PDO_PgSQL", $timeout; function connect($server, $username, $password) { global $adminer; @@ -201,9 +201,9 @@ if (isset($_GET["pgsql"])) { static $possibleDrivers = array("PgSQL", "PDO_PgSQL"); static $jush = "pgsql"; - var $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF - var $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper"); - var $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF + public $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper"); + public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); function __construct($connection) { parent::__construct($connection); diff --git a/adminer/drivers/sqlite.inc.php b/adminer/drivers/sqlite.inc.php index da29f02e..27d6f9b9 100644 --- a/adminer/drivers/sqlite.inc.php +++ b/adminer/drivers/sqlite.inc.php @@ -8,7 +8,7 @@ if (isset($_GET["sqlite"])) { if (class_exists("SQLite3")) { class SqliteDb { - var $extension = "SQLite3", $server_info, $affected_rows, $errno, $error; + public $extension = "SQLite3", $server_info, $affected_rows, $errno, $error; private $link; function __construct($filename) { @@ -53,7 +53,7 @@ if (isset($_GET["sqlite"])) { } class Result { - var $num_rows; + public $num_rows; private $result, $offset = 0; function __construct($result) { @@ -85,7 +85,7 @@ if (isset($_GET["sqlite"])) { } elseif (extension_loaded("pdo_sqlite")) { class SqliteDb extends PdoDb { - var $extension = "PDO_SQLite"; + public $extension = "PDO_SQLite"; function __construct($filename) { $this->dsn(DRIVER . ":$filename", "", ""); @@ -134,7 +134,7 @@ if (isset($_GET["sqlite"])) { protected $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0)); - var $editFunctions = array( + public $editFunctions = array( array( // "text" => "date('now')/time('now')/datetime('now')", ), array( @@ -144,9 +144,9 @@ if (isset($_GET["sqlite"])) { ) ); - var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function - var $functions = array("hex", "length", "lower", "round", "unixepoch", "upper"); - var $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function + public $functions = array("hex", "length", "lower", "round", "unixepoch", "upper"); + public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); function __construct($connection) { parent::__construct($connection); diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 87dea460..7c8028de 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -5,7 +5,7 @@ namespace Adminer; class Adminer { /** @var array operators used in select, null for all operators */ - var $operators; + public $operators; /** Name in title and navigation * @return string HTML code diff --git a/adminer/include/driver.inc.php b/adminer/include/driver.inc.php index 9dca7e00..77c2d9ca 100644 --- a/adminer/include/driver.inc.php +++ b/adminer/include/driver.inc.php @@ -28,15 +28,15 @@ abstract class SqlDriver { protected $conn; protected $types = array(); ///< @var array [$description => [$type => $maximum_unsigned_length, ...], ...] - var $editFunctions = array(); ///< @var array of ["$type|$type2" => "$function/$function2"] functions used in editing, [0] - edit and insert, [1] - edit only - var $unsigned = array(); ///< @var array number variants - var $operators = array(); ///< @var array operators used in select - var $functions = array(); ///< @var array functions used in select - var $grouping = array(); ///< @var array grouping functions used in select - var $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; ///< @var string used in foreign_keys() - var $inout = "IN|OUT|INOUT"; - var $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; - var $generated = array(); + public $editFunctions = array(); ///< @var array of ["$type|$type2" => "$function/$function2"] functions used in editing, [0] - edit and insert, [1] - edit only + public $unsigned = array(); ///< @var array number variants + public $operators = array(); ///< @var array operators used in select + public $functions = array(); ///< @var array functions used in select + public $grouping = array(); ///< @var array grouping functions used in select + public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; ///< @var string used in foreign_keys() + public $inout = "IN|OUT|INOUT"; + public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; + public $generated = array(); /** Create object for performing database operations * @param Db diff --git a/adminer/include/pdo.inc.php b/adminer/include/pdo.inc.php index 9dc1858e..09eef0f5 100644 --- a/adminer/include/pdo.inc.php +++ b/adminer/include/pdo.inc.php @@ -4,7 +4,7 @@ namespace Adminer; // PDO can be used in several database drivers if (extension_loaded('pdo')) { abstract class PdoDb { - var $server_info, $affected_rows, $errno, $error, $pdo; + public $server_info, $affected_rows, $errno, $error, $pdo; private $result; function dsn($dsn, $username, $password, $options = array()) { @@ -76,7 +76,7 @@ if (extension_loaded('pdo')) { } class PdoDbStatement extends \PDOStatement { - var $_offset = 0, $num_rows; + public $_offset = 0, $num_rows; function fetch_assoc() { return $this->fetch(\PDO::FETCH_ASSOC); diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index d6f71bc2..65ebb88b 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -2,7 +2,7 @@ namespace Adminer; class Adminer { - var $operators = array("<=", ">="); + public $operators = array("<=", ">="); private $values = array(); function name() { diff --git a/plugins/drivers/clickhouse.php b/plugins/drivers/clickhouse.php index 8b246034..7fee09ee 100644 --- a/plugins/drivers/clickhouse.php +++ b/plugins/drivers/clickhouse.php @@ -8,9 +8,9 @@ if (isset($_GET["clickhouse"])) { if (ini_bool('allow_url_fopen')) { class Db { - var $extension = "JSON", $server_info, $errno, $error; + public $extension = "JSON", $server_info, $errno, $error; + public $_db = 'default'; private $result, $url; - var $_db = 'default'; function rootQuery($db, $query) { $file = @file_get_contents("$this->url/?database=$db", false, stream_context_create(array('http' => array( @@ -91,7 +91,7 @@ if (isset($_GET["clickhouse"])) { } class Result { - var $num_rows, $columns, $meta; + public $num_rows, $columns, $meta; private $rows, $offset = 0; function __construct($result) { @@ -137,8 +137,8 @@ if (isset($_GET["clickhouse"])) { static $possibleDrivers = array("allow_url_fopen"); static $jush = "clickhouse"; - var $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); - var $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); + public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); function __construct($connection) { parent::__construct($connection); diff --git a/plugins/drivers/elastic.php b/plugins/drivers/elastic.php index 691f3687..03a359d2 100644 --- a/plugins/drivers/elastic.php +++ b/plugins/drivers/elastic.php @@ -9,7 +9,7 @@ if (isset($_GET["elastic"])) { if (ini_bool('allow_url_fopen')) { class Db { - var $extension = "JSON", $server_info, $errno, $error; + public $extension = "JSON", $server_info, $errno, $error; private $url; /** @@ -97,7 +97,7 @@ if (isset($_GET["elastic"])) { } class Result { - var $num_rows; + public $num_rows; private $rows; function __construct($rows) { @@ -126,8 +126,8 @@ if (isset($_GET["elastic"])) { static $possibleDrivers = array("json + allow_url_fopen"); static $jush = "elastic"; - var $editFunctions = array(array("json")); - var $operators = array("=", "must", "should", "must_not"); + public $editFunctions = array(array("json")); + public $operators = array("=", "must", "should", "must_not"); function __construct($connection) { parent::__construct($connection); diff --git a/plugins/drivers/firebird.php b/plugins/drivers/firebird.php index c42a30f4..1d319f39 100644 --- a/plugins/drivers/firebird.php +++ b/plugins/drivers/firebird.php @@ -12,7 +12,7 @@ if (isset($_GET["firebird"])) { if (extension_loaded("interbase")) { class Db { - var + public $extension = "Firebird", $server_info, $affected_rows, @@ -81,7 +81,7 @@ if (isset($_GET["firebird"])) { } class Result { - var $num_rows; + public $num_rows; private $result, $offset = 0; function __construct($result) { @@ -120,7 +120,7 @@ if (isset($_GET["firebird"])) { static $possibleDrivers = array("interbase"); static $jush = "firebird"; - var $operators = array("="); + public $operators = array("="); } diff --git a/plugins/drivers/simpledb.php b/plugins/drivers/simpledb.php index 74268789..0ac5f3fd 100644 --- a/plugins/drivers/simpledb.php +++ b/plugins/drivers/simpledb.php @@ -8,7 +8,7 @@ if (isset($_GET["simpledb"])) { if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) { class Db { - var $extension = "SimpleXML", $server_info = '2009-04-15', $error, $timeout, $next, $affected_rows; + public $extension = "SimpleXML", $server_info = '2009-04-15', $error, $timeout, $next, $affected_rows; private $result; function select_db($database) { @@ -56,7 +56,7 @@ if (isset($_GET["simpledb"])) { } class Result { - var $num_rows; + public $num_rows; private $rows = array(), $offset = 0; function __construct($result) { @@ -123,8 +123,8 @@ if (isset($_GET["simpledb"])) { static $possibleDrivers = array("SimpleXML + allow_url_fopen"); static $jush = "simpledb"; - var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL"); - var $grouping = array("count"); + public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL"); + public $grouping = array("count"); public $primary = "itemName()";