}
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;
}
* @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)) {
$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(),
$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(),
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;