forked from MindscapeHQ/raygun4php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RaygunMessage.php
33 lines (30 loc) · 1.06 KB
/
RaygunMessage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Raygun4php
{
require_once __DIR__.'/RaygunMessageDetails.php';
require_once __DIR__.'/RaygunExceptionMessage.php';
require_once __DIR__.'/RaygunRequestMessage.php';
require_once __DIR__.'/RaygunEnvironmentMessage.php';
require_once __DIR__.'/RaygunClientMessage.php';
class RaygunMessage
{
public $OccurredOn;
public $Details;
public function __construct($timestamp = null)
{
if ($timestamp === null) {
$timestamp = time();
}
$this->OccurredOn = gmdate("Y-m-d\TH:i:s\Z", $timestamp);
$this->Details = new RaygunMessageDetails();
}
public function Build($exception)
{
$this->Details->MachineName = gethostname();
$this->Details->Error = new RaygunExceptionMessage($exception);
$this->Details->Request = new RaygunRequestMessage();
$this->Details->Environment = new RaygunEnvironmentMessage();
$this->Details->Client = new RaygunClientMessage();
}
}
}