Fix style
This commit is contained in:
parent
a592ad52f1
commit
c002009bfe
|
@ -12,7 +12,7 @@ if (isset($_GET["clickhouse"])) {
|
||||||
@ini_set('track_errors', 1); // @ - may be disabled
|
@ini_set('track_errors', 1); // @ - may be disabled
|
||||||
$file = @file_get_contents("$this->_url/?database=$db", false, stream_context_create(array('http' => array(
|
$file = @file_get_contents("$this->_url/?database=$db", false, stream_context_create(array('http' => array(
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => $this->is_query_select_like($query) ? ($query.' FORMAT JSONCompact') : $query,
|
'content' => $this->isQuerySelectLike($query) ? "$query FORMAT JSONCompact" : $query,
|
||||||
'header' => 'Content-type: application/x-www-form-urlencoded',
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
'ignore_errors' => 1, // available since PHP 5.2.10
|
'ignore_errors' => 1, // available since PHP 5.2.10
|
||||||
))));
|
))));
|
||||||
|
@ -43,7 +43,7 @@ if (isset($_GET["clickhouse"])) {
|
||||||
return new Min_Result($return);
|
return new Min_Result($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_query_select_like($query) {
|
function isQuerySelectLike($query) {
|
||||||
return (bool) preg_match('~^(select|show)~i', $query);
|
return (bool) preg_match('~^(select|show)~i', $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ if (isset($_GET["clickhouse"])) {
|
||||||
foreach ($set as $key => $val) {
|
foreach ($set as $key => $val) {
|
||||||
$values[] = "$key = $val";
|
$values[] = "$key = $val";
|
||||||
}
|
}
|
||||||
$query = "$separator" . implode(",$separator", $values);
|
$query = $separator . implode(",$separator", $values);
|
||||||
return queries("ALTER TABLE " . table($table) . " UPDATE $query$queryWhere");
|
return queries("ALTER TABLE " . table($table) . " UPDATE $query$queryWhere");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue