mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 09:04:02 +02:00
Elasticsearch: Implemented function create_database()
This commit is contained in:
@@ -9,9 +9,10 @@ if (isset($_GET["elastic"])) {
|
||||
class Min_DB {
|
||||
var $extension = "JSON", $server_info, $errno, $error, $_url;
|
||||
|
||||
function query($path, $content = array()) {
|
||||
function query($path, $content = array(), $method = 'GET') {
|
||||
@ini_set('track_errors', 1); // @ - may be disabled
|
||||
$file = @file_get_contents($this->_url . ($this->_db != "" ? "$this->_db/" : "") . $path, false, stream_context_create(array('http' => array(
|
||||
'method' => $method,
|
||||
'content' => json_encode($content),
|
||||
'ignore_errors' => 1, // available since PHP 5.2.10
|
||||
))));
|
||||
@@ -278,6 +279,15 @@ if (isset($_GET["elastic"])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Create database
|
||||
* @param string
|
||||
* @return mixed
|
||||
*/
|
||||
function create_database($db) {
|
||||
global $connection;
|
||||
return $connection->query(urlencode($db), array(), 'PUT');
|
||||
}
|
||||
|
||||
$jush = "elastic";
|
||||
$operators = array("=", "query");
|
||||
$functions = array();
|
||||
|
Reference in New Issue
Block a user