echo "adminer/file.inc.php: Caching headers placeholder not found\n";
}
}
- if ($driver && dirname($match[2]) == "../adminer/drivers") {
+ if ($driver && preg_match('~/drivers/~', $match[2])) {
$return = preg_replace('~^if \(isset\(\$_GET\["' . $driver . '"]\)\) \{(.*)^}~ms', '\1', $return);
// check function definition in drivers
if ($driver != "mysql") {
}
$driver = "";
-if (file_exists(__DIR__ . "/adminer/drivers/" . $_SERVER["argv"][1] . ".inc.php")) {
+$driver_path = "/adminer/drivers/" . $_SERVER["argv"][1] . ".inc.php";
+if (!file_exists(__DIR__ . $driver_path)) {
+ $driver_path = "/plugins/drivers/" . $_SERVER["argv"][1] . ".php";
+}
+if (file_exists(__DIR__ . $driver_path)) {
$driver = $_SERVER["argv"][1];
array_shift($_SERVER["argv"]);
}
$file = file_get_contents(__DIR__ . "/$project/index.php");
if ($driver) {
$_GET[$driver] = true; // to load the driver
- include_once __DIR__ . "/adminer/drivers/$driver.inc.php";
+ include_once __DIR__ . $driver_path;
foreach ($features as $key => $feature) {
if (!support($feature)) {
if (!is_int($key)) {
$file = preg_replace_callback('~\b(include|require) "([^"]*)";~', 'put_file', $file);
$file = str_replace('include "../adminer/include/coverage.inc.php";', '', $file);
if ($driver) {
+ if (preg_match('~^/plugins/~', $driver_path)) {
+ $file = preg_replace('((include "..)/adminer/drivers/mysql.inc.php)', "\\1$driver_path", $file);
+ }
$file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($driver) . '\.).*\s*)', '', $file);
}
$file = preg_replace_callback('~\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php