Lines Matching +full:- +full:- +full:debug
7 nusoap-general@lists.sourceforge.net
43 * @param string $cache_dir directory for cache-files
44 * @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited
48 $this->fplock = array();
49 $this->cache_dir = $cache_dir != '' ? $cache_dir : '.';
50 $this->cache_lifetime = $cache_lifetime;
61 return $this->cache_dir.'/wsdlcache-' . md5($wsdl);
65 * adds debug data to the class level debug string
67 * @param string $string debug data
70 function debug($string){ function in nusoap_wsdlcache
71 $this->debug_str .= get_class($this).": $string\n";
82 $filename = $this->createFilename($wsdl);
83 if ($this->obtainMutex($filename, "r")) {
85 if ($this->cache_lifetime > 0) {
86 if (file_exists($filename) && (time() - filemtime($filename) > $this->cache_lifetime)) {
88 $this->debug("Expired $wsdl ($filename) from cache");
89 $this->releaseMutex($filename);
95 $this->debug("$wsdl ($filename) not in cache (1)");
96 $this->releaseMutex($filename);
103 $this->debug("Got $wsdl ($filename) from cache");
106 $this->debug("$wsdl ($filename) not in cache (2)");
108 $this->releaseMutex($filename);
111 $this->debug("Unable to obtain mutex for $filename in get");
120 * @param string $mode The open-mode ("r" or "w") or the file - affects lock-mode
125 if (isset($this->fplock[md5($filename)])) {
126 $this->debug("Lock for $filename already exists");
129 $this->fplock[md5($filename)] = fopen($filename.".lock", "w");
131 return flock($this->fplock[md5($filename)], LOCK_SH);
133 return flock($this->fplock[md5($filename)], LOCK_EX);
145 $filename = $this->createFilename($wsdl_instance->wsdl);
147 if ($this->obtainMutex($filename, "w")) {
150 $this->debug("Cannot write $wsdl_instance->wsdl ($filename) in cache");
151 $this->releaseMutex($filename);
156 $this->debug("Put $wsdl_instance->wsdl ($filename) in cache");
157 $this->releaseMutex($filename);
160 $this->debug("Unable to obtain mutex for $filename in put");
173 $ret = flock($this->fplock[md5($filename)], LOCK_UN);
174 fclose($this->fplock[md5($filename)]);
175 unset($this->fplock[md5($filename)]);
177 $this->debug("Not able to release lock for $filename");
190 $filename = $this->createFilename($wsdl);
192 $this->debug("$wsdl ($filename) not in cache to be removed");
196 $this->obtainMutex($filename, "w");
198 $this->debug("Removed ($ret) $wsdl ($filename) from cache");
199 $this->releaseMutex($filename);