当前位置: 首页>>代码示例>>PHP>>正文


PHP PropFind::get404Properties方法代码示例

本文整理汇总了PHP中Sabre\DAV\PropFind::get404Properties方法的典型用法代码示例。如果您正苦于以下问题:PHP PropFind::get404Properties方法的具体用法?PHP PropFind::get404Properties怎么用?PHP PropFind::get404Properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sabre\DAV\PropFind的用法示例。


在下文中一共展示了PropFind::get404Properties方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: propFind

 /**
  * Fetches properties for a path.
  *
  * This method received a PropFind object, which contains all the
  * information about the properties that need to be fetched.
  *
  * Ususually you would just want to call 'get404Properties' on this object,
  * as this will give you the _exact_ list of properties that need to be
  * fetched, and haven't yet.
  *
  * However, you can also support the 'allprops' property here. In that
  * case, you should check for $propFind->isAllProps().
  *
  * @param string $path
  * @param PropFind $propFind
  * @return void
  */
 function propFind($path, PropFind $propFind)
 {
     if (!$propFind->isAllProps() && count($propFind->get404Properties()) === 0) {
         return;
     }
     $query = 'SELECT name, value, valuetype FROM ' . $this->tableName . ' WHERE path = ?';
     $stmt = $this->pdo->prepare($query);
     $stmt->execute([$path]);
     while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
         if (gettype($row['value']) === 'resource') {
             $row['value'] = stream_get_contents($row['value']);
         }
         switch ($row['valuetype']) {
             case null:
             case self::VT_STRING:
                 $propFind->set($row['name'], $row['value']);
                 break;
             case self::VT_XML:
                 $propFind->set($row['name'], new Complex($row['value']));
                 break;
             case self::VT_OBJECT:
                 $propFind->set($row['name'], unserialize($row['value']));
                 break;
         }
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:43,代码来源:PDO.php

示例2: propFind

 /**
  * Fetches properties for a path.
  *
  * @param string $path
  * @param PropFind $propFind
  * @return void
  */
 public function propFind($path, PropFind $propFind)
 {
     try {
         $node = $this->tree->getNodeForPath($path);
         if (!$node instanceof Node) {
             return;
         }
     } catch (ServiceUnavailable $e) {
         // might happen for unavailable mount points, skip
         return;
     } catch (NotFound $e) {
         // in some rare (buggy) cases the node might not be found,
         // we catch the exception to prevent breaking the whole list with a 404
         // (soft fail)
         \OC::$server->getLogger()->warning('Could not get node for path: \\"' . $path . '\\" : ' . $e->getMessage(), array('app' => 'files'));
         return;
     }
     $requestedProps = $propFind->get404Properties();
     // these might appear
     $requestedProps = array_diff($requestedProps, $this->ignoredProperties);
     if (empty($requestedProps)) {
         return;
     }
     if ($node instanceof Directory && $propFind->getDepth() !== 0) {
         // note: pre-fetching only supported for depth <= 1
         $this->loadChildrenProperties($node, $requestedProps);
     }
     $props = $this->getProperties($node, $requestedProps);
     foreach ($props as $propName => $propValue) {
         $propFind->set($propName, $propValue);
     }
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:39,代码来源:custompropertiesbackend.php

示例3: propFind

 /**
  * Fetches properties for a path.
  *
  * This method received a PropFind object, which contains all the
  * information about the properties that need to be fetched.
  *
  * Ususually you would just want to call 'get404Properties' on this object,
  * as this will give you the _exact_ list of properties that need to be
  * fetched, and haven't yet.
  *
  * @param string $path
  * @param PropFind $propFind
  * @return void
  */
 public function propFind($path, PropFind $propFind)
 {
     $propertyNames = $propFind->get404Properties();
     if (!$propertyNames) {
         return;
     }
     // error_log("propFind: path($path), " . print_r($propertyNames, true));
     $cachedNodes = \CB\Cache::get('DAVNodes');
     // error_log("propFind: " . print_r($cachedNodes, true));
     $path = trim($path, '/');
     $path = str_replace('\\', '/', $path);
     // Node with $path is not in cached nodes, return
     if (!array_key_exists($path, $cachedNodes)) {
         return;
     }
     $node = $cachedNodes[$path];
     // while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
     //     $propFind->set($row['name'], $row['value']);
     // }
     foreach ($propertyNames as $prop) {
         if ($prop == '{DAV:}creationdate') {
             $dttm = new \DateTime($node['cdate']);
             // $dttm->getTimestamp()
             $propFind->set($prop, \Sabre\HTTP\Util::toHTTPDate($dttm));
         } elseif ($prop == '{urn:schemas-microsoft-com:office:office}modifiedby' or $prop == '{DAV:}getmodifiedby') {
             // This has to be revised, because the User.login differs from User.DisplayName
             // moreover, during an edit, Word will check for File Properties and we
             // tell Word that the file is modified by another user
             // $propFind->set($prop, \CB\User::getDisplayName($node['uid']));
         }
     }
 }
开发者ID:youprofit,项目名称:casebox,代码行数:46,代码来源:PropertyStorageBackend.php

示例4: propFind

 /**
  * Fetches properties for a path.
  *
  * This method received a PropFind object, which contains all the
  * information about the properties that need to be fetched.
  *
  * Ususually you would just want to call 'get404Properties' on this object,
  * as this will give you the _exact_ list of properties that need to be
  * fetched, and haven't yet.
  *
  * @param string $path
  * @param PropFind $propFind
  * @return void
  */
 function propFind($path, PropFind $propFind)
 {
     $propertyNames = $propFind->get404Properties();
     if (!$propertyNames) {
         return;
     }
     $query = 'SELECT name, value FROM propertystorage WHERE path = ?';
     $stmt = $this->pdo->prepare($query);
     $stmt->execute([$path]);
     while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
         $propFind->set($row['name'], $row['value']);
     }
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:27,代码来源:PDO.php

示例5: propFind

 /**
  * Fetches properties for a path.
  *
  * @param string $path
  * @param PropFind $propFind
  * @return void
  */
 public function propFind($path, PropFind $propFind)
 {
     $requestedProps = $propFind->get404Properties();
     // these might appear
     $requestedProps = array_diff($requestedProps, $this->ignoredProperties);
     if (empty($requestedProps)) {
         return;
     }
     $props = $this->getProperties($path, $requestedProps);
     foreach ($props as $propName => $propValue) {
         $propFind->set($propName, $propValue);
     }
 }
开发者ID:kenwi,项目名称:core,代码行数:20,代码来源:custompropertiesbackend.php

示例6: propFindNode

 /**
  * Fetches properties for a node.
  *
  * This event is called a bit later, so plugins have a chance first to
  * populate the result.
  *
  * @param PropFind $propFind
  * @param INode $node
  * @return void
  */
 function propFindNode(PropFind $propFind, INode $node)
 {
     if ($node instanceof IProperties && ($propertyNames = $propFind->get404Properties())) {
         $nodeProperties = $node->getProperties($propertyNames);
         foreach ($nodeProperties as $propertyName => $value) {
             $propFind->set($propertyName, $value, 200);
         }
     }
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:19,代码来源:CorePlugin.php

示例7: propFindNode

 /**
  * Fetches properties for a node.
  *
  * This event is called a bit later, so plugins have a chance first to
  * populate the result.
  *
  * @param PropFind $propFind
  * @param INode $node
  * @return void
  */
 function propFindNode(PropFind $propFind, INode $node)
 {
     if ($node instanceof IProperties && ($propertyNames = $propFind->get404Properties())) {
         $nodeProperties = $node->getProperties($propertyNames);
         foreach ($propertyNames as $propertyName) {
             if (array_key_exists($propertyName, $nodeProperties)) {
                 $propFind->set($propertyName, $nodeProperties[$propertyName], 200);
             }
         }
     }
 }
开发者ID:drognisep,项目名称:Portfolio-Site,代码行数:21,代码来源:CorePlugin.php


注:本文中的Sabre\DAV\PropFind::get404Properties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。