]> git.mxchange.org Git - core.git/blobdiff - inc/database.php
Rewritten a lot double-quotes to single-requotes, removed deprecated exception, some...
[core.git] / inc / database.php
index b9f40fa65476b01527c70577a9b79893124a9035..6a57e201c5442bc4f1409bcfccb25c41d0672470 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-// Initialize layer
-$layerInstance = null;
+// Initialize database layer
+$databaseInstance = null;
 
 // Get config instance
 $cfg = FrameworkConfiguration::getInstance();
 
 // Generate FQFN for the database layer
-$fqfn = sprintf("%sinc/database/lib-%s.php",
-       $cfg->readConfig('base_path'),
-       $cfg->readConfig('db_type')
-);
+$fqfn = $cfg->readConfig('base_path') . 'inc/database/lib-' . $cfg->readConfig('db_type') . '.php';
 
 // Load the database layer include
 if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
@@ -46,14 +43,14 @@ if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
 }
 
 // Clean it up
-unset($fqfn);
+unset($fqfn, $cfg);
 
 // Prepare database instance
-$db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layerInstance);
+$connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $databaseInstance);
 
 // Is the app variable there and valid?
 // @TODO Rewrite this
-if (is_object($app)) $app->setDatabaseInstance($db);
+if (is_object($app)) $app->setDatabaseInstance($connectionInstance);
 
 // [EOF]
 ?>