Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-22 11:21:18 +0300
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-22 11:21:18 +0300
commit53c731d8f975ec8b0e577f7e348873a8833a1b38 (patch)
tree5a261c655015110349231f222f77f3f6d9c50c20 /apps/files_trashbin
parent865ac4b6e02b59cc69df587a6ba1d3c92969a514 (diff)
Rename PATH constants to show if folder or file
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
index c416ef0f810..fad8103e796 100644
--- a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
+++ b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
@@ -42,8 +42,8 @@ class TrashbinMigrator implements IMigrator {
use TMigratorBasicVersionHandling;
- protected const PATH_FILES = Application::APP_ID.'/files';
- protected const PATH_LOCATIONS = Application::APP_ID.'/locations.json';
+ protected const PATH_FILES_FOLDER = Application::APP_ID.'/files';
+ protected const PATH_LOCATIONS_FILE = Application::APP_ID.'/locations.json';
protected IRootFolder $root;
@@ -68,11 +68,11 @@ class TrashbinMigrator implements IMigrator {
try {
$trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin');
$output->writeln("Exporting trashbin…");
- if ($exportDestination->copyFolder($trashbinFolder, static::PATH_FILES) === false) {
+ if ($exportDestination->copyFolder($trashbinFolder, static::PATH_FILES_FOLDER) === false) {
throw new UserMigrationException("Could not export trashbin.");
}
$originalLocations = \OCA\Files_Trashbin\Trashbin::getLocations($uid);
- if ($exportDestination->addFileContents(static::PATH_LOCATIONS, json_encode($originalLocations)) === false) {
+ if ($exportDestination->addFileContents(static::PATH_LOCATIONS_FILE, json_encode($originalLocations)) === false) {
throw new UserMigrationException("Could not export trashbin.");
}
} catch (NotFoundException $e) {
@@ -93,17 +93,17 @@ class TrashbinMigrator implements IMigrator {
$uid = $user->getUID();
- if ($importSource->pathExists(static::PATH_FILES)) {
+ if ($importSource->pathExists(static::PATH_FILES_FOLDER)) {
try {
$trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin');
} catch (NotFoundException $e) {
$trashbinFolder = $this->root->newFolder('/'.$uid.'/files_trashbin');
}
$output->writeln("Importing trashbin files…");
- if ($importSource->copyToFolder($trashbinFolder, static::PATH_FILES) === false) {
+ if ($importSource->copyToFolder($trashbinFolder, static::PATH_FILES_FOLDER) === false) {
throw new UserMigrationException("Could not import trashbin.");
}
- $locations = json_decode($importSource->getFileContents(static::PATH_LOCATIONS), true, 512, JSON_THROW_ON_ERROR);
+ $locations = json_decode($importSource->getFileContents(static::PATH_LOCATIONS_FILE), true, 512, JSON_THROW_ON_ERROR);
$qb = $this->dbc->getQueryBuilder();
$qb->insert('files_trash')
->values([