123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988 |
- <?php
- class nusoap_client extends nusoap_base
- {
- var $username = '';
- var $password = '';
- var $authtype = '';
- var $certRequest = array();
- var $requestHeaders = false;
- var $responseHeaders = '';
- var $responseHeader = NULL;
- var $document = '';
- var $endpoint;
- var $forceEndpoint = '';
- var $proxyhost = '';
- var $proxyport = '';
- var $proxyusername = '';
- var $proxypassword = '';
- var $portName = '';
- var $xml_encoding = '';
- var $http_encoding = false;
- var $timeout = 0;
- var $response_timeout = 30;
- var $endpointType = '';
- var $persistentConnection = false;
- var $defaultRpcParams = false;
- var $request = '';
- var $response = '';
- var $responseData = '';
- var $cookies = array();
- var $decode_utf8 = true;
- var $operations = array();
- var $curl_options = array();
- var $bindingType = '';
- var $use_curl = false;
-
-
- var $fault;
-
- var $faultcode;
-
- var $faultstring;
-
- var $faultdetail;
-
- function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){
- parent::__construct();
- $this->endpoint = $endpoint;
- $this->proxyhost = $proxyhost;
- $this->proxyport = $proxyport;
- $this->proxyusername = $proxyusername;
- $this->proxypassword = $proxypassword;
- $this->timeout = $timeout;
- $this->response_timeout = $response_timeout;
- $this->portName = $portName;
- $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
- $this->appendDebug('endpoint=' . $this->varDump($endpoint));
-
- if($wsdl){
- if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
- $this->wsdl = $endpoint;
- $this->endpoint = $this->wsdl->wsdl;
- $this->wsdlFile = $this->endpoint;
- $this->debug('existing wsdl instance created from ' . $this->endpoint);
- $this->checkWSDL();
- } else {
- $this->wsdlFile = $this->endpoint;
- $this->wsdl = null;
- $this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint);
- }
- $this->endpointType = 'wsdl';
- } else {
- $this->debug("instantiate SOAP with endpoint at $endpoint");
- $this->endpointType = 'soap';
- }
- }
-
- function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAction='',$headers=false,$rpcParams=null,$style='rpc',$use='encoded'){
- $this->operation = $operation;
- $this->fault = false;
- $this->setError('');
- $this->request = '';
- $this->response = '';
- $this->responseData = '';
- $this->faultstring = '';
- $this->faultcode = '';
- $this->opData = array();
- $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType");
- $this->appendDebug('params=' . $this->varDump($params));
- $this->appendDebug('headers=' . $this->varDump($headers));
- if ($headers) {
- $this->requestHeaders = $headers;
- }
- if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
- $this->loadWSDL();
- if ($this->getError())
- return false;
- }
-
- if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){
-
- $this->opData = $opData;
- $this->debug("found operation");
- $this->appendDebug('opData=' . $this->varDump($opData));
- if (isset($opData['soapAction'])) {
- $soapAction = $opData['soapAction'];
- }
- if (! $this->forceEndpoint) {
- $this->endpoint = $opData['endpoint'];
- } else {
- $this->endpoint = $this->forceEndpoint;
- }
- $namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] : $namespace;
- $style = $opData['style'];
- $use = $opData['input']['use'];
-
- if($namespace != '' && !isset($this->wsdl->namespaces[$namespace])){
- $nsPrefix = 'ns' . rand(1000, 9999);
- $this->wsdl->namespaces[$nsPrefix] = $namespace;
- }
- $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace);
-
- if (is_string($params)) {
- $this->debug("serializing param string for WSDL operation $operation");
- $payload = $params;
- } elseif (is_array($params)) {
- $this->debug("serializing param array for WSDL operation $operation");
- $payload = $this->wsdl->serializeRPCParameters($operation,'input',$params,$this->bindingType);
- } else {
- $this->debug('params must be array or string');
- $this->setError('params must be array or string');
- return false;
- }
- $usedNamespaces = $this->wsdl->usedNamespaces;
- if (isset($opData['input']['encodingStyle'])) {
- $encodingStyle = $opData['input']['encodingStyle'];
- } else {
- $encodingStyle = '';
- }
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- if ($errstr = $this->wsdl->getError()) {
- $this->debug('got wsdl error: '.$errstr);
- $this->setError('wsdl error: '.$errstr);
- return false;
- }
- } elseif($this->endpointType == 'wsdl') {
-
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- $this->setError('operation '.$operation.' not present in WSDL.');
- $this->debug("operation '$operation' not present in WSDL.");
- return false;
- } else {
-
-
- $nsPrefix = 'ns' . rand(1000, 9999);
-
- $payload = '';
- if (is_string($params)) {
- $this->debug("serializing param string for operation $operation");
- $payload = $params;
- } elseif (is_array($params)) {
- $this->debug("serializing param array for operation $operation");
- foreach($params as $k => $v){
- $payload .= $this->serialize_val($v,$k,false,false,false,false,$use);
- }
- } else {
- $this->debug('params must be array or string');
- $this->setError('params must be array or string');
- return false;
- }
- $usedNamespaces = array();
- if ($use == 'encoded') {
- $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
- } else {
- $encodingStyle = '';
- }
- }
-
- if ($style == 'rpc') {
- if ($use == 'literal') {
- $this->debug("wrapping RPC request with literal method element");
- if ($namespace) {
-
- $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
- $payload .
- "</$nsPrefix:$operation>";
- } else {
- $payload = "<$operation>" . $payload . "</$operation>";
- }
- } else {
- $this->debug("wrapping RPC request with encoded method element");
- if ($namespace) {
- $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
- $payload .
- "</$nsPrefix:$operation>";
- } else {
- $payload = "<$operation>" .
- $payload .
- "</$operation>";
- }
- }
- }
-
- $soapmsg = $this->serializeEnvelope($payload,$this->requestHeaders,$usedNamespaces,$style,$use,$encodingStyle);
- $this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle");
- $this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000));
-
- $return = $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout);
- if($errstr = $this->getError()){
- $this->debug('Error: '.$errstr);
- return false;
- } else {
- $this->return = $return;
- $this->debug('sent message successfully and got a(n) '.gettype($return));
- $this->appendDebug('return=' . $this->varDump($return));
-
- if(is_array($return) && isset($return['faultcode'])){
- $this->debug('got fault');
- $this->setError($return['faultcode'].': '.$return['faultstring']);
- $this->fault = true;
- foreach($return as $k => $v){
- $this->$k = $v;
- $this->debug("$k = $v<br>");
- }
- return $return;
- } elseif ($style == 'document') {
-
-
- return $return;
- } else {
-
- if(is_array($return)){
-
-
- if(sizeof($return) > 1){
- return $return;
- }
-
- $return = array_shift($return);
- $this->debug('return shifted value: ');
- $this->appendDebug($this->varDump($return));
- return $return;
-
- } else {
- return "";
- }
- }
- }
- }
-
- function checkWSDL() {
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- $this->debug('checkWSDL');
-
- if ($errstr = $this->wsdl->getError()) {
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- $this->debug('got wsdl error: '.$errstr);
- $this->setError('wsdl error: '.$errstr);
- } elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap')) {
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- $this->bindingType = 'soap';
- $this->debug('got '.count($this->operations).' operations from wsdl '.$this->wsdlFile.' for binding type '.$this->bindingType);
- } elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap12')) {
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- $this->bindingType = 'soap12';
- $this->debug('got '.count($this->operations).' operations from wsdl '.$this->wsdlFile.' for binding type '.$this->bindingType);
- $this->debug('**************** WARNING: SOAP 1.2 BINDING *****************');
- } else {
- $this->appendDebug($this->wsdl->getDebug());
- $this->wsdl->clearDebug();
- $this->debug('getOperations returned false');
- $this->setError('no operations defined in the WSDL document!');
- }
- }
-
- function loadWSDL() {
- $this->debug('instantiating wsdl class with doc: '.$this->wsdlFile);
- $this->wsdl = new wsdl('',$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout,$this->curl_options,$this->use_curl);
- $this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest);
- $this->wsdl->fetchWSDL($this->wsdlFile);
- $this->checkWSDL();
- }
-
- function getOperationData($operation){
- if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
- $this->loadWSDL();
- if ($this->getError())
- return false;
- }
- if(isset($this->operations[$operation])){
- return $this->operations[$operation];
- }
- $this->debug("No data for operation: $operation");
- }
-
- function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) {
- $this->checkCookies();
-
- switch(true){
-
- case preg_match('/^http/',$this->endpoint):
- $this->debug('transporting via HTTP');
- if($this->persistentConnection == true && is_object($this->persistentConnection)){
- $http =& $this->persistentConnection;
- } else {
- $http = new soap_transport_http($this->endpoint, $this->curl_options, $this->use_curl);
- if ($this->persistentConnection) {
- $http->usePersistentConnection();
- }
- }
- $http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset());
- $http->setSOAPAction($soapaction);
- if($this->proxyhost && $this->proxyport){
- $http->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
- }
- if($this->authtype != '') {
- $http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
- }
- if($this->http_encoding != ''){
- $http->setEncoding($this->http_encoding);
- }
- $this->debug('sending message, length='.strlen($msg));
- if(preg_match('/^http:/',$this->endpoint)){
-
- $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
- } elseif(preg_match('/^https/',$this->endpoint)){
-
-
-
-
-
-
- $this->responseData = $http->sendHTTPS($msg,$timeout,$response_timeout,$this->cookies);
- } else {
- $this->setError('no http/s in endpoint url');
- }
- $this->request = $http->outgoing_payload;
- $this->response = $http->incoming_payload;
- $this->appendDebug($http->getDebug());
- $this->UpdateCookies($http->incoming_cookies);
-
- if ($this->persistentConnection) {
- $http->clearDebug();
- if (!is_object($this->persistentConnection)) {
- $this->persistentConnection = $http;
- }
- }
- if($err = $http->getError()){
- $this->setError('HTTP Error: '.$err);
- return false;
- } elseif($this->getError()){
- return false;
- } else {
- $this->debug('got response, length='. strlen($this->responseData).' type='.$http->incoming_headers['content-type']);
- return $this->parseResponse($http->incoming_headers, $this->responseData);
- }
- break;
- default:
- $this->setError('no transport found, or selected transport is not yet supported!');
- return false;
- break;
- }
- }
-
- function parseResponse($headers, $data) {
- $this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:');
- $this->appendDebug($this->varDump($headers));
- if (!isset($headers['content-type'])) {
- $this->setError('Response not of type text/xml (no content-type header)');
- return false;
- }
- if (!strstr($headers['content-type'], 'text/xml')) {
- $this->setError('Response not of type text/xml: ' . $headers['content-type']);
- return false;
- }
- if (strpos($headers['content-type'], '=')) {
- $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
- $this->debug('Got response encoding: ' . $enc);
- if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
- $this->xml_encoding = strtoupper($enc);
- } else {
- $this->xml_encoding = 'US-ASCII';
- }
- } else {
-
- $this->xml_encoding = 'ISO-8859-1';
- }
- $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser');
- $parser = new nusoap_parser($data,$this->xml_encoding,$this->operation,$this->decode_utf8);
-
- $this->appendDebug($parser->getDebug());
-
- if($errstr = $parser->getError()){
- $this->setError( $errstr);
-
- unset($parser);
- return false;
- } else {
-
- $this->responseHeaders = $parser->getHeaders();
-
- $this->responseHeader = $parser->get_soapheader();
-
- $return = $parser->get_soapbody();
-
- $this->document = $parser->document;
-
- unset($parser);
-
- return $return;
- }
- }
-
- function setCurlOption($option, $value) {
- $this->debug("setCurlOption option=$option, value=");
- $this->appendDebug($this->varDump($value));
- $this->curl_options[$option] = $value;
- }
-
- function setEndpoint($endpoint) {
- $this->debug("setEndpoint(\"$endpoint\")");
- $this->forceEndpoint = $endpoint;
- }
-
- function setHeaders($headers){
- $this->debug("setHeaders headers=");
- $this->appendDebug($this->varDump($headers));
- $this->requestHeaders = $headers;
- }
-
- function getHeaders(){
- return $this->responseHeaders;
- }
-
- function getHeader(){
- return $this->responseHeader;
- }
-
- function setHTTPProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
- $this->proxyhost = $proxyhost;
- $this->proxyport = $proxyport;
- $this->proxyusername = $proxyusername;
- $this->proxypassword = $proxypassword;
- }
-
- function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) {
- $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
- $this->appendDebug($this->varDump($certRequest));
- $this->username = $username;
- $this->password = $password;
- $this->authtype = $authtype;
- $this->certRequest = $certRequest;
- }
-
- function setHTTPEncoding($enc='gzip, deflate'){
- $this->debug("setHTTPEncoding(\"$enc\")");
- $this->http_encoding = $enc;
- }
-
- function setUseCURL($use) {
- $this->debug("setUseCURL($use)");
- $this->use_curl = $use;
- }
-
- function useHTTPPersistentConnection(){
- $this->debug("useHTTPPersistentConnection");
- $this->persistentConnection = true;
- }
-
- function getDefaultRpcParams() {
- return $this->defaultRpcParams;
- }
-
- function setDefaultRpcParams($rpcParams) {
- $this->defaultRpcParams = $rpcParams;
- }
-
- function getProxy() {
- $r = rand();
- $evalStr = $this->_getProxyClassCode($r);
-
- if ($this->getError()) {
- $this->debug("Error from _getProxyClassCode, so return NULL");
- return null;
- }
-
- eval($evalStr);
-
- eval("\$proxy = new nusoap_proxy_$r('');");
-
- $proxy->endpointType = 'wsdl';
- $proxy->wsdlFile = $this->wsdlFile;
- $proxy->wsdl = $this->wsdl;
- $proxy->operations = $this->operations;
- $proxy->defaultRpcParams = $this->defaultRpcParams;
-
- $proxy->soap_defencoding = $this->soap_defencoding;
- $proxy->username = $this->username;
- $proxy->password = $this->password;
- $proxy->authtype = $this->authtype;
- $proxy->certRequest = $this->certRequest;
- $proxy->requestHeaders = $this->requestHeaders;
- $proxy->endpoint = $this->endpoint;
- $proxy->forceEndpoint = $this->forceEndpoint;
- $proxy->proxyhost = $this->proxyhost;
- $proxy->proxyport = $this->proxyport;
- $proxy->proxyusername = $this->proxyusername;
- $proxy->proxypassword = $this->proxypassword;
- $proxy->http_encoding = $this->http_encoding;
- $proxy->timeout = $this->timeout;
- $proxy->response_timeout = $this->response_timeout;
- $proxy->persistentConnection = &$this->persistentConnection;
- $proxy->decode_utf8 = $this->decode_utf8;
- $proxy->curl_options = $this->curl_options;
- $proxy->bindingType = $this->bindingType;
- $proxy->use_curl = $this->use_curl;
- return $proxy;
- }
-
- function _getProxyClassCode($r) {
- $this->debug("in getProxy endpointType=$this->endpointType");
- $this->appendDebug("wsdl=" . $this->varDump($this->wsdl));
- if ($this->endpointType != 'wsdl') {
- $evalStr = 'A proxy can only be created for a WSDL client';
- $this->setError($evalStr);
- $evalStr = "echo \"$evalStr\";";
- return $evalStr;
- }
- if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
- $this->loadWSDL();
- if ($this->getError()) {
- return "echo \"" . $this->getError() . "\";";
- }
- }
- $evalStr = '';
- foreach ($this->operations as $operation => $opData) {
- if ($operation != '') {
-
- if (sizeof($opData['input']['parts']) > 0) {
- $paramStr = '';
- $paramArrayStr = '';
- $paramCommentStr = '';
- foreach ($opData['input']['parts'] as $name => $type) {
- $paramStr .= "\$$name, ";
- $paramArrayStr .= "'$name' => \$$name, ";
- $paramCommentStr .= "$type \$$name, ";
- }
- $paramStr = substr($paramStr, 0, strlen($paramStr)-2);
- $paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr)-2);
- $paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr)-2);
- } else {
- $paramStr = '';
- $paramArrayStr = '';
- $paramCommentStr = 'void';
- }
- $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
- $evalStr .= "// $paramCommentStr
- function " . str_replace('.', '__', $operation) . "($paramStr) {
- \$params = array($paramArrayStr);
- return \$this->call('$operation', \$params, '".$opData['namespace']."', '".(isset($opData['soapAction']) ? $opData['soapAction'] : '')."');
- }
- ";
- unset($paramStr);
- unset($paramCommentStr);
- }
- }
- $evalStr = 'class nusoap_proxy_'.$r.' extends nusoap_client {
- '.$evalStr.'
- }';
- return $evalStr;
- }
-
- function getProxyClassCode() {
- $r = rand();
- return $this->_getProxyClassCode($r);
- }
-
- function getHTTPBody($soapmsg) {
- return $soapmsg;
- }
-
- function getHTTPContentType() {
- return 'text/xml';
- }
-
- function getHTTPContentTypeCharset() {
- return $this->soap_defencoding;
- }
-
- function decodeUTF8($bool){
- $this->decode_utf8 = $bool;
- return true;
- }
-
- function setCookie($name, $value) {
- if (strlen($name) == 0) {
- return false;
- }
- $this->cookies[] = array('name' => $name, 'value' => $value);
- return true;
- }
-
- function getCookies() {
- return $this->cookies;
- }
-
- function checkCookies() {
- if (sizeof($this->cookies) == 0) {
- return true;
- }
- $this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
- $curr_cookies = $this->cookies;
- $this->cookies = array();
- foreach ($curr_cookies as $cookie) {
- if (! is_array($cookie)) {
- $this->debug('Remove cookie that is not an array');
- continue;
- }
- if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
- if (strtotime($cookie['expires']) > time()) {
- $this->cookies[] = $cookie;
- } else {
- $this->debug('Remove expired cookie ' . $cookie['name']);
- }
- } else {
- $this->cookies[] = $cookie;
- }
- }
- $this->debug('checkCookie: '.sizeof($this->cookies).' cookies left in array');
- return true;
- }
-
- function UpdateCookies($cookies) {
- if (sizeof($this->cookies) == 0) {
-
- if (sizeof($cookies) > 0) {
- $this->debug('Setting new cookie(s)');
- $this->cookies = $cookies;
- }
- return true;
- }
- if (sizeof($cookies) == 0) {
-
- return true;
- }
-
- foreach ($cookies as $newCookie) {
- if (!is_array($newCookie)) {
- continue;
- }
- if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) {
- continue;
- }
- $newName = $newCookie['name'];
- $found = false;
- for ($i = 0; $i < count($this->cookies); $i++) {
- $cookie = $this->cookies[$i];
- if (!is_array($cookie)) {
- continue;
- }
- if (!isset($cookie['name'])) {
- continue;
- }
- if ($newName != $cookie['name']) {
- continue;
- }
- $newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN';
- $domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN';
- if ($newDomain != $domain) {
- continue;
- }
- $newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH';
- $path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH';
- if ($newPath != $path) {
- continue;
- }
- $this->cookies[$i] = $newCookie;
- $found = true;
- $this->debug('Update cookie ' . $newName . '=' . $newCookie['value']);
- break;
- }
- if (! $found) {
- $this->debug('Add cookie ' . $newName . '=' . $newCookie['value']);
- $this->cookies[] = $newCookie;
- }
- }
- return true;
- }
- }
- if (!extension_loaded('soap')) {
-
- class soapclient extends nusoap_client {
- }
- }
- ?>
|