SimpleDB, Firebird, ClickHouse: Move to plugin
This commit is contained in:
parent
4038144c38
commit
51abdcdab9
|
@ -80,11 +80,9 @@ include "../adminer/drivers/sqlite.inc.php";
|
|||
include "../adminer/drivers/pgsql.inc.php";
|
||||
include "../adminer/drivers/oracle.inc.php";
|
||||
include "../adminer/drivers/mssql.inc.php";
|
||||
include "../adminer/drivers/firebird.inc.php";
|
||||
include "../adminer/drivers/simpledb.inc.php";
|
||||
include "../adminer/drivers/mongo.inc.php";
|
||||
include "../adminer/drivers/elastic.inc.php";
|
||||
include "../adminer/drivers/clickhouse.inc.php";
|
||||
include "./include/adminer.inc.php";
|
||||
include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
|
||||
|
||||
$config = driver_config();
|
||||
|
@ -108,7 +106,6 @@ define("ME", preg_replace('~\?.*~', '', relative_uri()) . '?'
|
|||
);
|
||||
|
||||
include "../adminer/include/version.inc.php";
|
||||
include "./include/adminer.inc.php";
|
||||
include "../adminer/include/design.inc.php";
|
||||
include "../adminer/include/xxtea.inc.php";
|
||||
include "../adminer/include/auth.inc.php";
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
<?php
|
||||
$drivers = array();
|
||||
|
||||
/** Add a driver
|
||||
* @param string
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
function add_driver($id, $name) {
|
||||
global $drivers;
|
||||
$drivers[$id] = $name;
|
||||
}
|
||||
|
||||
/*abstract*/ class Min_SQL {
|
||||
var $_conn;
|
||||
|
|
|
@ -100,5 +100,3 @@ if (extension_loaded('pdo')) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$drivers = array();
|
||||
|
|
|
@ -8,6 +8,9 @@ function adminer_object() {
|
|||
include_once $filename;
|
||||
}
|
||||
|
||||
// enable extra drivers just by including them
|
||||
//~ include "../plugins/drivers/simpledb.inc.php";
|
||||
|
||||
$plugins = array(
|
||||
// specify enabled plugins here
|
||||
new AdminerDatabaseHide(array('information_schema')),
|
||||
|
|
|
@ -9,6 +9,7 @@ PostgreSQL: Create PRIMARY KEY for auto increment columns
|
|||
PostgreSQL: Avoid exporting empty sequence last value (bug #768)
|
||||
PostgreSQL: Fix multi-parameter functions in default values (bug #736)
|
||||
PostgreSQL PDO: Do not select NULL function for false values in edit
|
||||
SimpleDB, Firebird, ClickHouse: Move to plugin
|
||||
|
||||
Adminer 4.7.9 (released 2021-02-07):
|
||||
Fix XSS in browsers which don't encode URL parameters (bug #775, regression from 4.7.0)
|
||||
|
|
|
@ -41,7 +41,7 @@ function lang_ids($match) {
|
|||
}
|
||||
|
||||
function put_file($match) {
|
||||
global $project, $VERSION;
|
||||
global $project, $VERSION, $driver;
|
||||
if (basename($match[2]) == '$LANG.inc.php') {
|
||||
return $match[0]; // processed later
|
||||
}
|
||||
|
@ -61,6 +61,9 @@ header("Cache-Control: immutable");
|
|||
echo "adminer/file.inc.php: Caching headers placeholder not found\n";
|
||||
}
|
||||
}
|
||||
if ($driver && dirname($match[2]) == "../adminer/drivers") {
|
||||
$return = preg_replace('~^if \(isset\(\$_GET\["' . $driver . '"]\)\) \{(.*)^}~ms', '\1', $return);
|
||||
}
|
||||
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
|
||||
if (basename($match[2]) == "lang.inc.php") {
|
||||
$return = str_replace('function lang($idf, $number = null) {', 'function lang($idf, $number = null) {
|
||||
|
|
11
plugins/drivers/README
Normal file
11
plugins/drivers/README
Normal file
|
@ -0,0 +1,11 @@
|
|||
Enable drivers in this directory like this:
|
||||
|
||||
<?php
|
||||
function adminer_object() {
|
||||
include "./plugins/drivers/simpledb.inc.php"; // the driver is enabled just by including
|
||||
return new Adminer; // or return AdminerPlugin if you want to use other plugins
|
||||
}
|
||||
|
||||
// include original Adminer
|
||||
include "./adminer.php";
|
||||
?>
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$drivers["clickhouse"] = "ClickHouse (alpha)";
|
||||
add_driver("clickhouse", "ClickHouse (alpha)");
|
||||
|
||||
if (isset($_GET["clickhouse"])) {
|
||||
define("DRIVER", "clickhouse");
|
|
@ -3,8 +3,8 @@
|
|||
* @author Steve Krämer
|
||||
*/
|
||||
|
||||
$drivers['firebird'] = 'Firebird (alpha)';
|
||||
|
||||
add_driver('firebird', 'Firebird (alpha)');
|
||||
|
||||
if (isset($_GET["firebird"])) {
|
||||
define("DRIVER", "firebird");
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$drivers["simpledb"] = "SimpleDB";
|
||||
add_driver("simpledb", "SimpleDB");
|
||||
|
||||
if (isset($_GET["simpledb"])) {
|
||||
define("DRIVER", "simpledb");
|
Loading…
Reference in a new issue