Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92648584
PhabricatorFactManagementAnalyzeWorkflow.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, 09:15
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 09:15 (2 d)
Engine
blob
Format
Raw Data
Handle
22478080
Attached To
rPH Phabricator
PhabricatorFactManagementAnalyzeWorkflow.php
View Options
<?php
final
class
PhabricatorFactManagementAnalyzeWorkflow
extends
PhabricatorFactManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'analyze'
)
->
setSynopsis
(
pht
(
'Manually invoke fact analyzers.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'iterator'
,
'param'
=>
'name'
,
'repeat'
=>
true
,
'help'
=>
pht
(
'Process only iterator __name__.'
),
),
array
(
'name'
=>
'all'
,
'help'
=>
pht
(
'Analyze from the beginning, ignoring cursors.'
),
),
array
(
'name'
=>
'skip-aggregates'
,
'help'
=>
pht
(
'Skip analysis of aggregate facts.'
),
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$daemon
=
new
PhabricatorFactDaemon
(
array
());
$daemon
->
setVerbose
(
true
);
$daemon
->
setEngines
(
PhabricatorFactEngine
::
loadAllEngines
());
$iterators
=
PhabricatorFactDaemon
::
getAllApplicationIterators
();
$selected
=
$args
->
getArg
(
'iterator'
);
if
(
$selected
)
{
$use
=
array
();
foreach
(
$selected
as
$iterator_name
)
{
if
(
isset
(
$iterators
[
$iterator_name
]))
{
$use
[
$iterator_name
]
=
$iterators
[
$iterator_name
];
}
else
{
$console
->
writeErr
(
"%s
\n
"
,
pht
(
"Iterator '%s' does not exist."
,
$iterator_name
));
}
}
$iterators
=
$use
;
}
foreach
(
$iterators
as
$iterator_name
=>
$iterator
)
{
if
(
$args
->
getArg
(
'all'
))
{
$daemon
->
processIterator
(
$iterator
);
}
else
{
$daemon
->
processIteratorWithCursor
(
$iterator_name
,
$iterator
);
}
}
if
(!
$args
->
getArg
(
'skip-aggregates'
))
{
$daemon
->
processAggregates
();
}
return
0
;
}
}
Event Timeline
Log In to Comment