reformatted Exception handling example

This commit is contained in:
malle-pietje
2024-11-28 12:19:33 +01:00
parent 8acaa694ca
commit 8eeeb447c9

View File

@@ -199,11 +199,11 @@ require_once 'vendor/autoload.php';
*/
require_once 'config.php';
/**
* initialize the UniFi API connection class, log in to the controller and request the alarms collection
* (this example assumes you have already assigned the correct values to the variables used)
*/
try {
/**
* initialize the UniFi API connection class, log in to the controller and request the alarms collection
* (this example assumes you have already assigned the correct values to the variables used)
*/
$unifi_connection = new UniFi_API\Client($controller_user, $controller_password, $controller_url, $site_id, $controller_version, true);
$login = $unifi_connection->login();
$results = $unifi_connection->list_alarms(); // returns a PHP array containing alarm objects