Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix lint
Signed-off-by: Lorenzo Tanganelli <[email protected]>
  • Loading branch information
tanganellilore committed Jun 21, 2024
commit 680b08954fced4568e9a720347aeffd46617cfe1
24 changes: 12 additions & 12 deletions lib/private/Files/Mount/CacheMountProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@ public function __construct(IConfig $config) {
*/
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
$cacheBaseDir = $this->config->getSystemValueString('cache_path', '');
$mounts = [];
$mounts = [];
if ($cacheBaseDir !== '') {
$cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user->getUID();
if (!file_exists($cacheDir)) {
mkdir($cacheDir, 0770, true);
}
$mounts[] = new MountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/cache', ['datadir' => $cacheDir], $loader, null, null, self::class);
$mounts[] = new MountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/cache', ['datadir' => $cacheDir], $loader, null, null, self::class);
}

$uploadsPath = $this->config->getSystemValueString('uploads_path', $this->config->getSystemValueString('cache_path', ''));
if ($uploadsPath !== '') {
$uploadsDir = rtrim($uploadsPath, '/') . '/' . $user->getUID() . '/uploads';
if (!file_exists($uploadsDir)) {
mkdir($uploadsDir, 0770, true);
}
$mounts[] = new MountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/uploads', ['datadir' => $uploadsDir], $loader, null, null, self::class);
}
return $mounts;
$uploadsPath = $this->config->getSystemValueString('uploads_path', $this->config->getSystemValueString('cache_path', ''));
if ($uploadsPath !== '') {
$uploadsDir = rtrim($uploadsPath, '/') . '/' . $user->getUID() . '/uploads';
if (!file_exists($uploadsDir)) {
mkdir($uploadsDir, 0770, true);
}
$mounts[] = new MountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/uploads', ['datadir' => $uploadsDir], $loader, null, null, self::class);
}
return $mounts;
}
}