Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2895055
PhabricatorRepositoryPushEvent.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
2 KB
Referenced Files
None
Subscribers
None
PhabricatorRepositoryPushEvent.php
View Options
<?php
/**
* Groups a set of push logs corresponding to changes which were all pushed in
* the same transaction.
*/
final
class
PhabricatorRepositoryPushEvent
extends
PhabricatorRepositoryDAO
implements
PhabricatorPolicyInterface
{
protected
$repositoryPHID
;
protected
$epoch
;
protected
$pusherPHID
;
protected
$remoteAddress
;
protected
$remoteProtocol
;
protected
$rejectCode
;
protected
$rejectDetails
;
private
$repository
=
self
::
ATTACHABLE
;
private
$logs
=
self
::
ATTACHABLE
;
public
static
function
initializeNewEvent
(
PhabricatorUser
$viewer
)
{
return
id
(
new
PhabricatorRepositoryPushEvent
(
)
)
->
setPusherPHID
(
$viewer
->
getPHID
(
)
)
;
}
public
function
getConfiguration
(
)
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_TIMESTAMPS
=>
false
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'remoteAddress'
=>
'uint32?'
,
'remoteProtocol'
=>
'text32?'
,
'rejectCode'
=>
'uint32'
,
'rejectDetails'
=>
'text64?'
,
)
,
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_repository'
=>
array
(
'columns'
=>
array
(
'repositoryPHID'
)
,
)
,
)
,
)
+
parent
::
getConfiguration
(
)
;
}
public
function
generatePHID
(
)
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorRepositoryPushEventPHIDType
::
TYPECONST
)
;
}
public
function
attachRepository
(
PhabricatorRepository
$repository
)
{
$this
->
repository
=
$repository
;
return
$this
;
}
public
function
getRepository
(
)
{
return
$this
->
assertAttached
(
$this
->
repository
)
;
}
public
function
attachLogs
(
array
$logs
)
{
$this
->
logs
=
$logs
;
return
$this
;
}
public
function
getLogs
(
)
{
return
$this
->
assertAttached
(
$this
->
logs
)
;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
(
)
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
)
;
}
public
function
getPolicy
(
$capability
)
{
return
$this
->
getRepository
(
)
->
getPolicy
(
$capability
)
;
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
$this
->
getRepository
(
)
->
hasAutomaticCapability
(
$capability
,
$viewer
)
;
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
"A repository's push events are visible to users who can see the "
.
"repository."
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 20:53 (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128632
Default Alt Text
PhabricatorRepositoryPushEvent.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment