Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82219722
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
Tue, Sep 10, 05:58
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Sep 12, 05:58 (2 d)
Engine
blob
Format
Raw Data
Handle
20654281
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