[dev] DAV questions round 2
Evert Pot
evertpot at gmail.com
Sun Sep 27 22:46:09 UTC 2009
Hi Guys,
Few questions..
1. I'm assuming I'm developing within horde-git. Jan already made a
'Sabre' package here.
How can I easily generate the package.xml. Do you guys have a script
for this?
2. I'm trying to get a list of applications for the root directory.
This is the relevant code for this in the existing Rpc/Webdav.php:
foreach ($apps as $app) {
// Call each application's browse method to get
// their collections
if ($registry->hasMethod('browse', $app)) {
$origdepth = $options['depth'];
if ($options['depth'] == 1) {
// Make sure the applications each only return
one level
$options['depth'] = 0;
}
try {
$results = $registry->callByPackage($app,
'browse', array('path' => '/', 'depth' => $options['depth']));
} catch (Horde_Exception $e) {
continue;
}
$options['depth'] = $origdepth;
foreach ($results as $itemPath => $item) {
if (($item !== false) && !is_a($item,
'PEAR_Error')) {
// A false return is "file not found"
// A PEAR_Error return is an error.
Silently ignore
// those errors from the applications.
Errors will
// will nevertheless be logged.
$list[] =
array('path' => $this->path . '/' .
$itemPath,
'props' => $this->_getProps
($options['props'], $item));
}
}
}
I would expect the contents of $itemPath in the inner loop to be for
example 'kronolith'. Instead I get 'kronolith/Administrator'.
So for the actual question: am I just supposed to use the first part
of $itemPath? Am I doing it wrong altogether? Is there a better way to
get a list of application-names for use in the directory tree?
3. SabreDAV supports custom locking backend support. I've noticed
Horde has a standard Lock driver model as well. Should I integrate
with this as well?
4. How do you guys want the code delivered? I can create patches, but
having access to your repositories might allow you to be more
judgemental =)
Evert
More information about the dev
mailing list