Skip to content
Snippets Groups Projects
Verified Commit 45ec7cfb authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX M2M get return

parent 8172eeb3
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,8 @@
require_once __DIR__. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Transfer.php';
require_once __DIR__. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'RequestSeda.php';
class AdapterWS{
class AdapterWS
{
private $db;
public function __construct()
{
......@@ -25,4 +25,4 @@ class AdapterWS{
$this->db->updateStatusMessage($messageObject->MessageIdentifier->value, 'S');
}
}
\ No newline at end of file
}
......@@ -2,8 +2,10 @@
require_once __DIR__ . '/AdapterMaarchRM.php';
require_once __DIR__ . '/AdapterMaarchCourrier.php';
class Transfer{
public function __construct(){
class Transfer
{
public function __construct()
{
$getXml = false;
$path = '';
if (file_exists(
......@@ -17,7 +19,7 @@ class Transfer{
. DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
. DIRECTORY_SEPARATOR . 'config.xml';
$getXml = true;
} else if (file_exists($_SESSION['config']['corepath'] . 'modules' . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'config.xml')) {
} elseif (file_exists($_SESSION['config']['corepath'] . 'modules' . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'config.xml')) {
$path = $_SESSION['config']['corepath'] . 'modules' . DIRECTORY_SEPARATOR . 'export_seda'
. DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'config.xml';
$getXml = true;
......@@ -60,7 +62,7 @@ class Transfer{
curl_setopt($curl, CURLOPT_HTTPHEADER, $param[1]);
curl_setopt($curl, CURLOPT_COOKIE, $param[2]);
curl_setopt($curl, CURLOPT_POSTFIELDS, $param[3]);
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
if (empty($this->xml->CONFIG->certificateSSL)) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
......@@ -92,14 +94,13 @@ class Transfer{
$exec = curl_exec($curl);
$data = json_decode($exec);
if (!$data) {
if (!$data || !empty($data->errors)) {
$res['status'] = 1;
if (curl_error($curl)) {
$res['content'] = curl_error($curl);
} else {
$res['content'] = $exec;
$res['content'] = $data->errors;
}
} else {
$res['content'] = $data;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment