From bd7fed73b58460cc5e74d6edd79cf08e7bbd2d60 Mon Sep 17 00:00:00 2001 From: alphayax Date: Wed, 3 Feb 2016 20:12:37 +0100 Subject: [PATCH] Add FTP service --- freebox/api/v3/config/DHCP.php | 2 +- freebox/api/v3/config/FTP.php | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 freebox/api/v3/config/FTP.php diff --git a/freebox/api/v3/config/DHCP.php b/freebox/api/v3/config/DHCP.php index d807f5b..7cbcce5 100644 --- a/freebox/api/v3/config/DHCP.php +++ b/freebox/api/v3/config/DHCP.php @@ -5,7 +5,7 @@ use alphayax\freebox\api\v3\Service; /** * Class DHCP - * @package alphayax\freebox\api\v3 + * @package alphayax\freebox\api\v3\config * @author */ class DHCP extends Service { diff --git a/freebox/api/v3/config/FTP.php b/freebox/api/v3/config/FTP.php new file mode 100644 index 0000000..9c8fc67 --- /dev/null +++ b/freebox/api/v3/config/FTP.php @@ -0,0 +1,37 @@ + + */ +class FTP extends Service { + + const API_FTP_CONFIG = '/api/v3/ftp/config/'; + + /** + * @throws \Exception + */ + public function get_current_configuration(){ + $rest = $this->getAuthService( self::API_FTP_CONFIG); + $rest->GET(); + + return $rest->getCurlResponse(); + } + + /** + * @param array $new_config_x + * @return array + * @throws \Exception + */ + public function set_attribute_configuration( $new_config_x = []){ + $rest = $this->getAuthService( self::API_FTP_CONFIG); + $rest->PUT( $new_config_x); + + return $rest->getCurlResponse(); + } + +}