case (is_array($val) || $type):
// detect if struct or array
$valueType = $this->isArraySimpleOrStruct($val);
- if($valueType=='arraySimple' || preg('^ArrayOf',$type)){
+ if($valueType=='arraySimple' || preg_match('^ArrayOf',$type)){
$i = 0;
if(is_array($val) && count($val)> 0){
foreach($val as $v){
*/
function expandQname($qname){
// get element prefix
- if(strpos($qname,':') && !preg('^http://',$qname)){
+ if(strpos($qname,':') && !preg_match('^http://',$qname)){
// get unqualified name
$name = substr(strstr($qname,':'),1);
// get ns prefix
'([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
- if(preg($pregStr,$datestr,$regs)){
+ if(preg_match($pregStr,$datestr,$regs)){
return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
}
return false;
'([0-9]{2}):'. // minutes mm:
'([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
- if(preg($pregStr,$datestr,$regs)){
+ if(preg_match($pregStr,$datestr,$regs)){
// not utc
if($regs[8] != 'Z'){
$op = substr($regs[8],0,1);
if(count($attrs) > 0){
foreach($attrs as $k => $v){
// if ns declarations, add to class level array of valid namespaces
- if(preg("^xmlns",$k)){
+ if(preg_match("^xmlns",$k)){
//$this->xdebug("$k: $v");
//$this->xdebug('ns_prefix: '.$this->getPrefix($k));
if($ns_prefix = substr(strrchr($k,':'),1)){
$this->currentComplexType = $attrs['name'];
$this->complexTypes[$this->currentComplexType] = $attrs;
$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
- if(isset($attrs['base']) && preg(':Array$',$attrs['base'])){
+ if(isset($attrs['base']) && preg_match(':Array$',$attrs['base'])){
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
} else {
$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
$this->currentElement = false;
$this->complexTypes[$this->currentComplexType] = $attrs;
$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
- if(isset($attrs['base']) && preg(':Array$',$attrs['base'])){
+ if(isset($attrs['base']) && preg_match(':Array$',$attrs['base'])){
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
} else {
$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
*/
function soap_transport_http($url){
$this->setURL($url);
- preg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+ preg_match('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
$this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
}
}
}
// remove 100 header
- if(isset($lb) && preg('^HTTP/1.1 100',$data)){
+ if(isset($lb) && preg_match('^HTTP/1.1 100',$data)){
unset($lb);
$data = '';
}//
curl_close($this->ch);
// remove 100 header
- if (preg('^HTTP/1.1 100',$data)) {
+ if (preg_match('^HTTP/1.1 100',$data)) {
if ($pos = strpos($data,"\r\n\r\n")) {
$data = ltrim(substr($data,$pos));
} elseif($pos = strpos($data,"\n\n") ) {
$qs = $QUERY_STRING;
}
- if(isset($qs) && preg('wsdl', $qs) ){
+ if(isset($qs) && preg_match('wsdl', $qs) ){
// This is a request for WSDL
if($this->externalWSDLURL){
if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
$payload .= $this->getDebugAsXMLComment();
}
$this->outgoing_headers[] = "Server: $this->title Server v$this->version";
- preg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+ preg_match('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
// Let the Web server decide about this
//$this->outgoing_headers[] = "Connection: Close\r\n";
$this->currentSchema->schemaStartElement($parser, $name, $attrs);
$this->appendDebug($this->currentSchema->getDebug());
$this->currentSchema->clearDebug();
- } elseif (preg('schema$', $name)) {
+ } elseif (preg_match('schema$', $name)) {
$this->debug('Parsing WSDL schema');
// $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
$this->status = 'schema';
$this->depth_array[$depth] = $pos;
$this->message[$pos] = array('cdata' => '');
// get element prefix
- if (preg(':', $name)) {
+ if (preg_match(':', $name)) {
// get ns prefix
$prefix = substr($name, 0, strpos($name, ':'));
// get ns
if (count($attrs) > 0) {
foreach($attrs as $k => $v) {
// if ns declarations, add to class level array of valid namespaces
- if (preg("^xmlns", $k)) {
+ if (preg_match("^xmlns", $k)) {
if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
$this->namespaces[$ns_prefix] = $v;
} else {
*/
function end_element($parser, $name){
// unset schema status
- if (/*preg('types$', $name) ||*/ preg('schema$', $name)) {
+ if (/*preg_match('types$', $name) ||*/ preg('schema$', $name)) {
$this->status = "";
$this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
$this->debug('Parsing WSDL schema done');
$key_localpart = $this->getLocalPart($key);
// if ns declarations, add to class level array of valid namespaces
if($key_prefix == 'xmlns'){
- if(preg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
+ if(preg_match('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
$this->XMLSchemaVersion = $value;
$this->namespaces['xsd'] = $this->XMLSchemaVersion;
$this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
[6] nextDimension ::= Digit+ ','
*/
$expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
- if(preg($expr,$value,$regs)){
+ if(preg_match($expr,$value,$regs)){
$this->message[$pos]['typePrefix'] = $regs[1];
$this->message[$pos]['arrayTypePrefix'] = $regs[1];
if (isset($this->namespaces[$regs[1]])) {
// detect transport
switch(true){
// http(s)
- case preg('^http',$this->endpoint):
+ case preg_match('^http',$this->endpoint):
$this->debug('transporting via HTTP');
if($this->persistentConnection == true && is_object($this->persistentConnection)){
$http =& $this->persistentConnection;
$http->setEncoding($this->http_encoding);
}
$this->debug('sending message, length: '.strlen($msg));
- if(preg('^http:',$this->endpoint)){
+ if(preg_match('^http:',$this->endpoint)){
//if(strpos($this->endpoint,'http:')){
$this->responseData = $http->send($msg,$timeout,$response_timeout);
- } elseif(preg('^https',$this->endpoint)){
+ } elseif(preg_match('^https',$this->endpoint)){
//} elseif(strpos($this->endpoint,'https:')){
//if(phpversion() == '4.3.0-dev'){
//$response = $http->send($msg,$timeout,$response_timeout);