Skip to content
Snippets Groups Projects
Commit 5418196a authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

FEAT #4542 PEAR SOAP FOR PHP7

parent 1aad963e
No related branches found
No related tags found
No related merge requests found
<?php <?php
require_once('SOAP/Disco.php'); if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
require_once('apps/maarch_entreprise/tools/PEAR/SOAP/Disco.php');
} else {
require_once('SOAP/Disco.php');
}
require_once('core/class/Url.php'); require_once('core/class/Url.php');
class Maarch_SOAP_DISCO_Server extends SOAP_DISCO_Server class Maarch_SOAP_DISCO_Server extends SOAP_DISCO_Server
{ {
public function __construct() public function __construct($server, $service_name = 'MaarchSoapServer')
{ {
$funcGetArgs = func_get_args(); if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
call_user_func_array(array(parent, 'SOAP_DISCO_Server'), $SOAP_DISCO_Server = new SOAP_DISCO_Server($server, $service_name);
$funcGetArgs);
$this->soap_server = $SOAP_DISCO_Server->soap_server;
$this->soap_server->_namespaces = $SOAP_DISCO_Server->namespaces;
$this->_service_name = $service_name;
$this->_service_ns = "urn:$service_name";
} else {
$funcGetArgs = func_get_args();
call_user_func_array(array(parent, 'SOAP_DISCO_Server'),
$funcGetArgs);
}
$this->host = array_key_exists('HTTP_X_FORWARDED_HOST', $_SERVER) $this->host = array_key_exists('HTTP_X_FORWARDED_HOST', $_SERVER)
? $_SERVER['HTTP_X_FORWARDED_HOST'] ? $_SERVER['HTTP_X_FORWARDED_HOST']
: $_SERVER['HTTP_HOST']; : $_SERVER['HTTP_HOST'];
......
...@@ -92,10 +92,11 @@ class MaarchSoapServer extends webService { ...@@ -92,10 +92,11 @@ class MaarchSoapServer extends webService {
* import of the SOAP library * import of the SOAP library
*/ */
function importSOAPLibs() { function importSOAPLibs() {
require ('SOAP/Server.php'); if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
/* require ('apps/maarch_entreprise/tools/PEAR/SOAP/Server.php');
require ('SOAP/Disco.php'); } else {
*/ require ('SOAP/Server.php');
}
} }
/** /**
......
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