Пример #1
0
 protected function storeProperties($path, ezcWebdavBasicPropertyStorage $storage)
 {
     print_debug('storeProperties ' . $path . "\n");
     $storagePath = $this->options->propertyStoragePath . '/properties-' . md5($path);
     // Create handler structure to read properties
     $handler = new ezcWebdavPropertyHandler($xml = new ezcWebdavXmlTool());
     // Create new dom document with property storage for one namespace
     $doc = new DOMDocument('1.0');
     $properties = $doc->createElement('properties');
     $doc->appendChild($properties);
     // Store and store properties
     foreach ($this->handledLiveProperties as $propName) {
         $storage->detach($propName);
     }
     $handler->serializeProperties($storage, $properties);
     print_debug("storeProperties method end\n");
     return $doc->save($storagePath);
 }
Пример #2
0
 public function testIteratorDetachedAll()
 {
     $storage = new ezcWebdavBasicPropertyStorage();
     $storage->attach(new ezcWebdavLockDiscoveryProperty());
     $storage->attach(new ezcWebdavDeadProperty('http://example.com/some/property', 'some', 'foobar'));
     $storage->detach('lockdiscovery');
     $storage->detach('some', 'http://example.com/some/property');
     foreach ($storage as $property) {
         $this->fail("Property {$property->namespace} -- {$property->name} not detached!");
     }
     // All right, if no error occurs
 }