mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 08:34:20 +02:00
PHP: Use ?:
This commit is contained in:
@@ -57,7 +57,7 @@ if (isset($_GET["clickhouse"])) {
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
preg_match('~^(https?://)?(.*)~', $server, $match);
|
||||
$this->_url = ($match[1] ? $match[1] : "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
|
||||
$this->_url = ($match[1] ?: "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
|
||||
$return = $this->query('SELECT 1');
|
||||
return (bool) $return;
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ if (isset($_GET["elastic"])) {
|
||||
*/
|
||||
function connect($server, $username, $password) {
|
||||
preg_match('~^(https?://)?(.*)~', $server, $match);
|
||||
$this->_url = ($match[1] ? $match[1] : "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
|
||||
$this->_url = ($match[1] ?: "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
|
||||
$return = $this->query('');
|
||||
if ($return) {
|
||||
$this->server_info = $return['version']['number'];
|
||||
@@ -529,7 +529,7 @@ if (isset($_GET["elastic"])) {
|
||||
$properties = array();
|
||||
foreach ($fields as $f) {
|
||||
$field_name = trim($f[1][0]);
|
||||
$field_type = trim($f[1][1] ? $f[1][1] : "text");
|
||||
$field_type = trim($f[1][1] ?: "text");
|
||||
$properties[$field_name] = array(
|
||||
'type' => $field_type
|
||||
);
|
||||
|
@@ -68,7 +68,7 @@ if (isset($_GET["elastic5"])) {
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
preg_match('~^(https?://)?(.*)~', $server, $match);
|
||||
$this->_url = ($match[1] ? $match[1] : "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
|
||||
$this->_url = ($match[1] ?: "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
|
||||
$return = $this->query('');
|
||||
if ($return) {
|
||||
$this->server_info = $return['version']['number'];
|
||||
@@ -505,7 +505,7 @@ if (isset($_GET["elastic5"])) {
|
||||
$properties = array();
|
||||
foreach ($fields as $f) {
|
||||
$field_name = trim($f[1][0]);
|
||||
$field_type = trim($f[1][1] ? $f[1][1] : "text");
|
||||
$field_type = trim($f[1][1] ?: "text");
|
||||
$properties[$field_name] = array(
|
||||
'type' => $field_type
|
||||
);
|
||||
|
@@ -439,7 +439,7 @@ if (isset($_GET["simpledb"])) {
|
||||
}
|
||||
$connection->error = '';
|
||||
$tag = $action . "Result";
|
||||
return ($xml->$tag ? $xml->$tag : true);
|
||||
return ($xml->$tag ?: true);
|
||||
}
|
||||
|
||||
function sdb_request_all($action, $tag, $params = array(), $timeout = 0) {
|
||||
|
Reference in New Issue
Block a user