[dev] WebDAV package v0.1

Jan Schneider jan at horde.org
Thu Oct 22 22:44:47 UTC 2009


Zitat von Evert Pot <evertpot at gmail.com>:

>
> On 2009-10-22, at 7:41 PM, Jan Schneider wrote:
>
>> Zitat von Evert Pot <evertpot at gmail.com>:
>>
>>>> [snip]
>>>> That sounds like a clean approach to me. OTOH we still need  
>>>> similar functionality for internal browsing, but it doesn't make  
>>>> sense to use objects extending Sabre_DAV classes for that purpose.
>>>> Does Sabre require those objects to extend the Sabre classes, or  
>>>> is it sufficient to implement a certain object API?
>>>
>>> You can actually implement the interfaces (Sabre_DAV_INode, IFile,  
>>> IDirectory).
>>> The classes are there, because all the methods are already  
>>> implemented to throw a 'Permission denied' by default, which  
>>> results in less code.
>>>
>>> To find out if an object supports for example directory-like  
>>> functinality, just the interfaces are checked. As an alternative I  
>>> had been thinking about using duck-typing, but I ended up  
>>> preferring interfaces, because it forces developers to be more  
>>> strict.
>>
>> That would still add a dependency on Sabre that I rather don't want  
>> for such a core functionality.
>
> Wouldn't a dependency be implied if anyone wants to use webdav  
> functionality? Unless you are talking about using the tree for  
> functionality beyond webdav..

Yes, the latter.

> If the reference in the _Application class is a concern, I'm pretty  
> sure everything will work correctly, unless the actual  
> 'getWebDavNode' or equivalent method would actually be executed.
>
> Can you help me understand the problem?

We use the browse method not only for WebDAV access, but also  
internally, to browse from one application to objects of a different  
application. Since this feature resembles the same directory-like tree  
like we use in WebDAV/CalDAV, we should share the code. I don't stick  
to using a single browse() method, and I'm also fine with requiring  
Sabre for people that want CalDAV support, but whatever we chose for  
browsing the application resources should work without any dependency  
on external code. Hope this makes things clearer.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list