summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/swift.php
diff options
context:
space:
mode:
authorPhilipp Kapfer <philipp.kapfer@gmx.at>2013-08-02 15:44:56 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-04-03 16:46:22 +0200
commit730bca98b48384816792423e97c53de112ac8aeb (patch)
tree2bce76284928b4bff783c336e5bb8464791b01dc /apps/files_external/lib/swift.php
parentff9a4a6d91b4a23be91a462806b8162543bb6c95 (diff)
downloadnextcloud-server-730bca98b48384816792423e97c53de112ac8aeb.tar.gz
nextcloud-server-730bca98b48384816792423e97c53de112ac8aeb.zip
Moved dependency checks to end of class files
Dependency messages now appear below the configuration options instead of above Reworked dependency check method to support consolidated messages for multiple backends Conflicts: apps/files_external/lib/google.php apps/files_external/lib/swift.php apps/files_external/templates/settings.php
Diffstat (limited to 'apps/files_external/lib/swift.php')
-rw-r--r--apps/files_external/lib/swift.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index a66d53fc1a8..a202d3843cb 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -65,16 +65,16 @@ class Swift extends \OC\Files\Storage\Common {
return $path;
}
+ const SUBCONTAINER_FILE='.subcontainers';
+
/**
- * check if curl is installed
+ * translate directory path to container name
+ * @param string $path
+ * @return string
*/
- public static function checkDependencies() {
- if (function_exists('curl_init')) {
- return true;
- } else {
- $l = new \OC_L10N('files_external');
- return $l->t('<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of OpenStack Swift is not possible. Please ask your system administrator to install it.');
- }
+ private function getContainerName($path) {
+ $path=trim(trim($this->root, '/') . "/".$path, '/.');
+ return str_replace('/', '\\', $path);
}
/**
@@ -502,4 +502,16 @@ class Swift extends \OC\Files\Storage\Common {
), $tmpFile);
unlink($tmpFile);
}
+
+ /**
+ * check if curl is installed
+ */
+ public static function checkDependencies() {
+ if (function_exists('curl_init')) {
+ return true;
+ } else {
+ return array('curl');
+ }
+ }
+
}