|
@@ -17,7 +17,7 @@
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
The Initial Developer of the Original Code is
|
|
Mark J Crane <[email protected]>
|
|
Mark J Crane <[email protected]>
|
|
- 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,17 +33,19 @@ if (!class_exists('domains')) {
|
|
|
|
|
|
//class constructor
|
|
//class constructor
|
|
public function __construct() {
|
|
public function __construct() {
|
|
- //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;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public function set() {
|
|
public function set() {
|
|
|
|
|
|
|
|
+ //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;
|
|
|
|
+ }
|
|
|
|
+
|
|
//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();
|
|
@@ -357,4 +367,4 @@ if (!class_exists('domains')) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-?>
|
|
|
|
|
|
+?>
|