From afe412107ebf2f1123f41de4d00d4fd1051be339 Mon Sep 17 00:00:00 2001 From: merelendor Date: Mon, 5 Aug 2024 22:02:58 +0300 Subject: [PATCH] move ElasticSearch credentials to dbconn.php --- local/ilsa_update.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/local/ilsa_update.php b/local/ilsa_update.php index 4c8524f..766d9d7 100644 --- a/local/ilsa_update.php +++ b/local/ilsa_update.php @@ -86,16 +86,13 @@ $repost_cars = []; function elasticIndex($index, $payload) { - define("ELASTIC_USERNAME", "elastic"); - define("ELASTIC_PASSWORD", "DFbC769Ln0weJL33mtMXGbpJOK4RCJfx"); - $uid = implode("_", array_merge([ "date" => date("Ymd") ], array_intersect_key($payload, array_flip(['brand', 'model', 'modification'])))); print "uid = ".$uid." | ".$payload['status']."\n"; $id = md5($uid); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "https://els.quickcode.ru/".$index."/_doc/".$id."/"); - curl_setopt($ch, CURLOPT_USERPWD, ELASTIC_USERNAME . ":" . ELASTIC_PASSWORD); + curl_setopt($ch, CURLOPT_URL, ELASTICSEARCH_HOST.$index."/_doc/".$id."/"); + curl_setopt($ch, CURLOPT_USERPWD, ELASTICSEARCH_USERNAME . ":" . ELASTICSEARCH_PASSWORD); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_TIMEOUT, 2000); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);