diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-16 01:50:40 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-02-16 01:50:40 +0100 |
commit | 6da2c6c83e48fc3c7f8dd0814fe815d2b772f6eb (patch) | |
tree | 43473eb0df1c01ed75ce29aac6f98b9989d8d281 /lib/files/filesystem.php | |
parent | 46626915ef6888c958111b259ae6c0d3729b5198 (diff) | |
download | nextcloud-server-6da2c6c83e48fc3c7f8dd0814fe815d2b772f6eb.tar.gz nextcloud-server-6da2c6c83e48fc3c7f8dd0814fe815d2b772f6eb.zip |
Create new mountconfig files in json
Diffstat (limited to 'lib/files/filesystem.php')
-rw-r--r-- | lib/files/filesystem.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 89a9ab29212..cba469e06c4 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -218,8 +218,12 @@ class Filesystem { $parser = new \OC\ArrayParser(); // Load system mount points - if (is_file(\OC::$SERVERROOT . '/config/mount.php')) { - $mountConfig = $parser->parsePHP(file_get_contents(\OC::$SERVERROOT . '/config/mount.php')); + if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file(\OC::$SERVERROOT . '/config/mount.json')) { + if(is_file(\OC::$SERVERROOT . '/config/mount.json')){ + $mountConfig = json_decode(file_get_contents(\OC::$SERVERROOT . '/config/mount.json'), true); + }elseif(is_file(\OC::$SERVERROOT . '/config/mount.php')){ + $mountConfig = $parser->parsePHP(file_get_contents(\OC::$SERVERROOT . '/config/mount.php')); + } if (isset($mountConfig['global'])) { foreach ($mountConfig['global'] as $mountPoint => $options) { self::mount($options['class'], $options['options'], $mountPoint); @@ -255,8 +259,12 @@ class Filesystem { // Load personal mount points $root = \OC_User::getHome($user); self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user); - if (is_file($root . '/mount.php')) { - $mountConfig = $parser->parsePHP(file_get_contents($root . '/mount.php')); + if (is_file($root . '/mount.php') or is_file($root . '/mount.json')) { + if (is_file($root . '/mount.json')){ + $mountConfig = json_decode(file_get_contents($root . '/mount.json'), true); + } elseif (is_file($root . '/mount.php')){ + $mountConfig = $parser->parsePHP(file_get_contents($root . '/mount.php')); + } if (isset($mountConfig['user'][$user])) { foreach ($mountConfig['user'][$user] as $mountPoint => $options) { self::mount($options['class'], $options['options'], $mountPoint); |