Get event socket details from the settings class
This commit is contained in:
parent
c6d966395e
commit
fb8b6db71d
|
|
@ -27,22 +27,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//includes files
|
//includes files
|
||||||
require_once __DIR__ . "/require.php";
|
require_once __DIR__ . "/require.php";
|
||||||
|
|
||||||
//get the event socket information
|
//get the event socket information
|
||||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/settings/app_config.php")) {
|
if (empty($_SESSION['event_socket_ip_address'])) {
|
||||||
if ((! isset($_SESSION['event_socket_ip_address'])) or empty($_SESSION['event_socket_ip_address'])) {
|
$setting = new settings(["category" => "switch"]);
|
||||||
$sql = "select * from v_settings ";
|
$_SESSION['event_socket_ip_address'] = $setting->get('switch', 'event_socket_ip_address');
|
||||||
$database = new database;
|
$_SESSION['event_socket_port'] = $setting->get('switch', 'event_socket_port');
|
||||||
$row = $database->select($sql, null, 'row');
|
$_SESSION['event_socket_password'] = $setting->get('switch', 'event_socket_password');
|
||||||
if (!empty($row)) {
|
}
|
||||||
$_SESSION['event_socket_ip_address'] = $row["event_socket_ip_address"];
|
|
||||||
$_SESSION['event_socket_port'] = $row["event_socket_port"];
|
|
||||||
$_SESSION['event_socket_password'] = $row["event_socket_password"];
|
|
||||||
}
|
|
||||||
unset($sql, $row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function event_socket_create($host, $port, $password) {
|
function event_socket_create($host, $port, $password) {
|
||||||
$esl = new event_socket;
|
$esl = new event_socket;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue