Update domains.php
This commit is contained in:
parent
bc057ac1f5
commit
60c9477d2f
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2014
|
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
|
|
@ -33,6 +33,11 @@ if (!class_exists('domains')) {
|
||||||
|
|
||||||
//class constructor
|
//class constructor
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set() {
|
||||||
|
|
||||||
//connect to the database if not connected
|
//connect to the database if not connected
|
||||||
if (!$this->db) {
|
if (!$this->db) {
|
||||||
require_once "resources/classes/database.php";
|
require_once "resources/classes/database.php";
|
||||||
|
|
@ -40,9 +45,6 @@ if (!class_exists('domains')) {
|
||||||
$database->connect();
|
$database->connect();
|
||||||
$this->db = $database->db;
|
$this->db = $database->db;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function set() {
|
|
||||||
|
|
||||||
//set the PDO error mode
|
//set the PDO error mode
|
||||||
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
|
@ -202,7 +204,15 @@ if (!class_exists('domains')) {
|
||||||
|
|
||||||
public function upgrade() {
|
public function upgrade() {
|
||||||
|
|
||||||
//get the db variables
|
//connect to the database if not connected
|
||||||
|
if (!$this->db) {
|
||||||
|
require_once "resources/classes/database.php";
|
||||||
|
$database = new database;
|
||||||
|
$database->connect();
|
||||||
|
$this->db = $database->db;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the variables
|
||||||
$config = new config;
|
$config = new config;
|
||||||
$config_exists = $config->exists();
|
$config_exists = $config->exists();
|
||||||
$config_path = $config->find();
|
$config_path = $config->find();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue