Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295565
PhabricatorRepositoryStagingURITransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorRepositoryStagingURITransaction.php
View Options
<?php
final
class
PhabricatorRepositoryStagingURITransaction
extends
PhabricatorRepositoryTransactionType
{
const
TRANSACTIONTYPE
=
'repo:staging-uri'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getDetail
(
'staging-uri'
)
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setDetail
(
'staging-uri'
,
$value
)
;
}
public
function
getTitle
(
)
{
$old
=
$this
->
getOldValue
(
)
;
$new
=
$this
->
getNewValue
(
)
;
if
(
$old
===
null
||
!
strlen
(
$old
)
)
{
return
pht
(
'%s set %s as the staging area for this repository.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderNewValue
(
)
)
;
}
else
if
(
$new
===
null
||
!
strlen
(
$new
)
)
{
return
pht
(
'%s removed %s as the staging area for this repository.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderOldValue
(
)
)
;
}
else
{
return
pht
(
'%s changed the staging area for this repository from '
.
'%s to %s.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderOldValue
(
)
,
$this
->
renderNewValue
(
)
)
;
}
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
(
)
;
$old
=
$this
->
generateOldValue
(
$object
)
;
foreach
(
$xactions
as
$xaction
)
{
$new
=
$xaction
->
getNewValue
(
)
;
if
(
!
strlen
(
$new
)
)
{
continue
;
}
if
(
$new
===
$old
)
{
continue
;
}
try
{
PhabricatorRepository
::
assertValidRemoteURI
(
$new
)
;
}
catch
(
Exception
$ex
)
{
$errors
[
]
=
$this
->
newInvalidError
(
$ex
->
getMessage
(
)
,
$xaction
)
;
continue
;
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 02:29 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1164628
Default Alt Text
PhabricatorRepositoryStagingURITransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment