コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
ファイル: CacheTest.php プロジェクト: mablae/BeSimpleSoap
 public function testSetDirectory()
 {
     vfsStream::setup('Fixtures');
     $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('foo'));
     $dir = vfsStream::url('Fixtures/foo');
     Cache::setDirectory($dir);
     $this->assertEquals($dir, Cache::getDirectory());
     $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('foo'));
     $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('bar'));
     $dir = vfsStream::url('Fixtures/bar');
     Cache::setDirectory($dir);
     $this->assertEquals($dir, Cache::getDirectory());
     $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('bar'));
 }