Compare commits

...

2 Commits

Author SHA1 Message Date
malle-pietje
30056f50fc - bumped version to 1.1.96
- removed @version tag in docblock as it contained redundant information
- merged #241 which adds a method to download a generated backup, (contributed by @Jacobtims)
2024-10-14 14:34:48 +02:00
Jacob Timmerman
d040c512a7 Add method to download generated backup (#241)
Merged PR #241
2024-10-14 14:31:44 +02:00

View File

@@ -13,7 +13,6 @@ namespace UniFi_API;
*
* @package UniFi_Controller_API_Client_Class
* @author Art of WiFi <info@artofwifi.net>
* @version Release: 1.1.92
* @license This class is subject to the MIT license that is bundled with this package in the file LICENSE.md
* @example This directory in the package repository contains a collection of examples:
* https://github.com/Art-of-WiFi/UniFi-API-client/tree/master/examples
@@ -21,7 +20,7 @@ namespace UniFi_API;
class Client
{
/** Constants. */
const CLASS_VERSION = '1.1.95';
const CLASS_VERSION = '1.1.96';
const CURL_METHODS_ALLOWED = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'];
const DEFAULT_CURL_METHOD = 'GET';
@@ -1513,6 +1512,18 @@ class Client
return $this->fetch_results('/api/s/' . $this->site . '/cmd/backup', $payload);
}
/**
* Download a generated backup file
*
* @note this is an experimental function, please do not use unless you know exactly what you're doing
* @param string $filepath the path to the generated backup file
* @return string|bool the raw content of the backup file, false upon failure
*/
public function download_backup(string $filepath)
{
return $this->exec_curl($filepath);
}
/**
* Fetch auto backups
*