Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F429419
PhabricatorNotificationTestController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorNotificationTestController.php
View Options
<?php
final
class
PhabricatorNotificationTestController
extends
PhabricatorNotificationController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$story_type
=
'PhabricatorNotificationAdHocFeedStory'
;
$story_data
=
array
(
'title'
=>
pht
(
'This is a test notification, sent at %s.'
,
phabricator_datetime
(
time
(),
$viewer
)),
);
$viewer_phid
=
$viewer
->
getPHID
();
// TODO: When it's easier to get these buttons to render as forms, this
// would be slightly nicer as a more standard isFormPost() check.
if
(
$request
->
validateCSRF
())
{
id
(
new
PhabricatorFeedStoryPublisher
())
->
setStoryType
(
$story_type
)
->
setStoryData
(
$story_data
)
->
setStoryTime
(
time
())
->
setStoryAuthorPHID
(
$viewer_phid
)
->
setRelatedPHIDs
(
array
(
$viewer_phid
))
->
setPrimaryObjectPHID
(
$viewer_phid
)
->
setSubscribedPHIDs
(
array
(
$viewer_phid
))
->
setNotifyAuthor
(
true
)
->
publish
();
}
return
id
(
new
AphrontAjaxResponse
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 8:29 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
59685
Default Alt Text
PhabricatorNotificationTestController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment