Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92658436
PhabricatorFilesManagementWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 11:51
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 11:51 (2 d)
Engine
blob
Format
Raw Data
Handle
22479563
Attached To
rPH Phabricator
PhabricatorFilesManagementWorkflow.php
View Options
<?php
abstract
class
PhabricatorFilesManagementWorkflow
extends
PhabricatorManagementWorkflow
{
protected
function
buildIterator
(
PhutilArgumentParser
$args
)
{
$names
=
$args
->
getArg
(
'names'
);
if
(
$args
->
getArg
(
'all'
))
{
if
(
$names
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify either a list of files or `%s`, but not both.'
,
'--all'
));
}
return
new
LiskMigrationIterator
(
new
PhabricatorFile
());
}
if
(
$names
)
{
return
$this
->
loadFilesWithNames
(
$names
);
}
return
null
;
}
protected
function
loadFilesWithNames
(
array
$names
)
{
$query
=
id
(
new
PhabricatorObjectQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withNames
(
$names
)
->
withTypes
(
array
(
PhabricatorFileFilePHIDType
::
TYPECONST
));
$query
->
execute
();
$files
=
$query
->
getNamedResults
();
foreach
(
$names
as
$name
)
{
if
(
empty
(
$files
[
$name
]))
{
throw
new
PhutilArgumentUsageException
(
pht
(
"No file '%s' exists!"
,
$name
));
}
}
return
array_values
(
$files
);
}
}
Event Timeline
Log In to Comment