mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Remove redundant database instances (#7535)
This commit is contained in:
@@ -167,9 +167,6 @@
|
||||
$array['bridges'][0]['bridge_description'] = $bridge_description;
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'bridges';
|
||||
$database->app_uuid = 'a6a7c4c5-340a-43ce-bcbc-2ed9bab8659d';
|
||||
$database->save($array);
|
||||
$message = $database->message;
|
||||
|
||||
@@ -197,7 +194,6 @@
|
||||
$sql = "select * from v_bridges ";
|
||||
$sql .= "where bridge_uuid = :bridge_uuid ";
|
||||
$parameters['bridge_uuid'] = $bridge_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters ?? null, 'row');
|
||||
if (!empty($row)) {
|
||||
$bridge_name = $row["bridge_name"];
|
||||
@@ -337,14 +333,12 @@
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
}
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$gateways = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//get the domains
|
||||
$sql = "select * from v_domains ";
|
||||
$sql .= "where domain_enabled = true ";
|
||||
$database = new database;
|
||||
$domains = $database->select($sql, null, 'all');
|
||||
unset($sql);
|
||||
|
||||
@@ -353,7 +347,6 @@
|
||||
$sql .= "from v_sip_profiles ";
|
||||
$sql .= "where sip_profile_enabled = true ";
|
||||
$sql .= "order by sip_profile_name asc ";
|
||||
$database = new database;
|
||||
$sip_profiles = $database->select($sql, null, 'all');
|
||||
unset($sql);
|
||||
|
||||
|
||||
@@ -299,9 +299,6 @@
|
||||
if ($row_id === 1000) {
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'bridges';
|
||||
$database->app_uuid = 'b523c2d2-64cd-46f1-9520-ca4b4098e044';
|
||||
$database->save($array);
|
||||
|
||||
//clear the array
|
||||
@@ -319,9 +316,6 @@
|
||||
|
||||
//save to the data
|
||||
if (!empty($array) && is_array($array)) {
|
||||
$database = new database;
|
||||
$database->app_name = 'bridges';
|
||||
$database->app_uuid = 'b523c2d2-64cd-46f1-9520-ca4b4098e044';
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@
|
||||
}
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters ?? null, 'column');
|
||||
|
||||
//prepare to page the results
|
||||
@@ -142,7 +141,6 @@
|
||||
}
|
||||
$sql .= order_by($order_by, $order, 'bridge_name', 'asc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$bridges = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user