diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-01 19:40:55 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-01 19:40:55 +0200 |
commit | e68ca8695d252a2b70d4e2179b9eaf918b79c099 (patch) | |
tree | 9a2960418ff676052047f3356acda6921589b4e1 /lib/private/files | |
parent | 2945a61bca19a406d99ffa2331f0b683e62a9f6f (diff) | |
download | nextcloud-server-e68ca8695d252a2b70d4e2179b9eaf918b79c099.tar.gz nextcloud-server-e68ca8695d252a2b70d4e2179b9eaf918b79c099.zip |
Move lonely file from \OC\Files to PSR-4
Conflicting PR probabaly caused this
Diffstat (limited to 'lib/private/files')
-rw-r--r-- | lib/private/files/mount/cachemountprovider.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/private/files/mount/cachemountprovider.php b/lib/private/files/mount/cachemountprovider.php deleted file mode 100644 index c8422c4a507..00000000000 --- a/lib/private/files/mount/cachemountprovider.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * @author Robin Appelman <icewind@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OC\Files\Mount; - -use OCP\Files\Config\IMountProvider; -use OCP\Files\Storage\IStorageFactory; -use OCP\IConfig; -use OCP\IUser; - -/** - * Mount provider for custom cache storages - */ -class CacheMountProvider implements IMountProvider { - /** - * @var IConfig - */ - private $config; - - /** - * ObjectStoreHomeMountProvider constructor. - * - * @param IConfig $config - */ - public function __construct(IConfig $config) { - $this->config = $config; - } - - /** - * Get the cache mount for a user - * - * @param IUser $user - * @param IStorageFactory $loader - * @return \OCP\Files\Mount\IMountPoint[] - */ - public function getMountsForUser(IUser $user, IStorageFactory $loader) { - $cacheBaseDir = $this->config->getSystemValue('cache_path', ''); - if ($cacheBaseDir !== '') { - $cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user->getUID(); - if (!file_exists($cacheDir)) { - mkdir($cacheDir, 0770, true); - } - - return [ - new MountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/cache', ['datadir' => $cacheDir, $loader]) - ]; - } else { - return []; - } - } -} |