Suggested update for PEAR::SOAP file WSDL.php

From: Date: Sat, 08 Feb 2003 13:49:32 +0000
Subject: Suggested update for PEAR::SOAP file WSDL.php
Groups: php.soap 
Request: Send a blank email to php-soap+get-409@lists.php.net to get a copy of this message
Hi, I got sick of the wsdlcache directory being constantly created by WSDL.php even though I had WSDL_CACHE_USE as false. This patch updates the code such that the cache directory is only created when WSDL_CACHE_USE is true. I would appreciate if this patch could be incorporated into an upcoming version of PEAR::SOAP. Following is a diff from the current latest CVS version of WSDL.php (1.31). Regards, Brodie. ---- diff -b -c WSDL_cvs131.php WSDL.php ---- *** WSDL_cvs131.php Tue Feb 4 17:38:32 2003 --- WSDL.php Tue Feb 4 17:43:56 2003 *************** *** 591,602 **** * add to cache, and return from cache */ function get($wsdl_fname, $proxy_params=array(), $cache=0) { $cachename = SOAP_WSDL_Cache::_cacheDir() . "/" . md5($wsdl_fname); - $cacheinfo = $cachename.".info"; $cachename .= ".wsdl"; ! $md5_wsdl = ""; ! $file_data = ''; ! if (WSDL_CACHE_USE && file_exists($cachename)) { $wf = fopen($cachename,"rb"); if ($wf) { $file_data = fread($wf, filesize($cachename)); --- 591,603 ---- * add to cache, and return from cache */ function get($wsdl_fname, $proxy_params=array(), $cache=0) { + $cachename = ''; + $md5_wsdl = ''; + $file_data = ''; + if (WSDL_CACHE_USE) { $cachename = SOAP_WSDL_Cache::_cacheDir() . "/" . md5($wsdl_fname); $cachename .= ".wsdl"; ! if ( file_exists($cachename) ) { $wf = fopen($cachename,"rb"); if ($wf) { $file_data = fread($wf, filesize($cachename)); *************** *** 617,622 **** --- 618,624 ---- } } } + } if (!$md5_wsdl) { // is it a local file? // this section should be replace by curl at some point

« previous php.soap (#409) next »