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
3cdaa409
Commit
3cdaa409
authored
10 years ago
by
Jörn Friedrich Dreyer
Browse files
Options
Downloads
Patches
Plain Diff
add quiet option, ref #8794
parent
7ef6df04
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/command/scan.php
+18
-9
18 additions, 9 deletions
apps/files/command/scan.php
with
18 additions
and
9 deletions
apps/files/command/scan.php
+
18
−
9
View file @
3cdaa409
...
...
@@ -39,11 +39,17 @@ class Scan extends Command {
)
->
addOption
(
'path'
,
null
,
'p'
,
InputArgument
::
OPTIONAL
,
'limit rescan to this path, eg. --path="files/Music"'
,
''
)
->
addOption
(
'quiet'
,
'q'
,
InputOption
::
VALUE_NONE
,
'suppress output'
)
->
addOption
(
'all'
,
null
,
...
...
@@ -52,14 +58,16 @@ class Scan extends Command {
);
}
protected
function
scanFiles
(
$user
,
$path
,
OutputInterface
$output
)
{
protected
function
scanFiles
(
$user
,
$path
,
$quiet
,
OutputInterface
$output
)
{
$scanner
=
new
\OC\Files\Utils\Scanner
(
$user
,
\OC
::
$server
->
getDatabaseConnection
());
$scanner
->
listen
(
'\OC\Files\Utils\Scanner'
,
'scanFile'
,
function
(
$path
)
use
(
$output
)
{
$output
->
writeln
(
"Scanning <info>
$path
</info>"
);
});
$scanner
->
listen
(
'\OC\Files\Utils\Scanner'
,
'scanFolder'
,
function
(
$path
)
use
(
$output
)
{
$output
->
writeln
(
"Scanning <info>
$path
</info>"
);
});
if
(
!
$quiet
)
{
$scanner
->
listen
(
'\OC\Files\Utils\Scanner'
,
'scanFile'
,
function
(
$path
)
use
(
$output
)
{
$output
->
writeln
(
"Scanning <info>
$path
</info>"
);
});
$scanner
->
listen
(
'\OC\Files\Utils\Scanner'
,
'scanFolder'
,
function
(
$path
)
use
(
$output
)
{
$output
->
writeln
(
"Scanning <info>
$path
</info>"
);
});
}
try
{
$scanner
->
scan
(
$path
);
}
catch
(
ForbiddenException
$e
)
{
...
...
@@ -75,6 +83,7 @@ class Scan extends Command {
$users
=
$input
->
getArgument
(
'user_id'
);
}
$path
=
trim
(
$input
->
getOption
(
'path'
),
'/'
);
$quiet
=
$input
->
getOption
(
'quiet'
);
if
(
count
(
$users
)
===
0
)
{
$output
->
writeln
(
"<error>Please specify the user id to scan or
\"
--all
\"
to scan for all users</error>"
);
...
...
@@ -86,7 +95,7 @@ class Scan extends Command {
$user
=
$user
->
getUID
();
}
if
(
$this
->
userManager
->
userExists
(
$user
))
{
$this
->
scanFiles
(
$user
,
$path
,
$output
);
$this
->
scanFiles
(
$user
,
$path
,
$quiet
,
$output
);
}
else
{
$output
->
writeln
(
"<error>Unknown user
$user
</error>"
);
}
...
...
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