From 0f30119294c0b80834e4104b3ccf1287f5548101 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 10 Oct 2011 22:18:20 +0200 Subject: [PATCH] Added AbstractSoapBuilder::withWsdlCache() method --- src/BeSimple/SoapCommon/AbstractSoapBuilder.php | 11 +++++++++++ src/BeSimple/SoapCommon/Cache.php | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/BeSimple/SoapCommon/AbstractSoapBuilder.php b/src/BeSimple/SoapCommon/AbstractSoapBuilder.php index a607d53..d9e4a78 100644 --- a/src/BeSimple/SoapCommon/AbstractSoapBuilder.php +++ b/src/BeSimple/SoapCommon/AbstractSoapBuilder.php @@ -97,6 +97,17 @@ abstract class AbstractSoapBuilder return $this; } + public function withWsdlCache($cache) + { + if (!in_array($cache, Cache::getTypes())) { + throw new \InvalidArgument(); + } + + $this->soapOptions['cache_wsdl'] = $cache; + + return $this; + } + /** * @return AbstractSoapBuilder */ diff --git a/src/BeSimple/SoapCommon/Cache.php b/src/BeSimple/SoapCommon/Cache.php index 7deecc7..ce0ef9d 100644 --- a/src/BeSimple/SoapCommon/Cache.php +++ b/src/BeSimple/SoapCommon/Cache.php @@ -16,7 +16,7 @@ namespace BeSimple\SoapCommon; * @author Francis Besset */ class Cache -{ +{ const DISABLED = 0; const ENABLED = 1; @@ -59,7 +59,7 @@ class Cache static public function setType($type) { if (!in_array($type, self::getTypes())) { - throw new \InvalidArgumentException(); + throw new \InvalidArgumentException('The cache type has to be either Cache::TYPE_NONE, Cache::TYPE_DISK, Cache::TYPE_MEMORY or Cache::TYPE_DISK_MEMORY'); } self::iniSet('soap.wsdl_cache', $type);