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
aa103bd5
Commit
aa103bd5
authored
12 years ago
by
Jörn Friedrich Dreyer
Browse files
Options
Downloads
Patches
Plain Diff
supress write hook for .part files
parent
4a70315a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/files/cache/scanner.php
+3
-6
3 additions, 6 deletions
lib/files/cache/scanner.php
lib/files/view.php
+3
-3
3 additions, 3 deletions
lib/files/view.php
with
6 additions
and
9 deletions
lib/files/cache/scanner.php
+
3
−
6
View file @
aa103bd5
...
...
@@ -62,7 +62,7 @@ class Scanner {
* @return array with metadata of the scanned file
*/
public
function
scanFile
(
$file
,
$checkExisting
=
false
)
{
if
(
!
$this
->
isIgnoredFile
(
$file
))
{
if
(
!
self
::
isIgnoredFile
(
$file
))
{
\OC_Hook
::
emit
(
'\OC\Files\Cache\Scanner'
,
'scan_file'
,
array
(
'path'
=>
$file
,
'storage'
=>
$this
->
storageId
));
$data
=
$this
->
getData
(
$file
);
if
(
$data
)
{
...
...
@@ -90,7 +90,6 @@ class Scanner {
}
return
$data
;
}
\OCP\Util
::
writeLog
(
'scanner'
,
'Ignoring '
.
$file
.
' and not triggering scan_file hook.'
,
\OCP\Util
::
DEBUG
);
return
null
;
}
...
...
@@ -155,9 +154,7 @@ class Scanner {
* @return boolean
*/
private
function
isIgnoredDir
(
$dir
)
{
if
(
$dir
===
'.'
||
$dir
===
'..'
||
\OC\Files\Filesystem
::
isFileBlacklisted
(
$file
)
)
{
if
(
$dir
===
'.'
||
$dir
===
'..'
)
{
return
true
;
}
return
false
;
...
...
@@ -169,7 +166,7 @@ class Scanner {
* @param String $file
* @return boolean
*/
p
rivate
function
isIgnoredFile
(
$file
)
{
p
ublic
static
function
isIgnoredFile
(
$file
)
{
if
(
pathinfo
(
$file
,
PATHINFO_EXTENSION
)
===
'part'
||
\OC\Files\Filesystem
::
isFileBlacklisted
(
$file
)
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/files/view.php
+
3
−
3
View file @
aa103bd5
...
...
@@ -267,7 +267,7 @@ class View {
$path
=
$this
->
getRelativePath
(
$absolutePath
);
$exists
=
$this
->
file_exists
(
$path
);
$run
=
true
;
if
(
$this
->
fakeRoot
==
Filesystem
::
getRoot
())
{
if
(
$this
->
fakeRoot
==
Filesystem
::
getRoot
()
&&
!
Cache\Scanner
::
isIgnoredFile
(
$path
)
)
{
if
(
!
$exists
)
{
\OC_Hook
::
emit
(
Filesystem
::
CLASSNAME
,
...
...
@@ -295,7 +295,7 @@ class View {
list
(
$count
,
$result
)
=
\OC_Helper
::
streamCopy
(
$data
,
$target
);
fclose
(
$target
);
fclose
(
$data
);
if
(
$this
->
fakeRoot
==
Filesystem
::
getRoot
())
{
if
(
$this
->
fakeRoot
==
Filesystem
::
getRoot
()
&&
!
Cache\Scanner
::
isIgnoredFile
(
$path
)
)
{
if
(
!
$exists
)
{
\OC_Hook
::
emit
(
Filesystem
::
CLASSNAME
,
...
...
@@ -627,7 +627,7 @@ class View {
private
function
runHooks
(
$hooks
,
$path
,
$post
=
false
)
{
$prefix
=
(
$post
)
?
'post_'
:
''
;
$run
=
true
;
if
(
Filesystem
::
$loaded
and
$this
->
fakeRoot
==
Filesystem
::
getRoot
())
{
if
(
Filesystem
::
$loaded
and
$this
->
fakeRoot
==
Filesystem
::
getRoot
()
&&
!
Cache\Scanner
::
isIgnoredFile
(
$path
)
)
{
foreach
(
$hooks
as
$hook
)
{
if
(
$hook
!=
'read'
)
{
\OC_Hook
::
emit
(
...
...
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