Example #1
0
 public function testSetEnabled()
 {
     Cache::setEnabled(Cache::ENABLED);
     $this->assertEquals(Cache::ENABLED, Cache::isEnabled());
     Cache::setEnabled(Cache::DISABLED);
     $this->assertEquals(Cache::DISABLED, Cache::isEnabled());
 }
 /**
  * Constructor.
  *
  * @param \BeSimple\SoapClient\Curl $curl                  Curl instance
  * @param boolean                   $resolveRemoteIncludes WSDL/XSD include enabled?
  * @param boolean                   $cacheWsdl             Cache constant
  */
 public function __construct(Curl $curl, $resolveRemoteIncludes = true, $cacheWsdl = Cache::TYPE_DISK)
 {
     $this->curl = $curl;
     $this->resolveRemoteIncludes = (bool) $resolveRemoteIncludes;
     // get current WSDL caching config
     $this->cacheEnabled = $cacheWsdl === Cache::TYPE_NONE ? Cache::DISABLED : Cache::ENABLED == Cache::isEnabled();
     $this->cacheDir = Cache::getDirectory();
     $this->cacheTtl = Cache::getLifetime();
 }
Example #3
0
 public function __construct($cacheDisabled, $type, $directory, $lifetime = null, $limit = null)
 {
     $isEnabled = (bool) $cacheDisabled ? BaseCache::DISABLED : BaseCache::ENABLED;
     BaseCache::setEnabled($isEnabled);
     if (BaseCache::ENABLED == BaseCache::isEnabled()) {
         BaseCache::setType($type);
         BaseCache::setDirectory($directory);
         if (null !== $lifetime) {
             BaseCache::setLifetime($lifetime);
         }
         if (null !== $limit) {
             BaseCache::setLimit($limit);
         }
     }
 }