summaryrefslogtreecommitdiffstats
path: root/lib/private/davclient.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-12-14 18:32:48 +0100
committerAndreas Fischer <bantu@owncloud.com>2013-12-14 18:32:48 +0100
commitc205d8d1c957ab5421a5864d183257f596336d2d (patch)
treea097ff1232f1283074c2cbd589fa1fddac037391 /lib/private/davclient.php
parentd73285c1869591da74c148b577d780a73313fe90 (diff)
parent77b68505c2164330803ce5d5dcbb9fd07438e18d (diff)
downloadnextcloud-server-c205d8d1c957ab5421a5864d183257f596336d2d.tar.gz
nextcloud-server-c205d8d1c957ab5421a5864d183257f596336d2d.zip
Merge remote-tracking branch 'owncloud/master' into fixing-3417-master
* owncloud/master: (1989 commits) [tx-robot] updated from transifex dont try to register background jobs if we haven't upgraded yet adjust test coding style coding style On webdav sesssions, loginname was compared to username which does not need to match necessarily rely only on php DateTime to parse the db datetime string LDAP: fix method behind save button on advancend and expert tabs, fixes at least Home Folder setinng Fix webroot for update page Update 3rdparty ref update 3rdparty toggle select all checkbox remove unneeded ; in comment LDAP: the browser shall not autofill userdn and password, usually login credentials are inserted. fixes #6283 Add test for having utf8 filenames in the cache fix fallback overwriting result of getHome [tx-robot] updated from transifex fix smbclient directory listing parser cache the home folder of a User Send "SET NAMES utf8" to MySQL for PHP below 5.3.6 ... Conflicts: lib/util.php
Diffstat (limited to 'lib/private/davclient.php')
-rw-r--r--lib/private/davclient.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/private/davclient.php b/lib/private/davclient.php
new file mode 100644
index 00000000000..28f48f3b921
--- /dev/null
+++ b/lib/private/davclient.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Vincent Petry
+ * @copyright 2013 Vincent Petry <pvince81@owncloud.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/**
+ * This class extends the SabreDAV client with additional functionality
+ * like request timeout.
+ */
+
+class OC_DAVClient extends \Sabre_DAV_Client {
+
+ protected $requestTimeout;
+
+ /**
+ * @brief Sets the request timeout or 0 to disable timeout.
+ * @param int timeout in seconds or 0 to disable
+ */
+ public function setRequestTimeout($timeout) {
+ $this->requestTimeout = (int)$timeout;
+ }
+
+ protected function curlRequest($url, $settings) {
+ if ($this->requestTimeout > 0) {
+ $settings[CURLOPT_TIMEOUT] = $this->requestTimeout;
+ }
+ return parent::curlRequest($url, $settings);
+ }
+}