Hi Colombia,
On Friday, February 14, 2014 10:23:22 AM UTC-5, Colombia Hosting wrote:
Hello,
I'm writing a plugin that will add some properties to the PROPFIND method.
But I need to get the node path to work with it into
the beforeGetProperties event.
The problem is that the INode has the path member protected, and I can't
see any public method to get it.
How can I get the path into the beforeGetProperties?
public function beforeGetProperties($uri, DAV\INode $node,
$requestedProperties, $returnedProperties);
There are two different 'paths' in sabredav.. The public path (from the
url) and the local path (from the filesystem).
A lot of the functionality in SabreDAV is split between two major systems:
1. The nodes system (including many of the Backend classes)
2. Plugins, the Server class, and the Tree classes.
The #2 category is not allowed to really 'know' any thing about the first
category. This means that a plugin _must not know_ about a filesystem path
from a node, because the node may not be stored on a filesystem at all (it
could be a database, or something else entirely).
If you just care about the 'public path', you have the $uri argument right
there though.
If you want to do something with a physical file on disk, you have a few
options:
1. Don't implement this property in a plugin, implement it in the Node (see
Sabre\DAV\IProperties).
2. Keep it in the plugin, but also extend your node class to return the
information the plugin needs by exposing additional methods.
#1 is the most straightforward, but #2 is what most of SabreDAV does
because it keeps the nodes simple, and the plugins complex.
Hope this helps, and let me know if you need any clarifications anywhere.
Evert
--
You received this message because you are subscribed to the Google Groups
SabreDAV Discussion group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sabredav-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to sabredav-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/sabredav-discuss.
For more options, visit https://groups.google.com/groups/opt_out.