Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11709034
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/app/Http/Controllers/Gate/PhabricatorGateController.php b/app/Http/Controllers/Gate/PhabricatorGateController.php
index 66f5a02..febab97 100644
--- a/app/Http/Controllers/Gate/PhabricatorGateController.php
+++ b/app/Http/Controllers/Gate/PhabricatorGateController.php
@@ -1,90 +1,88 @@
<?php
namespace Nasqueron\Notifications\Http\Controllers\Gate;
use Event;
use Request;
use Nasqueron\Notifications\Events\PhabricatorPayloadEvent;
class PhabricatorGateController extends GateController {
///
/// Private members
///
/**
* The request content, as a structured data
*
* @var string
*/
private $payload;
///
/// Constants
///
const SERVICE_NAME = 'Phabricator';
///
/// Requests processing
///
/**
* Handles POST requests
*
* @param Request $request the HTTP request
*/
public function onPost ($door) {
$this->door = $door;
$this->instance = $this->getInstance();
if ($this->instance === "") {
abort(404, 'Unknown Phabricator instance.');
- return;
}
-
$this->extractPayload();
$this->logRequest();
$this->onPayload();
return parent::renderReport();
}
/**
* Extracts payload from the request
*/
protected function extractPayload () {
$this->payload = Request::all();
}
/**
* Gets the instance matching this door
*
* @return string The Phabricator root URL without trailing slash
*/
protected function getInstance () {
$service = $this->getService();
if ($service === null) {
return "";
}
return $service->instance;
}
///
/// Payload processing
///
protected function onPayload () {
$this->initializeReport();
Event::fire(new PhabricatorPayloadEvent(
$this->door,
$this->instance,
$this->payload
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Sep 15, 08:31 (12 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2983913
Default Alt Text
(2 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment