public function httpPropFind(RequestInterface $request, ResponseInterface $response)
    {
        $path = $request->getPath();

        $requestBody = $request->getBodyAsString();
        if (strlen($requestBody)) {
            try {
                $propFindXml = $this->server->xml->expect('{DAV:}propfind', $requestBody);
            } catch (ParseException $e) {
                throw new BadRequest($e->getMessage(), 0, $e);
            }
        } else {
            $propFindXml = new Xml\Request\PropFind();
            $propFindXml->allProp = true;
            $propFindXml->properties = [];
        }

        $depth = $this->server->getHTTPDepth(1);
        // The only two options for the depth of a propfind is 0 or 1 - as long as depth infinity is not enabled
        if (!$this->server->enablePropfindDepthInfinity && 0 != $depth) {
            $depth = 1;
        }

        $newProperties = $this->server->getPropertiesIteratorForPath($path, $propFindXml->properties, $depth);

        // This is a multi-status response
        $response->setStatus(207);
        $response->setHeader('Content-Type', 'application/xml; charset=utf-8');
        $response->setHeader('Vary', 'Brief,Prefer');

        // Normally this header is only needed for OPTIONS responses, however..
        // iCal seems to also depend on these being set for PROPFIND. Since
        // this is not harmful, we'll add it.
        $features = ['1', '3', 'extended-mkcol'];
        foreach ($this->server->getPlugins() as $plugin) {
            $features = array_merge($features, $plugin->getFeatures());
        }
        $response->setHeader('DAV', implode(', ', $features));

        $prefer = $this->server->getHTTPPrefer();
        $minimal = 'minimal' === $prefer['return'];

        $data = $this->server->generateMultiStatus($newProperties, $minimal);
        $response->setBody($data);

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
public function httpPropFind(RequestInterface $request, ResponseInterface $response)
    {
        $path = $request->getPath();

        $requestBody = $request->getBodyAsString();
        if (strlen($requestBody)) {
            try {
                $propFindXml = $this->server->xml->expect('{DAV:}propfind', $requestBody);
            } catch (ParseException $e) {
                throw new BadRequest($e->getMessage(), 0, $e);
            }
        } else {
            $propFindXml = new Xml\Request\PropFind();
            $propFindXml->allProp = true;
            $propFindXml->properties = [];
        }

        $depth = $this->server->getHTTPDepth(1);
        // The only two options for the depth of a propfind is 0 or 1 - as long as depth infinity is not enabled
        if (!$this->server->enablePropfindDepthInfinity && 0 != $depth) {
            $depth = 1;
        }

        $newProperties = $this->server->getPropertiesIteratorForPath($path, $propFindXml->properties, $depth);

        // This is a multi-status response
        $response->setStatus(207);
        $response->setHeader('Content-Type', 'application/xml; charset=utf-8');
        $response->setHeader('Vary', 'Brief,Prefer');

        // Normally this header is only needed for OPTIONS responses, however..
        // iCal seems to also depend on these being set for PROPFIND. Since
        // this is not harmful, we'll add it.
        $features = ['1', '3', 'extended-mkcol'];
        foreach ($this->server->getPlugins() as $plugin) {
            $features = array_merge($features, $plugin->getFeatures());
        }
        $response->setHeader('DAV', implode(', ', $features));

        $prefer = $this->server->getHTTPPrefer();
        $minimal = 'minimal' === $prefer['return'];

        $data = $this->server->generateMultiStatus($newProperties, $minimal);
        $response->setBody($data);

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
public function httpPropFind ( RequestInterface $ request , ResponseInterface $ response ) { $ path = $ request -> getPath ( ) ; $ requestBody = $ request -> getBodyAsString ( ) ; if ( strlen ( $ requestBody ) ) { try { $ propFindXml = $ this -> server -> xml -> expect ( '{DAV:}propfind' , $ requestBody ) ; } catch ( ParseException $ e ) { throw new BadRequest ( $ e -> getMessage ( ) , 0 , $ e ) ; } } else { $ propFindXml = new Xml \ Request \ PropFind ( ) ; $ propFindXml -> allProp = true ; $ propFindXml -> properties = [ ] ; } $ depth = $ this -> server -> getHTTPDepth ( 1 ) ; // The only two options for the depth of a propfind is 0 or 1 - as long as depth infinity is not enabled if ( ! $ this -> server -> enablePropfindDepthInfinity && 0 != $ depth ) { $ depth = 1 ; } $ newProperties = $ this -> server -> getPropertiesIteratorForPath ( $ path , $ propFindXml -> properties , $ depth ) ; // This is a multi-status response $ response -> setStatus ( 207 ) ; $ response -> setHeader ( 'Content-Type' , 'application/xml; charset=utf-8' ) ; $ response -> setHeader ( 'Vary' , 'Brief,Prefer' ) ; // Normally this header is only needed for OPTIONS responses, however.. // iCal seems to also depend on these being set for PROPFIND. Since // this is not harmful, we'll add it. $ features = [ '1' , '3' , 'extended-mkcol' ] ; foreach ( $ this -> server -> getPlugins ( ) as $ plugin ) { $ features = array_merge ( $ features , $ plugin -> getFeatures ( ) ) ; } $ response -> setHeader ( 'DAV' , implode ( ', ' , $ features ) ) ; $ prefer = $ this -> server -> getHTTPPrefer ( ) ; $ minimal = 'minimal' === $ prefer [ 'return' ] ; $ data = $ this -> server -> generateMultiStatus ( $ newProperties , $ minimal ) ; $ response -> setBody ( $ data ) ; // Sending back false will interrupt the event chain and tell the server // we've handled this method. return false ; }
WebDAV PROPFIND.

This WebDAV method requests information about an uri resource, or a list of resources
If a client wants to receive the properties for a single resource it will add an HTTP Depth: header with a 0 value
If the value is 1, it means that it also expects a list of sub-resources (e.g.: files in a directory)

The request body contains an XML data structure that has a list of properties the client understands
The response body is also an xml document, containing information about every uri resource and the requested properties

It has to return a HTTP 207 Multi-status status code

@param RequestInterface  $request
@param ResponseInterface $response
WebDAV PROPFIND .