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

        try {
            $node = $this->server->tree->getNodeForPath($path);
        } catch (DAV\Exception\NotFound $e) {
            return;
        }

        if (!$node instanceof INode) {
            return;
        }

        $writer = $this->server->xml->getWriter();
        $writer->contextUri = $this->server->getBaseUri();
        $writer->openMemory();
        $writer->startDocument('1.0', 'UTF-8');
        $writer->startElement('{http://calendarserver.org/ns/}notification');
        $node->getNotificationType()->xmlSerializeFull($writer);
        $writer->endElement();

        $response->setHeader('Content-Type', 'application/xml');
        $response->setHeader('ETag', $node->getETag());
        $response->setStatus(200);
        $response->setBody($writer->outputMemory());

        // Return false to break the event chain.
        return false;
    }
public function httpGet(RequestInterface $request, ResponseInterface $response)
    {
        $path = $request->getPath();

        try {
            $node = $this->server->tree->getNodeForPath($path);
        } catch (DAV\Exception\NotFound $e) {
            return;
        }

        if (!$node instanceof INode) {
            return;
        }

        $writer = $this->server->xml->getWriter();
        $writer->contextUri = $this->server->getBaseUri();
        $writer->openMemory();
        $writer->startDocument('1.0', 'UTF-8');
        $writer->startElement('{http://calendarserver.org/ns/}notification');
        $node->getNotificationType()->xmlSerializeFull($writer);
        $writer->endElement();

        $response->setHeader('Content-Type', 'application/xml');
        $response->setHeader('ETag', $node->getETag());
        $response->setStatus(200);
        $response->setBody($writer->outputMemory());

        // Return false to break the event chain.
        return false;
    }
public function httpGet ( RequestInterface $ request , ResponseInterface $ response ) { $ path = $ request -> getPath ( ) ; try { $ node = $ this -> server -> tree -> getNodeForPath ( $ path ) ; } catch ( DAV \ Exception \ NotFound $ e ) { return ; } if ( ! $ node instanceof INode ) { return ; } $ writer = $ this -> server -> xml -> getWriter ( ) ; $ writer -> contextUri = $ this -> server -> getBaseUri ( ) ; $ writer -> openMemory ( ) ; $ writer -> startDocument ( '1.0' , 'UTF-8' ) ; $ writer -> startElement ( '{http://calendarserver.org/ns/}notification' ) ; $ node -> getNotificationType ( ) -> xmlSerializeFull ( $ writer ) ; $ writer -> endElement ( ) ; $ response -> setHeader ( 'Content-Type' , 'application/xml' ) ; $ response -> setHeader ( 'ETag' , $ node -> getETag ( ) ) ; $ response -> setStatus ( 200 ) ; $ response -> setBody ( $ writer -> outputMemory ( ) ) ; // Return false to break the event chain. return false ; }
This event is triggered before the usual GET request handler.

We use this to intercept GET calls to notification nodes, and return the
proper response.

@param RequestInterface  $request
@param ResponseInterface $response
This event is triggered before the usual GET request handler .