]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib.php
Some functions rewritten to hungarian notation, handling of array rewritten
[mailer.git] / inc / db / lib.php
index 5d9a30891e5a284edf6e2a73a1877cf921649d65..083e5f240de0d6ae6009a044735348028f593267 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -41,15 +41,18 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 if (_DB_TYPE == "_DB_TYPE") define('_DB_TYPE', "mysql3");
 
 // Create include file name
-$INC = sprintf("%sinc/db/lib-%s.php", PATH, _DB_TYPE);
+$FQFN = sprintf("%sinc/db/lib-%s.php", PATH, _DB_TYPE);
 
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($FQFN)) {
        // Include abstraction layer
-       require_once($INC);
+       require_once($FQFN);
 } else {
        // Bye, bye...
-       die("Cannot load database abstraction layer! R.I.P.");
+       die("Cannot load database abstraction layer "._DB_TYPE." -> R.I.P.");
 }
 
+// Remove this globally used variable
+unset($FQFN);
+
 //
 ?>