Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65519179
PhabricatorStorageManagementStatusWorkflow.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, Jun 4, 09:13
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jun 6, 09:13 (2 d)
Engine
blob
Format
Raw Data
Handle
18085906
Attached To
rPH Phabricator
PhabricatorStorageManagementStatusWorkflow.php
View Options
<?php
final
class
PhabricatorStorageManagementStatusWorkflow
extends
PhabricatorStorageManagementWorkflow
{
public
function
didConstruct
()
{
$this
->
setName
(
'status'
)
->
setExamples
(
'**status** [__options__]'
)
->
setSynopsis
(
'Show patch application status.'
);
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$api
=
$this
->
getAPI
();
$patches
=
$this
->
getPatches
();
$applied
=
$api
->
getAppliedPatches
();
if
(
$applied
===
null
)
{
echo
phutil_console_format
(
"**Database Not Initialized**: Run **storage upgrade** to "
.
"initialize.
\n
"
);
return
1
;
}
$len
=
0
;
foreach
(
$patches
as
$patch
)
{
$len
=
max
(
$len
,
strlen
(
$patch
->
getFullKey
()));
}
foreach
(
$patches
as
$patch
)
{
printf
(
"% -"
.(
$len
+
2
).
"s "
.
"%-"
.
strlen
(
'Not Applied'
).
"s "
.
"%-4s "
.
"%s
\n
"
,
$patch
->
getFullKey
(),
in_array
(
$patch
->
getFullKey
(),
$applied
)
?
'Applied'
:
'Not Applied'
,
$patch
->
getType
(),
$patch
->
getName
());
}
return
0
;
}
}
Event Timeline
Log In to Comment