-
Notifications
You must be signed in to change notification settings - Fork 1
/
class.twist-config.php
47 lines (37 loc) · 1.4 KB
/
class.twist-config.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
<?php
global $wpdb;
class Twist_Config {
private static $ins = null;
private $receivers_table_name = "";
private $messages_table_name = "";
private $sent_messages_table_name = "";
const ACCOUNT_SID_OPTION_KEY = "twilio-account-sid";
const AUTH_TOKEN_OPTION_KEY = "twilio-auth-token";
const FROM_PHONE_NUMBER = "twilio-from-phone";
private $plugin_option_keys = array(self::ACCOUNT_SID_OPTION_KEY, self::AUTH_TOKEN_OPTION_KEY, self::FROM_PHONE_NUMBER);
const PLUGIN_SLUG = "twist-plugin-settings";
const TOOL_SLUG = "twist-twilio-tool";
const PHONE_NUMBER_REGEX = "/\+[0-9]{3}\s\([0-9]{3}\)\s-\s[0-9]{3}\s-\s[0-9]{3}/";
private function Twist_Config() {
global $wpdb;
$this->receivers_table_name = $wpdb->prefix."twist_receivers";
$this->messages_table_name = $wpdb->prefix."twist_messages";
$this->sent_messages_table_name = $wpdb->prefix."twist_message_details";
}
public static function get_receivers_table_name() {
return self::instance()->receivers_table_name;
}
public static function get_messages_table_name() {
return self::instance()->messages_table_name;
}
public static function get_sent_messages_table_name() {
return self::instance()->sent_messages_table_name;
}
public static function instance() {
is_null(self::$ins) && self::$ins = new self;
return self::$ins;
}
public static function get_plugin_option_keys() {
return self::instance()->plugin_option_keys;
}
}