Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12239053
PhabricatorListener.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
981 B
Referenced Files
None
Subscribers
None
PhabricatorListener.php
View Options
<?php
namespace
Nasqueron\Notifications\Listeners
;
use
Nasqueron\Notifications\Events\GitHubPayloadEvent
;
use
Nasqueron\Notifications\Jobs\NotifyNewCommitsToDiffusion
;
/**
* Listens to events Phabricator is interested by.
*/
class
PhabricatorListener
{
///
/// GitHub → Phabricator
///
/**
* Handles payload events.
*
* @param GitHubPayloadEvent $event The GitHub payload event
*/
public
function
handle
(
GitHubPayloadEvent
$event
)
:
void
{
if
(
$event
->
event
===
'push'
)
{
$this
->
notifyNewCommits
(
$event
);
}
}
/**
* Notifies Phabricator there are new commits to pull.
*
* @param GitHubPayloadEvent $event The GitHub payload event
*/
public
function
notifyNewCommits
(
GitHubPayloadEvent
$event
)
:
void
{
$job
=
new
NotifyNewCommitsToDiffusion
(
$event
->
door
,
$event
->
payload
->
repository
->
clone_url
);
$job
->
handle
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 11, 20:07 (14 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3063898
Default Alt Text
PhabricatorListener.php (981 B)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment