/** * This method handles the PROPFIND method. * * It's a very lazy method, it won't bother checking the request body * for which properties were requested, and just sends back a default * set of properties. * * @param RequestInterface $request * @param ResponseInterface $hR * @param string $tempLocation * @return bool */ function httpPropfind(RequestInterface $request, ResponseInterface $hR, $tempLocation) { if (!file_exists($tempLocation)) { return true; } $hR->setHeader('X-Sabre-Temp', 'true'); $hR->setStatus(207); $hR->setHeader('Content-Type', 'application/xml; charset=utf-8'); $this->server->parsePropFindRequest($request->getBodyAsString()); $properties = ['href' => $request->getPath(), 200 => ['{DAV:}getlastmodified' => new Property\GetLastModified(filemtime($tempLocation)), '{DAV:}getcontentlength' => filesize($tempLocation), '{DAV:}resourcetype' => new Property\ResourceType(null), '{' . Server::NS_SABREDAV . '}tempFile' => true]]; $data = $this->server->generateMultiStatus([$properties]); $hR->setBody($data); return false; }
/** * This method handles the PROPFIND method. * * It's a very lazy method, it won't bother checking the request body * for which properties were requested, and just sends back a default * set of properties. * * @param string $tempLocation * @param string $uri * @return bool */ public function httpPropfind($tempLocation, $uri) { if (!file_exists($tempLocation)) { return true; } $hR = $this->server->httpResponse; $hR->setHeader('X-Sabre-Temp', 'true'); $hR->sendStatus(207); $hR->setHeader('Content-Type', 'application/xml; charset=utf-8'); $this->server->parsePropFindRequest($this->server->httpRequest->getBody(true)); $properties = array('href' => $uri, 200 => array('{DAV:}getlastmodified' => new Property\GetLastModified(filemtime($tempLocation)), '{DAV:}getcontentlength' => filesize($tempLocation), '{DAV:}resourcetype' => new Property\ResourceType(null), '{' . Server::NS_SABREDAV . '}tempFile' => true)); $data = $this->server->generateMultiStatus(array($properties)); $hR->sendBody($data); return false; }