43 $this->fplock = array();
56 return $this->cache_dir.
'/wsdlcache-' . md5(
$wsdl);
66 $this->debug_str .= get_class($this).
": $string\n";
80 if ($this->cache_lifetime > 0) {
81 if (file_exists(
$filename) && (time() - filemtime(
$filename) > $this->cache_lifetime)) {
83 $this->
debug(
"Expired $wsdl ($filename) from cache");
93 $this->
debug(
"Got $wsdl ($filename) from cache");
96 $this->
debug(
"$wsdl ($filename) not in cache");
99 return (!is_null($s)) ? unserialize($s) : null;
101 $this->
debug(
"Unable to obtain mutex for $filename in get");
115 if (isset($this->fplock[md5(
$filename)])) {
116 $this->
debug(
"Lock for $filename already exists");
121 return flock($this->fplock[md5(
$filename)], LOCK_SH);
123 return flock($this->fplock[md5(
$filename)], LOCK_EX);
134 function put($wsdl_instance) {
136 $s = serialize($wsdl_instance);
141 $this->
debug(
"Put $wsdl_instance->wsdl ($filename) in cache");
145 $this->
debug(
"Unable to obtain mutex for $filename in put");
162 $this->
debug(
"Not able to release lock for $filename");
179 $this->
debug(
"Removed ($ret) $wsdl ($filename) from cache");