-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhtpasswd-options-ftp.php
51 lines (36 loc) · 1.29 KB
/
htpasswd-options-ftp.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
class HtpasswdFtpOptions
{
public static $name = 'cnj_htpasswd_ftp_options';
public static $ftp_enabled = 'ftp_enabled';
public static $ftp_username = 'ftp_username';
public static $ftp_password = 'ftp_password';
public static $ftp_server = 'ftp_server';
public static $ftp_port = 'ftp_port';
public static $ftp_dest_path = 'ftp_dest_path';
private $options;
private function __construct($options) {
$this->options = $options;
}
public static function load() {
return new HtpasswdFtpOptions(get_option(HtpasswdFtpOptions::$name));
}
public function isEnabled() {
return $this->options[HtpasswdFtpOptions::$ftp_enabled];
}
public function getUsername() {
return $this->options[HtpasswdFtpOptions::$ftp_username];
}
public function getPassword() {
return $this->options[HtpasswdFtpOptions::$ftp_password];
}
public function getServer() {
return $this->options[HtpasswdFtpOptions::$ftp_server];
}
public function getPort() {
return $this->options[HtpasswdFtpOptions::$ftp_port];
}
public function getDestinationPath() {
return $this->options[HtpasswdFtpOptions::$ftp_dest_path];
}
}