summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-08 14:30:56 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-08 14:30:56 +0200
commitd01a2acbcf2aa0dbea56bc1ad7cb855dfabdd746 (patch)
tree9210a4a50b10d16ab91387b23dd742ea051ed12a
parent69ba67ec0fced3afcd5c3091224ba902d037f954 (diff)
parentc3c50fb481318c5f2ab3b554dd12c84983b916e8 (diff)
downloadnextcloud-server-d01a2acbcf2aa0dbea56bc1ad7cb855dfabdd746.tar.gz
nextcloud-server-d01a2acbcf2aa0dbea56bc1ad7cb855dfabdd746.zip
Merge pull request #15469 from owncloud/fix/15463
Fix language level incompatibilties
-rw-r--r--apps/files_external/lib/sftp_key.php9
-rw-r--r--apps/files_external/service/globalstoragesservice.php11
-rw-r--r--apps/files_external/service/storagesservice.php6
3 files changed, 20 insertions, 6 deletions
diff --git a/apps/files_external/lib/sftp_key.php b/apps/files_external/lib/sftp_key.php
index c460d81b8f0..d9bcadb9eb7 100644
--- a/apps/files_external/lib/sftp_key.php
+++ b/apps/files_external/lib/sftp_key.php
@@ -135,11 +135,16 @@ class SFTP_Key extends \OC\Files\Storage\SFTP {
}
public function test() {
- if (empty($this->getHost())) {
+
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
+ $host = $this->getHost();
+ if (empty($host)) {
\OC::$server->getLogger()->warning('Hostname has not been specified');
return false;
}
- if (empty($this->getUser())) {
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
+ $user = $this->getUser();
+ if (empty($user)) {
\OC::$server->getLogger()->warning('Username has not been specified');
return false;
}
diff --git a/apps/files_external/service/globalstoragesservice.php b/apps/files_external/service/globalstoragesservice.php
index 011730390b0..7df0f73f652 100644
--- a/apps/files_external/service/globalstoragesservice.php
+++ b/apps/files_external/service/globalstoragesservice.php
@@ -101,6 +101,7 @@ class GlobalStoragesService extends StoragesService {
* @param string $signal signal to trigger
*/
protected function triggerHooks(StorageConfig $storage, $signal) {
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
$applicableUsers = $storage->getApplicableUsers();
$applicableGroups = $storage->getApplicableGroups();
if (empty($applicableUsers) && empty($applicableGroups)) {
@@ -149,8 +150,11 @@ class GlobalStoragesService extends StoragesService {
$groupAdditions = array_diff($newStorage->getApplicableGroups(), $oldStorage->getApplicableGroups());
$groupDeletions = array_diff($oldStorage->getApplicableGroups(), $newStorage->getApplicableGroups());
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
// if no applicable were set, raise a signal for "all"
- if (empty($oldStorage->getApplicableUsers()) && empty($oldStorage->getApplicableGroups())) {
+ $oldApplicableUsers = $oldStorage->getApplicableUsers();
+ $oldApplicableGroups = $oldStorage->getApplicableGroups();
+ if (empty($oldApplicableUsers) && empty($oldApplicableGroups)) {
$this->triggerApplicableHooks(
Filesystem::signal_delete_mount,
$oldStorage->getMountPoint(),
@@ -191,8 +195,11 @@ class GlobalStoragesService extends StoragesService {
$groupAdditions
);
+ // FIXME: Use as expression in empty once PHP 5.4 support is dropped
// if no applicable, raise a signal for "all"
- if (empty($newStorage->getApplicableUsers()) && empty($newStorage->getApplicableGroups())) {
+ $newApplicableUsers = $newStorage->getApplicableUsers();
+ $newApplicableGroups = $newStorage->getApplicableGroups();
+ if (empty($newApplicableUsers) && empty($newApplicableGroups)) {
$this->triggerApplicableHooks(
Filesystem::signal_create_mount,
$newStorage->getMountPoint(),
diff --git a/apps/files_external/service/storagesservice.php b/apps/files_external/service/storagesservice.php
index 399a56677bf..51eb4abcc00 100644
--- a/apps/files_external/service/storagesservice.php
+++ b/apps/files_external/service/storagesservice.php
@@ -227,8 +227,10 @@ abstract class StoragesService {
if (!is_null($storageConfig->getPriority())) {
$options['priority'] = $storageConfig->getPriority();
}
- if (!empty($storageConfig->getMountOptions())) {
- $options['mountOptions'] = $storageConfig->getMountOptions();
+
+ $mountOptions = $storageConfig->getMountOptions();
+ if (!empty($mountOptions)) {
+ $options['mountOptions'] = $mountOptions;
}
$mountPoints[$mountType][$applicable][$rootMountPoint] = $options;