mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Update old storage classes names to the new namespace during mounting
This commit is contained in:
parent
f144be8857
commit
38876fc98a
2 changed files with 16 additions and 1 deletions
|
|
@ -120,6 +120,10 @@ class OC_Mount_Config {
|
|||
if (isset($mountPoints[self::MOUNT_TYPE_GROUP])) {
|
||||
foreach ($mountPoints[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
|
||||
foreach ($mounts as $mountPoint => $mount) {
|
||||
// Update old classes to new namespace
|
||||
if (strpos($mount['class'], 'OC_Filestorage_') !== false) {
|
||||
$mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15, strlen($mount['class']) - 15);
|
||||
}
|
||||
// Remove '/$user/files/' from mount point
|
||||
$mountPoint = substr($mountPoint, 13);
|
||||
// Merge the mount point into the current mount points
|
||||
|
|
@ -139,6 +143,10 @@ class OC_Mount_Config {
|
|||
if (isset($mountPoints[self::MOUNT_TYPE_USER])) {
|
||||
foreach ($mountPoints[self::MOUNT_TYPE_USER] as $user => $mounts) {
|
||||
foreach ($mounts as $mountPoint => $mount) {
|
||||
// Update old classes to new namespace
|
||||
if (strpos($mount['class'], 'OC_Filestorage_') !== false) {
|
||||
$mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15, strlen($mount['class']) - 15);
|
||||
}
|
||||
// Remove '/$user/files/' from mount point
|
||||
$mountPoint = substr($mountPoint, 13);
|
||||
// Merge the mount point into the current mount points
|
||||
|
|
@ -169,6 +177,10 @@ class OC_Mount_Config {
|
|||
$personal = array();
|
||||
if (isset($mountPoints[self::MOUNT_TYPE_USER][$uid])) {
|
||||
foreach ($mountPoints[self::MOUNT_TYPE_USER][$uid] as $mountPoint => $mount) {
|
||||
// Update old classes to new namespace
|
||||
if (strpos($mount['class'], 'OC_Filestorage_') !== false) {
|
||||
$mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15, strlen($mount['class']) - 15);
|
||||
}
|
||||
// Remove '/uid/files/' from mount point
|
||||
$personal[substr($mountPoint, strlen($uid) + 8)] = array('class' => $mount['class'],
|
||||
'backend' => $backends[$mount['class']]['backend'],
|
||||
|
|
|
|||
|
|
@ -364,7 +364,10 @@ class Filesystem {
|
|||
if (strlen($mountpoint) > 1) {
|
||||
$mountpoint .= '/';
|
||||
}
|
||||
|
||||
// Update old classes to new namespace
|
||||
if (strpos($class, 'OC_Filestorage_') !== false) {
|
||||
$class = '\OC\Files\Storage\\'.substr($class, 15, strlen($class) - 15);
|
||||
}
|
||||
if ($class instanceof \OC\Files\Storage\Storage) {
|
||||
self::$mounts[$mountpoint] = array('class' => get_class($class), 'arguments' => $arguments);
|
||||
self::$storages[$mountpoint] = $class;
|
||||
|
|
|
|||
Loading…
Reference in a new issue