Skip to content

Commit

Permalink
Merge pull request #188 from peviitor-ro/nou-1
Browse files Browse the repository at this point in the history
updated v1/logo/add
  • Loading branch information
sebiboga committed Jul 6, 2024
2 parents 1c82597 + 7f1a46d commit ccdeea7
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions v1/logo/add/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/add/",
Expand All @@ -26,23 +27,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;

$data = file_get_contents('php://input');

Expand All @@ -53,12 +52,10 @@ function get_server()
'content' => $data
)
);

$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;
}
}
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
echo $result;
}

0 comments on commit ccdeea7

Please sign in to comment.