From ff9a4a6d91b4a23be91a462806b8162543bb6c95 Mon Sep 17 00:00:00 2001 From: Philipp Kapfer Date: Sat, 1 Jun 2013 11:28:02 +0200 Subject: [PATCH] Added cURL dependency for Amazon S3, Dropbox and SWIFT Conflicts: apps/files_external/lib/amazons3.php apps/files_external/lib/swift.php --- apps/files_external/appinfo/app.php | 9 ++++++--- apps/files_external/lib/amazons3.php | 12 ++++++++++++ apps/files_external/lib/dropbox.php | 12 ++++++++++++ apps/files_external/lib/swift.php | 12 ++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 39881b8455..f49d297323 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -41,7 +41,8 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( 'configuration' => array( 'key' => 'Key', 'secret' => '*Secret', - 'bucket' => 'Bucket'))); + 'bucket' => 'Bucket'), + 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', array( 'backend' => 'Dropbox', @@ -51,7 +52,8 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', array( 'app_secret' => 'App secret', 'token' => '#token', 'token_secret' => '#token_secret'), - 'custom' => 'dropbox')); + 'custom' => 'dropbox', + 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\FTP', array( 'backend' => 'FTP', @@ -79,7 +81,8 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\SWIFT', array( 'user' => 'Username', 'token' => '*Token', 'root' => '&Root', - 'secure' => '!Secure ftps://'))); + 'secure' => '!Secure ftps://'), + 'has_dependencies' => true)); OC_Mount_Config::registerBackend('\OC\Files\Storage\SMB', array( 'backend' => 'SMB / CIFS', diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 06ccd5d16f..969070360f 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -73,6 +73,18 @@ class AmazonS3 extends \OC\Files\Storage\Common { } } + /** + * check if curl is installed + */ + public static function checkDependencies() { + if (function_exists('curl_init')) { + return true; + } else { + $l = new \OC_L10N('files_external'); + return $l->t('Note: The cURL support in PHP is not enabled or installed. Mounting of Amazon S3 is not possible. Please ask your system administrator to install it.'); + } + } + public function __construct($params) { if (!isset($params['key']) || !isset($params['secret']) || !isset($params['bucket'])) { throw new \Exception("Access Key, Secret and Bucket have to be configured."); diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 0214e18020..f6a54bc0ca 100755 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -33,6 +33,18 @@ class Dropbox extends \OC\Files\Storage\Common { private static $tempFiles = array(); + /** + * check if curl is installed + */ + public static function checkDependencies() { + if (function_exists('curl_init')) { + return true; + } else { + $l = new \OC_L10N('files_external'); + return $l->t('Note: The cURL support in PHP is not enabled or installed. Mounting of Dropbox is not possible. Please ask your system administrator to install it.'); + } + } + public function __construct($params) { if (isset($params['configured']) && $params['configured'] == 'true' && isset($params['app_key']) diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 1337d9f581..a66d53fc1a 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -65,6 +65,18 @@ class Swift extends \OC\Files\Storage\Common { return $path; } + /** + * check if curl is installed + */ + public static function checkDependencies() { + if (function_exists('curl_init')) { + return true; + } else { + $l = new \OC_L10N('files_external'); + return $l->t('Note: 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.'); + } + } + /** * @param string $path */