Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
d9e07ca6
Commit
d9e07ca6
authored
12 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
Adjust to Icewind's fix
parent
1a874b91
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/files/cache/upgrade.php
+0
-51
0 additions, 51 deletions
lib/files/cache/upgrade.php
with
0 additions
and
51 deletions
lib/files/cache/upgrade.php
+
0
−
51
View file @
d9e07ca6
...
...
@@ -143,7 +143,6 @@ class Upgrade {
$newData
[
'storage_object'
]
=
$storage
;
$newData
[
'mimetype'
]
=
$this
->
getMimetypeId
(
$newData
[
'mimetype'
],
$storage
);
$newData
[
'mimepart'
]
=
$this
->
getMimetypeId
(
$newData
[
'mimepart'
],
$storage
);
$newData
[
'etag'
]
=
$this
->
getETag
(
$data
[
'path'
],
$data
[
'user'
],
$internalPath
,
$storage
);
return
$newData
;
}
else
{
\OC_Log
::
write
(
'core'
,
'Unable to migrate data from old cache for '
.
$data
[
'path'
]
.
' because the storage was not found'
,
\OC_Log
::
ERROR
);
...
...
@@ -151,56 +150,6 @@ class Upgrade {
}
}
/**
* get a file`s E-Tag
*
* @param string $legacyPath in the form of a legacy path
* @param string $user the user ID the file referred to in path belongs to
* @param string $internalPath
* @param \OC\Files\Storage\Storage $storage
* @return string Etag
*/
function
getETag
(
$legacyPath
,
$user
,
$internalPath
,
$storage
)
{
static
$queryGetETag
=
null
;
static
$queryCleanUp
=
null
;
//the path in the database is stored wo /$user/files
//we need to strip it off, care is taken if user == files
$offset
=
strpos
(
$legacyPath
,
'/files/'
,
2
)
+
6
;
$legacyPath
=
substr
(
$legacyPath
,
$offset
);
//Look for the E-Tag in the old database
if
(
is_null
(
$queryGetETag
))
{
$queryGetETag
=
\OC_DB
::
prepare
(
'
SELECT `propertyvalue`
FROM `*PREFIX*properties`
WHERE `propertyname` = \'{DAV:}getetag\'
AND `propertypath` = ?
AND `userid` = ?
'
,
1
);
}
$result
=
$queryGetETag
->
execute
(
array
(
$legacyPath
,
$user
));
$etag
=
$result
->
fetchOne
();
if
(
$etag
)
{
if
(
is_null
(
$queryCleanUp
))
{
$queryCleanUp
=
\OC_DB
::
prepare
(
'
DELETE FROM `*PREFIX*properties`
WHERE `propertyname` = \'{DAV:}getetag\'
AND `propertypath` = ?
AND `userid` = ?
'
);
}
//On success: remove the old DB entry and return the value
$queryCleanUp
->
execute
(
array
(
$legacyPath
,
$user
));
return
$etag
;
}
//No etag detected, determine it with new methods
return
$storage
->
getETag
(
$internalPath
);
}
/**
* get the numeric storage id
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment