4 * This is a simple plugin that will map any GET request for non-files to
5 * PROPFIND allprops-requests.
7 * This should allow easy debugging of PROPFIND
11 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
12 * @author Evert Pot (http://www.rooftopsolutions.nl/)
13 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
15 class Sabre_DAV_Browser_MapGetToPropFind extends Sabre_DAV_ServerPlugin {
18 * reference to server class
20 * @var Sabre_DAV_Server
25 * Initializes the plugin and subscribes to events
27 * @param Sabre_DAV_Server $server
30 public function initialize(Sabre_DAV_Server $server) {
32 $this->server = $server;
33 $this->server->subscribeEvent('beforeMethod',array($this,'httpGetInterceptor'));
37 * This method intercepts GET requests to non-files, and changes it into an HTTP PROPFIND request
39 * @param string $method
43 public function httpGetInterceptor($method, $uri) {
45 if ($method!='GET') return true;
47 $node = $this->server->tree->getNodeForPath($uri);
48 if ($node instanceof Sabre_DAV_IFile) return;
50 $this->server->invokeMethod('PROPFIND',$uri);