From 85e5d6aa3a95fed92ac854f5f56db3f3e972280f Mon Sep 17 00:00:00 2001 From: Nick Marshall Date: Fri, 31 Jul 2015 15:58:01 -0400 Subject: [PATCH 1/5] default cache_wsdl_path now system temp directory and an override value supplied for this is now treated as a directory instead of a single file since there can be multiple wsdl files that are cached --- library/SSRS/Soap/NTLM.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/SSRS/Soap/NTLM.php b/library/SSRS/Soap/NTLM.php index 33b4fd6..eb3fefc 100755 --- a/library/SSRS/Soap/NTLM.php +++ b/library/SSRS/Soap/NTLM.php @@ -17,8 +17,11 @@ class NTLM extends \SoapClient { function __construct($wsdl, $options = array()) { if (empty($options['cache_wsdl_path'])) { - $options['cache_wsdl_path'] = '/tmp/' . md5($wsdl) . '.wsdl'; + $options['cache_wsdl_path'] = sys_get_temp_dir(); } + if(!preg_match('/'.preg_quote(DIRECTORY_SEPARATOR, '/').'$/', $options['cache_wsdl_path'])) + $options['cache_wsdl_path'] .= DIRECTORY_SEPARATOR; + $options['cache_wsdl_path'] .= md5($wsdl) . '.wsdl'; if (array_key_exists('username', $options)) { $this->setUsername($options['username']); From bd098e37ca95115ec4da059bd69aef42cbb26289 Mon Sep 17 00:00:00 2001 From: Nick Marshall Date: Mon, 28 Sep 2015 13:00:46 -0400 Subject: [PATCH 2/5] changing composer.json to fork name --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3d04969..7f55060 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "chartblocks/php-ssrs", - "description": "PHP library for connecting to SSRS SOAP", + "name": "breakoutbox/php-ssrs", + "description": "PHP library for connecting to SSRS SOAP (fork)", "license": "MIT", "authors": [ { From ccac660aca040e1571ac23d28bf155bbb2e320aa Mon Sep 17 00:00:00 2001 From: Nick Marshall Date: Tue, 20 Oct 2015 14:55:55 -0400 Subject: [PATCH 3/5] problem with read-only attribute on folders in windows for validating the cache path; trying alternate strategy --- library/SSRS/Soap/NTLM.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/SSRS/Soap/NTLM.php b/library/SSRS/Soap/NTLM.php index eb3fefc..dc06037 100755 --- a/library/SSRS/Soap/NTLM.php +++ b/library/SSRS/Soap/NTLM.php @@ -87,8 +87,10 @@ public function setCachePath($file) { throw new RuntimeException("WSDL cache file not writeable"); } elseif (false === is_dir($folder)) { throw new RuntimeException("WSDL cache parent folder does not exist"); - } elseif (false === is_writeable($folder)) { + } elseif (touch($folder.DIRECTORY_SEPARATOR.'test') === false) { throw new RuntimeException("WSDL cache parent folder not writeable"); + } else { + unlink($folder . DIRECTORY_SEPARATOR . 'test'); } $this->_cachePath = $file; From e57fc42737719d7e4bbbf88355d6cc69ed46b15f Mon Sep 17 00:00:00 2001 From: Nick Marshall Date: Thu, 7 Jan 2016 14:49:48 -0500 Subject: [PATCH 4/5] revert composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7f55060..3d04969 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "breakoutbox/php-ssrs", - "description": "PHP library for connecting to SSRS SOAP (fork)", + "name": "chartblocks/php-ssrs", + "description": "PHP library for connecting to SSRS SOAP", "license": "MIT", "authors": [ { From dc0fcd61cbfa13b40992033780d7849ddad63942 Mon Sep 17 00:00:00 2001 From: Anthony Jack Date: Fri, 12 Oct 2018 10:27:24 -0400 Subject: [PATCH 5/5] reasonable unique test cache path file name --- library/SSRS/Soap/NTLM.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/SSRS/Soap/NTLM.php b/library/SSRS/Soap/NTLM.php index dc06037..5922f46 100755 --- a/library/SSRS/Soap/NTLM.php +++ b/library/SSRS/Soap/NTLM.php @@ -82,18 +82,20 @@ public function setPassword($password) { public function setCachePath($file) { $folder = dirname($file); + $testFilePath = $folder.DIRECTORY_SEPARATOR.uniqid('test-cache-'); if (file_exists($file) && false === is_writable($file)) { throw new RuntimeException("WSDL cache file not writeable"); } elseif (false === is_dir($folder)) { throw new RuntimeException("WSDL cache parent folder does not exist"); - } elseif (touch($folder.DIRECTORY_SEPARATOR.'test') === false) { + } elseif (touch($testFilePath) === false) { throw new RuntimeException("WSDL cache parent folder not writeable"); } else { - unlink($folder . DIRECTORY_SEPARATOR . 'test'); + @unlink($testFilePath); } $this->_cachePath = $file; + return $this; }