Added safety against re-defining constants in dbal
authorDan
Thu, 06 Mar 2008 23:04:45 -0500
changeset 483 2cb1c8a6d3db
parent 482 647d11c5e9c1
child 484 340c81fdd350
Added safety against re-defining constants in dbal
includes/dbal.php
--- a/includes/dbal.php	Thu Mar 06 22:48:16 2008 -0500
+++ b/includes/dbal.php	Thu Mar 06 23:04:45 2008 -0500
@@ -131,11 +131,15 @@
   {
     $this->enable_errorhandler();
     
-    define('ENANO_DBLAYER', 'MYSQL');
-    define('ENANO_SQLFUNC_LOWERCASE', 'lcase');
-    define('ENANO_SQL_MULTISTRING_PRFIX', '');
-    define('ENANO_SQL_BOOLEAN_TRUE', 'true');
-    define('ENANO_SQL_BOOLEAN_FALSE', 'false');
+    if ( !defined('ENANO_SQL_CONSTANTS') )
+    {
+      define('ENANO_SQL_CONSTANTS', '');
+      define('ENANO_DBLAYER', 'MYSQL');
+      define('ENANO_SQLFUNC_LOWERCASE', 'lcase');
+      define('ENANO_SQL_MULTISTRING_PRFIX', '');
+      define('ENANO_SQL_BOOLEAN_TRUE', 'true');
+      define('ENANO_SQL_BOOLEAN_FALSE', 'false');
+    }
     
     if ( !$manual_credentials )
     {
@@ -907,11 +911,15 @@
   {
     $this->enable_errorhandler();
     
-    define('ENANO_DBLAYER', 'PGSQL');
-    define('ENANO_SQLFUNC_LOWERCASE', 'lower');
-    define('ENANO_SQL_MULTISTRING_PRFIX', 'E');
-    define('ENANO_SQL_BOOLEAN_TRUE', '1');
-    define('ENANO_SQL_BOOLEAN_FALSE', '0');
+    if ( !defined('ENANO_SQL_CONSTANTS') )
+    {
+      define('ENANO_SQL_CONSTANTS', '');
+      define('ENANO_DBLAYER', 'PGSQL');
+      define('ENANO_SQLFUNC_LOWERCASE', 'lower');
+      define('ENANO_SQL_MULTISTRING_PRFIX', 'E');
+      define('ENANO_SQL_BOOLEAN_TRUE', '1');
+      define('ENANO_SQL_BOOLEAN_FALSE', '0');
+    }
     
     if ( !$manual_credentials )
     {