[TASK] Move default PROPFIND parameters to client
authorAndreas Wolf <andreas.wolf@typo3.org>
Wed, 3 Jun 2015 13:50:52 +0000 (15:50 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Wed, 3 Jun 2015 13:50:52 +0000 (15:50 +0200)
Classes/Dav/WebDavClient.php
Classes/Driver/WebDavDriver.php

index 30be314..4174c82 100644 (file)
@@ -51,6 +51,20 @@ class WebDavClient extends Client {
 
                return parent::curlExec($curlHandle);
        }
+
+       function propFind($url, array $properties = NULL, $depth = 0) {
+               if ($properties === NULL) {
+                       $properties = array(
+                               '{DAV:}resourcetype',
+                               '{DAV:}creationdate',
+                               '{DAV:}getcontentlength',
+                               '{DAV:}getlastmodified'
+                       );
+               }
+               return parent::propFind($url, $properties, $depth); // TODO: Change the autogenerated stub
+       }
+
+
 }
 
 ?>
\ No newline at end of file
index 272878b..9cb4428 100644 (file)
@@ -235,12 +235,7 @@ class WebDavDriver extends AbstractDriver {
         */
        protected function davPropFind($url) {
                try {
-                       return $this->davClient->propfind($url, array(
-                               '{DAV:}resourcetype',
-                               '{DAV:}creationdate',
-                               '{DAV:}getcontentlength',
-                               '{DAV:}getlastmodified'
-                       ), 1);
+                       return $this->davClient->propFind($url, NULL, 1);
                } catch (\Sabre\DAV\Exception\NotFound $exception) {
                        // If a file is not found, we have to deal with that on a higher level, so throw the exception again
                        throw $exception;