예제 #1
0
 /**
  * Add Well Known Properties
  *
  */
 protected function _calcProperties()
 {
     $etag = md5($this->href);
     $etag = sprintf('%s-%s-%s', substr($etag, 0, 7), substr($etag, 7, 4), substr($etag, 11, 8));
     foreach (array('creationdate' => array('value' => $this->creationDate, 'ns' => 'DAV:'), 'getlastmodified' => array('value' => $this->modifiedDate, 'ns' => 'DAV:'), 'getcontentlength' => array('value' => $this->contentLength, 'ns' => 'DAV:'), 'getcontenttype' => array('value' => $this->contentType, 'ns' => 'DAV:'), 'isfolder' => array('value' => WEBDAV_COLLECTION == $this->resourceType, 'ns' => 'DAV:'), 'executable' => array('value' => WEBDAV_COLLECTION != $this->resourceType ? FALSE : NULL, 'ns' => 'http://apache.org/dav/props/'), 'displayname' => array('value' => basename($this->href), 'ns' => 'DAV:'), 'nautilus-treat-as-directory' => array('value' => WEBDAV_COLLECTION == $this->resourceType, 'ns' => 'http://services.eazel.com/namespaces'), 'getlastmodified' => array('value' => $this->modifiedDate, 'ns' => 'DAV:'), 'getetag' => array('value' => WEBDAV_COLLECTION != $this->resourceType ? $etag : NULL, 'ns' => 'DAV:')) as $name => $propDef) {
         if ($propDef['value'] === NULL) {
             continue;
         }
         $p = new WebdavProperty($name, $propDef['value']);
         $p->setNamespaceName($propDef['ns']);
         $p->setProtected(TRUE);
         $this->addProperty($p);
     }
 }