Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96568775
PhabricatorDaemonManagementLaunchWorkflow.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
Sat, Dec 28, 06:26
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 30, 06:26 (2 d)
Engine
blob
Format
Raw Data
Handle
23208081
Attached To
rPH Phabricator
PhabricatorDaemonManagementLaunchWorkflow.php
View Options
<?php
final
class
PhabricatorDaemonManagementLaunchWorkflow
extends
PhabricatorDaemonManagementWorkflow
{
public
function
shouldParsePartial
()
{
return
true
;
}
protected
function
didConstruct
()
{
$this
->
setName
(
'launch'
)
->
setExamples
(
'**launch** [n] __daemon__ [options]'
)
->
setSynopsis
(
pht
(
'Start a specific __daemon__, or __n__ copies of a specific '
.
'__daemon__.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'argv'
,
'wildcard'
=>
true
,
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$argv
=
$args
->
getArg
(
'argv'
);
$daemon_count
=
1
;
if
(
$argv
)
{
if
(
is_numeric
(
head
(
$argv
)))
{
$daemon_count
=
array_shift
(
$argv
);
}
if
(
$daemon_count
<
1
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'You must launch at least one daemon.'
));
}
}
if
(!
$argv
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'You must specify which daemon to launch.'
));
}
$daemon
=
array
();
$daemon
[
'class'
]
=
array_shift
(
$argv
);
$daemon
[
'argv'
]
=
$argv
;
$daemons
=
array_fill
(
0
,
$daemon_count
,
$daemon
);
$this
->
launchDaemons
(
$daemons
,
$is_debug
=
false
);
return
0
;
}
}
Event Timeline
Log In to Comment