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
db033e4e
Commit
db033e4e
authored
10 years ago
by
Lukas Reschke
Browse files
Options
Downloads
Patches
Plain Diff
Fix PHPDoc and Co.
Ref
https://github.com/owncloud/core/pull/14929#discussion_r26501240
parent
65259114
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_sharing/lib/external/scanner.php
+12
-4
12 additions, 4 deletions
apps/files_sharing/lib/external/scanner.php
with
12 additions
and
4 deletions
apps/files_sharing/lib/external/scanner.php
+
12
−
4
View file @
db033e4e
...
@@ -14,11 +14,10 @@ use OCP\Files\StorageInvalidException;
...
@@ -14,11 +14,10 @@ use OCP\Files\StorageInvalidException;
use
OCP\Files\StorageNotAvailableException
;
use
OCP\Files\StorageNotAvailableException
;
class
Scanner
extends
\OC\Files\Cache\Scanner
{
class
Scanner
extends
\OC\Files\Cache\Scanner
{
/**
/** @var \OCA\Files_Sharing\External\Storage */
* @var \OCA\Files_Sharing\External\Storage
*/
protected
$storage
;
protected
$storage
;
/** {@inheritDoc} */
public
function
scan
(
$path
,
$recursive
=
self
::
SCAN_RECURSIVE
,
$reuse
=
-
1
)
{
public
function
scan
(
$path
,
$recursive
=
self
::
SCAN_RECURSIVE
,
$reuse
=
-
1
)
{
$this
->
scanAll
();
$this
->
scanAll
();
}
}
...
@@ -31,6 +30,8 @@ class Scanner extends \OC\Files\Cache\Scanner {
...
@@ -31,6 +30,8 @@ class Scanner extends \OC\Files\Cache\Scanner {
*
*
* @param string $file file to scan
* @param string $file file to scan
* @param int $reuseExisting
* @param int $reuseExisting
* @param int $parentId
* @param array | null $cacheData existing data in the cache for the file to be scanned
* @return array an array of metadata of the scanned file
* @return array an array of metadata of the scanned file
*/
*/
public
function
scanFile
(
$file
,
$reuseExisting
=
0
,
$parentId
=
-
1
,
$cacheData
=
null
)
{
public
function
scanFile
(
$file
,
$reuseExisting
=
0
,
$parentId
=
-
1
,
$cacheData
=
null
)
{
...
@@ -54,6 +55,9 @@ class Scanner extends \OC\Files\Cache\Scanner {
...
@@ -54,6 +55,9 @@ class Scanner extends \OC\Files\Cache\Scanner {
* Checks the remote share for changes.
* Checks the remote share for changes.
* If changes are available, scan them and update
* If changes are available, scan them and update
* the cache.
* the cache.
* @throws NotFoundException
* @throws StorageInvalidException
* @throws \Exception
*/
*/
public
function
scanAll
()
{
public
function
scanAll
()
{
try
{
try
{
...
@@ -76,10 +80,14 @@ class Scanner extends \OC\Files\Cache\Scanner {
...
@@ -76,10 +80,14 @@ class Scanner extends \OC\Files\Cache\Scanner {
}
}
}
}
/**
* @param array $data
* @param string $path
*/
private
function
addResult
(
$data
,
$path
)
{
private
function
addResult
(
$data
,
$path
)
{
$id
=
$this
->
cache
->
put
(
$path
,
$data
);
$id
=
$this
->
cache
->
put
(
$path
,
$data
);
if
(
isset
(
$data
[
'children'
]))
{
if
(
isset
(
$data
[
'children'
]))
{
$children
=
array
()
;
$children
=
[]
;
foreach
(
$data
[
'children'
]
as
$child
)
{
foreach
(
$data
[
'children'
]
as
$child
)
{
$children
[
$child
[
'name'
]]
=
true
;
$children
[
$child
[
'name'
]]
=
true
;
$this
->
addResult
(
$child
,
ltrim
(
$path
.
'/'
.
$child
[
'name'
],
'/'
));
$this
->
addResult
(
$child
,
ltrim
(
$path
.
'/'
.
$child
[
'name'
],
'/'
));
...
...
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