Merge pull request #21059 from owncloud/remove-deaed-code-mount-config

Remove dead code
This commit is contained in:
Thomas Müller 2015-12-09 13:05:14 +01:00
commit bffd7a1d93
1 changed files with 6 additions and 52 deletions

View File

@ -90,6 +90,7 @@ class OC_Mount_Config {
$userStoragesService->setUser($user);
foreach ($userGlobalStoragesService->getStorages() as $storage) {
/** @var \OCA\Files_external\Lib\StorageConfig $storage */
$mountPoint = '/'.$uid.'/files'.$storage->getMountPoint();
$mountEntry = self::prepareMountPointEntry($storage, false);
foreach ($mountEntry['options'] as &$option) {
@ -266,26 +267,6 @@ class OC_Mount_Config {
return array();
}
/**
* Write the mount points to the config file
*
* @param string|null $user If not null, personal for $user, otherwise system
* @param array $data Mount points
*/
public static function writeData($user, $data) {
if (isset($user)) {
$file = \OC::$server->getUserManager()->get($user)->getHome() . '/mount.json';
} else {
$config = \OC::$server->getConfig();
$datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
$file = $config->getSystemValue('mount_file', $datadir . '/mount.json');
}
$content = json_encode($data, JSON_PRETTY_PRINT);
@file_put_contents($file, $content);
@chmod($file, 0640);
}
/**
* Get backend dependency message
* TODO: move into AppFramework along with templates
@ -396,40 +377,10 @@ class OC_Mount_Config {
return $cipher->decrypt($binaryPassword);
}
/**
* Merges mount points
*
* @param array $data Existing mount points
* @param array $mountPoint New mount point
* @param string $mountType
* @return array
*/
private static function mergeMountPoints($data, $mountPoint, $mountType) {
$applicable = key($mountPoint);
$mountPath = key($mountPoint[$applicable]);
if (isset($data[$mountType])) {
if (isset($data[$mountType][$applicable])) {
// Merge priorities
if (isset($data[$mountType][$applicable][$mountPath])
&& isset($data[$mountType][$applicable][$mountPath]['priority'])
&& !isset($mountPoint[$applicable][$mountPath]['priority'])
) {
$mountPoint[$applicable][$mountPath]['priority']
= $data[$mountType][$applicable][$mountPath]['priority'];
}
$data[$mountType][$applicable]
= array_merge($data[$mountType][$applicable], $mountPoint[$applicable]);
} else {
$data[$mountType] = array_merge($data[$mountType], $mountPoint);
}
} else {
$data[$mountType] = $mountPoint;
}
return $data;
}
/**
* Returns the encryption cipher
*
* @return AES
*/
private static function getCipher() {
$cipher = new AES(AES::MODE_CBC);
@ -441,6 +392,9 @@ class OC_Mount_Config {
* Computes a hash based on the given configuration.
* This is mostly used to find out whether configurations
* are the same.
*
* @param array $config
* @return string
*/
public static function makeConfigHash($config) {
$data = json_encode(