本文整理匯總了PHP中Sabre\DAV\PropFind::isAllProps方法的典型用法代碼示例。如果您正苦於以下問題:PHP PropFind::isAllProps方法的具體用法?PHP PropFind::isAllProps怎麽用?PHP PropFind::isAllProps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sabre\DAV\PropFind
的用法示例。
在下文中一共展示了PropFind::isAllProps方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
}
}