src/nusoap_wsdlcache.php
function get($wsdl)
    {
        $filename = $this->createFilename($wsdl);
        if ($this->obtainMutex($filename, "r")) {
            // check for expired WSDL that must be removed from the cache
            if ($this->cache_lifetime > 0) {
                if (file_exists($filename) && (time() - filemtime($filename) > $this->cache_lifetime)) {
                    unlink($filename);
                    $this->debug("Expired $wsdl ($filename) from cache");
                    $this->releaseMutex($filename);

                    return NULL;
                }
            }
            // see what there is to return
            if (!file_exists($filename)) {
                $this->debug("$wsdl ($filename) not in cache (1)");
                $this->releaseMutex($filename);

                return NULL;
            }
            $fp = @fopen($filename, "r");
            if ($fp) {
                $s = implode("", @file($filename));
                fclose($fp);
                $this->debug("Got $wsdl ($filename) from cache");
            } else {
                $s = NULL;
                $this->debug("$wsdl ($filename) not in cache (2)");
            }
            $this->releaseMutex($filename);

            return (!is_null($s)) ? unserialize($s) : NULL;
        } else {
            $this->debug("Unable to obtain mutex for $filename in get");
        }

        return NULL;
    }
function get($wsdl)
    {
        $filename = $this->createFilename($wsdl);
        if ($this->obtainMutex($filename, "r")) {
            // check for expired WSDL that must be removed from the cache
            if ($this->cache_lifetime > 0) {
                if (file_exists($filename) && (time() - filemtime($filename) > $this->cache_lifetime)) {
                    unlink($filename);
                    $this->debug("Expired $wsdl ($filename) from cache");
                    $this->releaseMutex($filename);

                    return NULL;
                }
            }
            // see what there is to return
            if (!file_exists($filename)) {
                $this->debug("$wsdl ($filename) not in cache (1)");
                $this->releaseMutex($filename);

                return NULL;
            }
            $fp = @fopen($filename, "r");
            if ($fp) {
                $s = implode("", @file($filename));
                fclose($fp);
                $this->debug("Got $wsdl ($filename) from cache");
            } else {
                $s = NULL;
                $this->debug("$wsdl ($filename) not in cache (2)");
            }
            $this->releaseMutex($filename);

            return (!is_null($s)) ? unserialize($s) : NULL;
        } else {
            $this->debug("Unable to obtain mutex for $filename in get");
        }

        return NULL;
    }
function get ( $ wsdl ) { $ filename = $ this -> createFilename ( $ wsdl ) ; if ( $ this -> obtainMutex ( $ filename , "r" ) ) { // check for expired WSDL that must be removed from the cache
 if ( $ this -> cache_lifetime > 0 ) { if ( file_exists ( $ filename ) && ( time ( ) - filemtime ( $ filename ) > $ this -> cache_lifetime ) ) { unlink ( $ filename ) ; $ this -> debug ( "Expired $wsdl ($filename) from cache" ) ; $ this -> releaseMutex ( $ filename ) ; return NULL ; } } // see what there is to return
 if ( ! file_exists ( $ filename ) ) { $ this -> debug ( "$wsdl ($filename) not in cache (1)" ) ; $ this -> releaseMutex ( $ filename ) ; return NULL ; } $ fp = @ fopen ( $ filename , "r" ) ; if ( $ fp ) { $ s = implode ( "" , @ file ( $ filename ) ) ; fclose ( $ fp ) ; $ this -> debug ( "Got $wsdl ($filename) from cache" ) ; } else { $ s = NULL ; $ this -> debug ( "$wsdl ($filename) not in cache (2)" ) ; } $ this -> releaseMutex ( $ filename ) ; return ( ! is_null ( $ s ) ) ? unserialize ( $ s ) : NULL ; } else { $ this -> debug ( "Unable to obtain mutex for $filename in get" ) ; } return NULL ; }
gets a wsdl instance from the cache

@param string $wsdl The URL of the wsdl instance

@return object wsdl The cached wsdl instance, null if the instance is not in the cache
@access public
gets a wsdl instance from the cache