Skip to content

Commit

Permalink
Merge pull request #189 from peviitor-ro/nou-3
Browse files Browse the repository at this point in the history
update v1/logo/delete
  • Loading branch information
sebiboga committed Jul 6, 2024
2 parents f5c66f1 + 5258cfc commit 1c82597
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions v1/logo/delete/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
header("Access-Control-Allow-Origin: *");

/**
* @OA\Post(
* path="/v1/logo/delete/",
Expand Down Expand Up @@ -30,20 +31,21 @@
* )
*/

function get_server(){
//get the IP of the server
//we need a config file to know where is the SOLR
require('../../../_config/index.php');
return $server;
}

$method = 'POST';
$server = get_server();
$server = 'zimbor.go.ro:8985';
$core = 'auth';
$command ='/update';
$qs = '?_=1617366504771&commitWithin=1000&overwrite=true&wt=json';

$qs = '?';
$qs = $qs . '_=1617366504771';
$qs = $qs . '&';
$qs = $qs . 'commitWithin=1000';
$qs = $qs . '&';
$qs = $qs . 'overwrite=true';
$qs = $qs . '&';
$qs = $qs . 'wt=json';

$url = 'http://' . $server . $core . $command . $qs;

$company = $_POST['company'];
$data = "{'delete': {'query': 'id:".$company."'}}";
Expand All @@ -57,10 +59,7 @@ function get_server(){
);
$context = stream_context_create($options);

foreach ($server as $solrurl) {
$url = $solrurl.$core.$command.$qs;
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo $result; }
}

?>
?>

0 comments on commit 1c82597

Please sign in to comment.