mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +02:00
Rename Min_ classes
This commit is contained in:
@@ -7,7 +7,7 @@ if (isset($_GET["mongo"])) {
|
||||
define("DRIVER", "mongo");
|
||||
|
||||
if (class_exists('MongoDB\Driver\Manager')) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "MongoDB", $server_info = MONGODB_VERSION, $affected_rows, $error, $last_id;
|
||||
/** @var MongoDB\Driver\Manager */
|
||||
var $_link;
|
||||
@@ -54,7 +54,7 @@ if (isset($_GET["mongo"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $num_rows, $_rows = array(), $_offset = 0, $_charset = array();
|
||||
|
||||
function __construct($result) {
|
||||
@@ -116,7 +116,7 @@ if (isset($_GET["mongo"])) {
|
||||
}
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
public $primary = "_id";
|
||||
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
@@ -141,7 +141,7 @@ if (isset($_GET["mongo"])) {
|
||||
$skip = $page * $limit;
|
||||
$class = 'MongoDB\Driver\Query';
|
||||
try {
|
||||
return new Min_Result($connection->_link->executeQuery("$connection->_db_name.$table", new $class($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort))));
|
||||
return new Result($connection->_link->executeQuery("$connection->_db_name.$table", new $class($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort))));
|
||||
} catch (Exception $e) {
|
||||
$connection->error = $e->getMessage();
|
||||
return false;
|
||||
@@ -425,7 +425,7 @@ if (isset($_GET["mongo"])) {
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
list($server, $username, $password) = $adminer->credentials();
|
||||
|
||||
if ($server == "") {
|
||||
|
@@ -12,7 +12,7 @@ $drivers["mssql"] = "MS SQL";
|
||||
if (isset($_GET["mssql"])) {
|
||||
define("DRIVER", "mssql");
|
||||
if (extension_loaded("sqlsrv")) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "sqlsrv", $_link, $_result, $server_info, $affected_rows, $errno, $error;
|
||||
|
||||
function _get_error() {
|
||||
@@ -85,7 +85,7 @@ if (isset($_GET["mssql"])) {
|
||||
return false;
|
||||
}
|
||||
if (sqlsrv_field_metadata($result)) {
|
||||
return new Min_Result($result);
|
||||
return new Result($result);
|
||||
}
|
||||
$this->affected_rows = sqlsrv_rows_affected($result);
|
||||
return true;
|
||||
@@ -105,7 +105,7 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $_result, $_offset = 0, $_fields, $num_rows;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -155,7 +155,7 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_sqlsrv")) {
|
||||
class Min_DB extends Min_PDO {
|
||||
class Db extends PdoDb {
|
||||
var $extension = "PDO_SQLSRV";
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
@@ -170,7 +170,7 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_dblib")) {
|
||||
class Min_DB extends Min_PDO {
|
||||
class Db extends PdoDb {
|
||||
var $extension = "PDO_DBLIB";
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
@@ -185,7 +185,7 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
$fields = fields($table);
|
||||
@@ -255,7 +255,7 @@ if (isset($_GET["mssql"])) {
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
$credentials = $adminer->credentials();
|
||||
|
||||
if ($credentials[0] == "") {
|
||||
|
@@ -7,7 +7,7 @@ if (!defined("DRIVER")) {
|
||||
define("DRIVER", "server"); // server - backwards compatibility
|
||||
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
|
||||
if (extension_loaded("mysqli")) {
|
||||
class Min_DB extends \MySQLi {
|
||||
class Db extends \MySQLi {
|
||||
var $extension = "MySQLi";
|
||||
|
||||
function __construct() {
|
||||
@@ -59,7 +59,7 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var
|
||||
$extension = "MySQL", ///< @var string extension name
|
||||
$server_info, ///< @var string server version
|
||||
@@ -129,7 +129,7 @@ if (!defined("DRIVER")) {
|
||||
/** Send query
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return mixed bool or Min_Result
|
||||
* @return mixed bool or Result
|
||||
*/
|
||||
function query($query, $unbuffered = false) {
|
||||
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link)); // @ - mute mysql.trace_mode
|
||||
@@ -144,7 +144,7 @@ if (!defined("DRIVER")) {
|
||||
$this->info = mysql_info($this->_link);
|
||||
return true;
|
||||
}
|
||||
return new Min_Result($result);
|
||||
return new Result($result);
|
||||
}
|
||||
|
||||
/** Send query with more resultsets
|
||||
@@ -156,7 +156,7 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
/** Get current resultset
|
||||
* @return Min_Result
|
||||
* @return Result
|
||||
*/
|
||||
function store_result() {
|
||||
return $this->_result;
|
||||
@@ -184,7 +184,7 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var
|
||||
$num_rows, ///< @var int number of rows in the result
|
||||
$_result, $_offset = 0 ///< @access private
|
||||
@@ -231,7 +231,7 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_mysql")) {
|
||||
class Min_DB extends Min_PDO {
|
||||
class Db extends PdoDb {
|
||||
var $extension = "PDO_MySQL";
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
@@ -280,7 +280,7 @@ if (!defined("DRIVER")) {
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
function insert($table, $set) {
|
||||
return ($set ? parent::insert($table, $set) : queries("INSERT INTO " . table($table) . " ()\nVALUES ()"));
|
||||
@@ -377,11 +377,11 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
/** Connect to the database
|
||||
* @return mixed Min_DB or string for error
|
||||
* @return mixed Db or string for error
|
||||
*/
|
||||
function connect() {
|
||||
global $adminer, $types, $structured_types, $edit_functions;
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
$connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5
|
||||
@@ -589,7 +589,7 @@ if (!defined("DRIVER")) {
|
||||
|
||||
/** Get table indexes
|
||||
* @param string
|
||||
* @param string Min_DB to use
|
||||
* @param string Db to use
|
||||
* @return array [$key_name => ["type" => , "columns" => [], "lengths" => [], "descs" => []]]
|
||||
*/
|
||||
function indexes($table, $connection2 = null) {
|
||||
@@ -984,9 +984,9 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
/** Explain select
|
||||
* @param Min_DB
|
||||
* @param Db
|
||||
* @param string
|
||||
* @return Min_Result
|
||||
* @return Result
|
||||
*/
|
||||
function explain($connection, $query) {
|
||||
return $connection->query("EXPLAIN " . (min_version(5.1) && !min_version(5.7) ? "PARTITIONS " : "") . $query);
|
||||
@@ -1029,7 +1029,7 @@ if (!defined("DRIVER")) {
|
||||
|
||||
/** Set current schema
|
||||
* @param string
|
||||
* @param Min_DB
|
||||
* @param Db
|
||||
* @return bool
|
||||
function set_schema($schema, $connection2 = null) {
|
||||
return true;
|
||||
|
@@ -6,7 +6,7 @@ $drivers["oracle"] = "Oracle (beta)";
|
||||
if (isset($_GET["oracle"])) {
|
||||
define("DRIVER", "oracle");
|
||||
if (extension_loaded("oci8")) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "oci8", $_link, $_result, $server_info, $affected_rows, $errno, $error;
|
||||
var $_current_db;
|
||||
|
||||
@@ -52,7 +52,7 @@ if (isset($_GET["oracle"])) {
|
||||
restore_error_handler();
|
||||
if ($return) {
|
||||
if (oci_num_fields($result)) {
|
||||
return new Min_Result($result);
|
||||
return new Result($result);
|
||||
}
|
||||
$this->affected_rows = oci_num_rows($result);
|
||||
oci_free_statement($result);
|
||||
@@ -81,7 +81,7 @@ if (isset($_GET["oracle"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $_result, $_offset = 1, $num_rows;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -121,7 +121,7 @@ if (isset($_GET["oracle"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_oci")) {
|
||||
class Min_DB extends Min_PDO {
|
||||
class Db extends PdoDb {
|
||||
var $extension = "PDO_OCI";
|
||||
var $_current_db;
|
||||
|
||||
@@ -140,7 +140,7 @@ if (isset($_GET["oracle"])) {
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
//! support empty $set in insert()
|
||||
|
||||
@@ -186,7 +186,7 @@ if (isset($_GET["oracle"])) {
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
|
@@ -6,7 +6,7 @@ $drivers["pgsql"] = "PostgreSQL";
|
||||
if (isset($_GET["pgsql"])) {
|
||||
define("DRIVER", "pgsql");
|
||||
if (extension_loaded("pgsql")) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "PgSQL", $_link, $_result, $_string, $_database = true, $server_info, $affected_rows, $error, $timeout;
|
||||
|
||||
function _error($errno, $error) {
|
||||
@@ -79,7 +79,7 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->affected_rows = pg_affected_rows($result);
|
||||
$return = true;
|
||||
} else {
|
||||
$return = new Min_Result($result);
|
||||
$return = new Result($result);
|
||||
}
|
||||
if ($this->timeout) {
|
||||
$this->timeout = 0;
|
||||
@@ -114,7 +114,7 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $_result, $_offset = 0, $num_rows;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -149,7 +149,7 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_pgsql")) {
|
||||
class Min_DB extends Min_PDO {
|
||||
class Db extends PdoDb {
|
||||
var $extension = "PDO_PgSQL", $timeout;
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
@@ -195,7 +195,7 @@ if (isset($_GET["pgsql"])) {
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
global $connection;
|
||||
@@ -273,7 +273,7 @@ if (isset($_GET["pgsql"])) {
|
||||
|
||||
function connect() {
|
||||
global $adminer, $types, $structured_types;
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
if (min_version(9, 0, $connection)) {
|
||||
|
@@ -7,7 +7,7 @@ if (isset($_GET["sqlite"])) {
|
||||
define("DRIVER", "sqlite");
|
||||
if (class_exists("SQLite3")) {
|
||||
|
||||
class Min_SQLite {
|
||||
class SqliteDb {
|
||||
var $extension = "SQLite3", $server_info, $affected_rows, $errno, $error, $_link;
|
||||
|
||||
function __construct($filename) {
|
||||
@@ -24,7 +24,7 @@ if (isset($_GET["sqlite"])) {
|
||||
$this->error = $this->_link->lastErrorMsg();
|
||||
return false;
|
||||
} elseif ($result->numColumns()) {
|
||||
return new Min_Result($result);
|
||||
return new Result($result);
|
||||
}
|
||||
$this->affected_rows = $this->_link->changes();
|
||||
return true;
|
||||
@@ -51,7 +51,7 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $_result, $_offset = 0, $num_rows;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -82,7 +82,7 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_sqlite")) {
|
||||
class Min_SQLite extends Min_PDO {
|
||||
class SqliteDb extends PdoDb {
|
||||
var $extension = "PDO_SQLite";
|
||||
|
||||
function __construct($filename) {
|
||||
@@ -92,8 +92,8 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
}
|
||||
|
||||
if (class_exists('Adminer\Min_SQLite')) {
|
||||
class Min_DB extends Min_SQLite {
|
||||
if (class_exists('Adminer\SqliteDb')) {
|
||||
class Db extends SqliteDb {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct(":memory:");
|
||||
@@ -122,7 +122,7 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
$values = array();
|
||||
@@ -164,7 +164,7 @@ if (isset($_GET["sqlite"])) {
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return new Min_DB;
|
||||
return new Db;
|
||||
}
|
||||
|
||||
function get_databases() {
|
||||
@@ -362,7 +362,7 @@ if (isset($_GET["sqlite"])) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$link = new Min_SQLite($db);
|
||||
$link = new SqliteDb($db);
|
||||
} catch (Exception $ex) {
|
||||
$connection->error = $ex->getMessage();
|
||||
return false;
|
||||
|
@@ -146,7 +146,7 @@ function auth_error($error) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["username"]) && !class_exists('Adminer\Min_DB')) {
|
||||
if (isset($_GET["username"]) && !class_exists('Adminer\Db')) {
|
||||
unset($_SESSION["pwds"][DRIVER]);
|
||||
unset_permanent();
|
||||
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
|
||||
@@ -163,7 +163,7 @@ if (isset($_GET["username"]) && is_string(get_password())) {
|
||||
}
|
||||
check_invalid_login();
|
||||
$connection = connect();
|
||||
$driver = new Min_Driver($connection);
|
||||
$driver = new Driver($connection);
|
||||
}
|
||||
|
||||
$login = null;
|
||||
|
@@ -22,11 +22,11 @@ function get_driver($id) {
|
||||
return $drivers[$id];
|
||||
}
|
||||
|
||||
/*abstract*/ class Min_SQL {
|
||||
/*abstract*/ class SqlDriver {
|
||||
var $_conn;
|
||||
|
||||
/** Create object for performing database operations
|
||||
* @param Min_DB
|
||||
* @param Db
|
||||
*/
|
||||
function __construct($connection) {
|
||||
$this->_conn = $connection;
|
||||
@@ -41,7 +41,7 @@ function get_driver($id) {
|
||||
* @param int result of $adminer->selectLimitProcess()
|
||||
* @param int index of page starting at zero
|
||||
* @param bool whether to print the query
|
||||
* @return Min_Result
|
||||
* @return Result
|
||||
*/
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
global $adminer, $jush;
|
||||
|
@@ -4,8 +4,8 @@ namespace Adminer;
|
||||
// This file is not used in Adminer Editor.
|
||||
|
||||
/** Print select result
|
||||
* @param Min_Result
|
||||
* @param Min_DB connection to examine indexes
|
||||
* @param Result
|
||||
* @param Db connection to examine indexes
|
||||
* @param array
|
||||
* @param int
|
||||
* @return array $orgtables
|
||||
|
@@ -4,7 +4,7 @@ namespace Adminer;
|
||||
// This file is used both in Adminer and Adminer Editor.
|
||||
|
||||
/** Get database connection
|
||||
* @return Min_DB
|
||||
* @return Db
|
||||
*/
|
||||
function connection() {
|
||||
// can be used in customization, $connection is minified
|
||||
@@ -98,7 +98,7 @@ function bracket_escape($idf, $back = false) {
|
||||
/** Check if connection has at least the given version
|
||||
* @param string required version
|
||||
* @param string required MariaDB version
|
||||
* @param Min_DB defaults to $connection
|
||||
* @param Db defaults to $connection
|
||||
* @return bool
|
||||
*/
|
||||
function min_version($version, $maria_db = "", $connection2 = null) {
|
||||
@@ -115,7 +115,7 @@ function min_version($version, $maria_db = "", $connection2 = null) {
|
||||
}
|
||||
|
||||
/** Get connection charset
|
||||
* @param Min_DB
|
||||
* @param Db
|
||||
* @return string
|
||||
*/
|
||||
function charset($connection) {
|
||||
@@ -356,7 +356,7 @@ function get_vals($query, $column = 0) {
|
||||
|
||||
/** Get keys from first column and values from second
|
||||
* @param string
|
||||
* @param Min_DB
|
||||
* @param Db
|
||||
* @param bool
|
||||
* @return array
|
||||
*/
|
||||
@@ -381,7 +381,7 @@ function get_key_vals($query, $connection2 = null, $set_keys = true) {
|
||||
|
||||
/** Get all rows of result
|
||||
* @param string
|
||||
* @param Min_DB
|
||||
* @param Db
|
||||
* @param string
|
||||
* @return array of associative arrays
|
||||
*/
|
||||
@@ -637,7 +637,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
|
||||
|
||||
/** Execute and remember query
|
||||
* @param string or null to return remembered queries, end with ';' to use DELIMITER
|
||||
* @return Min_Result or [$queries, $time] if $query = null
|
||||
* @return Result or [$queries, $time] if $query = null
|
||||
*/
|
||||
function queries($query) {
|
||||
global $connection;
|
||||
|
@@ -3,7 +3,7 @@ namespace Adminer;
|
||||
|
||||
// PDO can be used in several database drivers
|
||||
if (extension_loaded('pdo')) {
|
||||
/*abstract*/ class Min_PDO {
|
||||
/*abstract*/ class PdoDb {
|
||||
var $_result, $server_info, $affected_rows, $errno, $error, $pdo;
|
||||
|
||||
function __construct() {
|
||||
@@ -16,7 +16,7 @@ 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');
|
||||
$options[PDO::ATTR_STATEMENT_CLASS] = array('PdoDbStatement');
|
||||
try {
|
||||
$this->pdo = new PDO($dsn, $username, $password, $options);
|
||||
} catch (Exception $ex) {
|
||||
@@ -82,7 +82,7 @@ if (extension_loaded('pdo')) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_PDOStatement extends \PDOStatement {
|
||||
class PdoDbStatement extends \PDOStatement {
|
||||
var $_offset = 0, $num_rows;
|
||||
|
||||
function fetch_assoc() {
|
||||
|
@@ -63,7 +63,7 @@ header("Cache-Control: immutable");
|
||||
if ($driver != "mysql") {
|
||||
preg_match_all(
|
||||
'~\bfunction ([^(]+)~',
|
||||
preg_replace('~class Min_Driver.*\n\t}~sU', '', file_get_contents(__DIR__ . "/adminer/drivers/mysql.inc.php")),
|
||||
preg_replace('~class Driver.*\n\t}~sU', '', file_get_contents(__DIR__ . "/adminer/drivers/mysql.inc.php")),
|
||||
$matches
|
||||
); //! respect context (extension, class)
|
||||
$functions = array_combine($matches[1], $matches[0]);
|
||||
|
@@ -24,7 +24,6 @@
|
||||
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
|
||||
<exclude name="PSR12.Classes.ClassInstantiation.MissingParentheses"/>
|
||||
<exclude name="PSR12.Classes.OpeningBraceSpace.Found"/>
|
||||
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
|
||||
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
|
||||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
|
||||
<exclude name="PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket"/>
|
||||
|
@@ -6,7 +6,7 @@ add_driver("clickhouse", "ClickHouse (alpha)");
|
||||
if (isset($_GET["clickhouse"])) {
|
||||
define("DRIVER", "clickhouse");
|
||||
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "JSON", $server_info, $errno, $_result, $error, $_url;
|
||||
var $_db = 'default';
|
||||
|
||||
@@ -43,7 +43,7 @@ if (isset($_GET["clickhouse"])) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Min_Result($return);
|
||||
return new Result($return);
|
||||
}
|
||||
|
||||
function isQuerySelectLike($query) {
|
||||
@@ -88,7 +88,7 @@ if (isset($_GET["clickhouse"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $num_rows, $_rows, $columns, $meta, $_offset = 0;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -130,7 +130,7 @@ if (isset($_GET["clickhouse"])) {
|
||||
}
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
function delete($table, $queryWhere, $limit = 0) {
|
||||
if ($queryWhere === '') {
|
||||
$queryWhere = 'WHERE 1=1';
|
||||
@@ -219,7 +219,7 @@ if (isset($_GET["clickhouse"])) {
|
||||
|
||||
function connect() {
|
||||
$adminer = adminer();
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
list($server, $username, $password) = $adminer->credentials();
|
||||
if (!preg_match('~^(https?://)?[-a-z\d.]+(:\d+)?$~', $server)) {
|
||||
return lang('Invalid server.');
|
||||
|
@@ -9,7 +9,7 @@ if (isset($_GET["elastic"])) {
|
||||
if (ini_bool('allow_url_fopen')) {
|
||||
define("ELASTIC_DB_NAME", "elastic");
|
||||
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "JSON", $server_info, $errno, $error, $_url;
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@ if (isset($_GET["elastic"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $num_rows, $_rows;
|
||||
|
||||
function __construct($rows) {
|
||||
@@ -121,7 +121,7 @@ if (isset($_GET["elastic"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
$data = array();
|
||||
@@ -216,7 +216,7 @@ if (isset($_GET["elastic"])) {
|
||||
$return[] = $row;
|
||||
}
|
||||
|
||||
return new Min_Result($return);
|
||||
return new Result($return);
|
||||
}
|
||||
|
||||
function update($type, $record, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
@@ -275,7 +275,7 @@ if (isset($_GET["elastic"])) {
|
||||
}
|
||||
|
||||
function connect() {
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
|
||||
list($server, $username, $password) = adminer()->credentials();
|
||||
if (!preg_match('~^(https?://)?[-a-z\d.]+(:\d+)?$~', $server)) {
|
||||
|
@@ -7,7 +7,7 @@ if (isset($_GET["elastic5"])) {
|
||||
define("DRIVER", "elastic5");
|
||||
|
||||
if (ini_bool('allow_url_fopen')) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "JSON", $server_info, $errno, $error, $_url, $_db;
|
||||
|
||||
/** Performs query
|
||||
@@ -87,7 +87,7 @@ if (isset($_GET["elastic5"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $num_rows, $_rows;
|
||||
|
||||
function __construct($rows) {
|
||||
@@ -112,7 +112,7 @@ if (isset($_GET["elastic5"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
$data = array();
|
||||
@@ -200,7 +200,7 @@ if (isset($_GET["elastic5"])) {
|
||||
$return[] = $row;
|
||||
}
|
||||
|
||||
return new Min_Result($return);
|
||||
return new Result($return);
|
||||
}
|
||||
|
||||
function update($type, $record, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
@@ -259,7 +259,7 @@ if (isset($_GET["elastic5"])) {
|
||||
}
|
||||
|
||||
function connect() {
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
|
||||
list($server, $username, $password) = adminer()->credentials();
|
||||
if (!preg_match('~^(https?://)?[-a-z\d.]+(:\d+)?$~', $server)) {
|
||||
|
@@ -11,7 +11,7 @@ if (isset($_GET["firebird"])) {
|
||||
define("DRIVER", "firebird");
|
||||
|
||||
if (extension_loaded("interbase")) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var
|
||||
$extension = "Firebird",
|
||||
$server_info,
|
||||
@@ -54,7 +54,7 @@ if (isset($_GET["firebird"])) {
|
||||
$this->affected_rows = ibase_affected_rows($this->_link);
|
||||
return true;
|
||||
}
|
||||
return new Min_Result($result);
|
||||
return new Result($result);
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
@@ -79,7 +79,7 @@ if (isset($_GET["firebird"])) {
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $num_rows, $_result, $_offset = 0;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -114,7 +114,7 @@ if (isset($_GET["firebird"])) {
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ if (isset($_GET["firebird"])) {
|
||||
|
||||
function connect() {
|
||||
$adminer = adminer();
|
||||
$connection = new Min_DB;
|
||||
$connection = new Db;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
|
@@ -7,7 +7,7 @@ if (isset($_GET["simpledb"])) {
|
||||
define("DRIVER", "simpledb");
|
||||
|
||||
if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) {
|
||||
class Min_DB {
|
||||
class Db {
|
||||
var $extension = "SimpleXML", $server_info = '2009-04-15', $error, $timeout, $next, $affected_rows, $_result;
|
||||
|
||||
function select_db($database) {
|
||||
@@ -34,7 +34,7 @@ if (isset($_GET["simpledb"])) {
|
||||
'Value' => $sum,
|
||||
))));
|
||||
}
|
||||
return new Min_Result($result);
|
||||
return new Result($result);
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
@@ -55,7 +55,7 @@ if (isset($_GET["simpledb"])) {
|
||||
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
class Result {
|
||||
var $num_rows, $_rows = array(), $_offset = 0;
|
||||
|
||||
function __construct($result) {
|
||||
@@ -119,7 +119,7 @@ if (isset($_GET["simpledb"])) {
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
class Driver extends SqlDriver {
|
||||
public $primary = "itemName()";
|
||||
|
||||
function _chunkRequest($ids, $action, $params, $expand = array()) {
|
||||
@@ -257,7 +257,7 @@ if (isset($_GET["simpledb"])) {
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return new Min_DB;
|
||||
return new Db;
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
|
Reference in New Issue
Block a user