* 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))) {
}
// 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]
?>