Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101644971
PhabricatorApplicationUninstallTransaction.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
Wed, Feb 12, 09:51
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Feb 14, 09:51 (2 d)
Engine
blob
Format
Raw Data
Handle
24207257
Attached To
rPH Phabricator
PhabricatorApplicationUninstallTransaction.php
View Options
<?php
final
class
PhabricatorApplicationUninstallTransaction
extends
PhabricatorApplicationTransactionType
{
const
TRANSACTIONTYPE
=
'application.uninstall'
;
public
function
generateOldValue
(
$object
)
{
$key
=
'phabricator.uninstalled-applications'
;
$config_entry
=
PhabricatorConfigEntry
::
loadConfigEntry
(
$key
);
$list
=
$config_entry
->
getValue
();
$uninstalled
=
PhabricatorEnv
::
getEnvConfig
(
$key
);
if
(
isset
(
$uninstalled
[
get_class
(
$object
)]))
{
return
'uninstalled'
;
}
else
{
return
'installed'
;
}
}
public
function
generateNewValue
(
$object
,
$value
)
{
if
(
$value
===
'uninstall'
)
{
return
'uninstalled'
;
}
else
{
return
'installed'
;
}
}
public
function
applyExternalEffects
(
$object
,
$value
)
{
$application
=
$object
;
$user
=
$this
->
getActor
();
$key
=
'phabricator.uninstalled-applications'
;
$config_entry
=
PhabricatorConfigEntry
::
loadConfigEntry
(
$key
);
$list
=
$config_entry
->
getValue
();
$uninstalled
=
PhabricatorEnv
::
getEnvConfig
(
$key
);
if
(
isset
(
$uninstalled
[
get_class
(
$application
)]))
{
unset
(
$list
[
get_class
(
$application
)]);
}
else
{
$list
[
get_class
(
$application
)]
=
true
;
}
$editor
=
$this
->
getEditor
();
$content_source
=
$editor
->
getContentSource
();
PhabricatorConfigEditor
::
storeNewValue
(
$user
,
$config_entry
,
$list
,
$content_source
);
}
public
function
getTitle
()
{
if
(
$this
->
getNewValue
()
===
'uninstalled'
)
{
return
pht
(
'%s uninstalled this application.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s installed this application.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
if
(
$this
->
getNewValue
()
===
'uninstalled'
)
{
return
pht
(
'%s uninstalled %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
{
return
pht
(
'%s installed %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
}
Event Timeline
Log In to Comment