fix: Use spaces entirely

pull/3479/head
Hannah Ward 2018-07-10 17:06:56 +01:00
parent 09aacabe26
commit a62b23088e
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 15 additions and 15 deletions

View File

@ -6,20 +6,20 @@ class ElasticSearchClient {
private $__settings = false;
private $__client = false;
private function __getSetSettings() {
$settings = array(
'enabled' => false,
'connection_string' => 'http://localhost',
);
private function __getSetSettings() {
$settings = array(
'enabled' => false,
'connection_string' => 'http://localhost',
);
foreach ($settings as $key => $setting) {
foreach ($settings as $key => $setting) {
$temp = Configure::read('Plugin.ElasticSearch_' . $key);
if ($temp) $settings[$key] = $temp;
}
return $settings;
}
if ($temp) $settings[$key] = $temp;
}
return $settings;
}
public function initTool() {
public function initTool() {
$settings = $this->__getSetSettings();
$hosts = explode(",", $settings["connection_string"]);
$client = ClientBuilder::create()
@ -27,10 +27,10 @@ class ElasticSearchClient {
->build();
$this->__client = $client;
$this->__settings = $settings;
return $client;
}
return $client;
}
public function pushDocument($index, $document_type, $document) {
public function pushDocument($index, $document_type, $document) {
// Format timestamp
$time = strftime("%Y-%m-%d %H:%M:%S", strtotime($document["Log"]["created"]));
$document["Log"]["created"] = $time;
@ -41,5 +41,5 @@ class ElasticSearchClient {
);
$this->__client->index($params);
}
}
}