-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget.php
More file actions
27 lines (20 loc) · 665 Bytes
/
get.php
File metadata and controls
27 lines (20 loc) · 665 Bytes
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
<?php
/**
* Code example for getting server version details
*/
include '../vendor/autoload.php';
use Gotify\Exception\GotifyException;
use Gotify\Exception\EndpointException;
try {
// Set server
$server = new Gotify\Server('https://gotify.example.com/');
// Create Version class instance
$version = new Gotify\Endpoint\Version($server);
// Get version details
$details = $version->get();
echo 'Version: ' . $details->version . PHP_EOL;
echo 'Commit: ' . $details->commit . PHP_EOL;
echo 'Build date: ' . $details->buildDate . PHP_EOL;
} catch (EndpointException | GotifyException $err) {
echo $err->getMessage();
}