CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#5817] CMS_ADODB_DT may be set incorrectly for AdoDB (and other questions)

avatar
Created By: Carsten Wiedmann (wiedmann)
Date Submitted: Thu Dec 09 18:23:59 -0500 2010

Assigned To: Ted Kulp (wishy)
Version: 1.9.1
CMSMS Version: None
Severity: Minor
Resolution: Won't Fix
State: Closed
Summary:
CMS_ADODB_DT may be set incorrectly for AdoDB (and other questions)
Detailed Description:
a)
If "$config['use_adodb_lite']" is set to false, and the AdoDB lib is not found,
CMSMS is falling back to AdoDB lite, but CMS_ADODB_DT is still set for full
AdoDB.

b)
There should be another way to see if we have full AdoDB or lite working, then
comparing CMS_ADODB_DT. And setting/changing "$config['use_adodb_lite']" on the
fly is creating warnings.

c)
Messages should go to debug_buffer

d)
With full AdoDB the connection/client charset should be set with SetCharSet(),
instead of "SET NAMES"

e)
full AdoDB should be updated to 4.992 (5.11 is not working nice at the moment in
debug mode.


History

Comments
avatar
Date: 2010-12-09 18:24
Posted By: Carsten Wiedmann (wiedmann)

Index: /home/cwiedmann/public_html/cmsmadesimple-dev/lib/adodb.functions.php
===================================================================
--- /home/cwiedmann/public_html/cmsmadesimple-dev/lib/adodb.functions.php
(Revision 6820)
+++ /home/cwiedmann/public_html/cmsmadesimple-dev/lib/adodb.functions.php
(Arbeitskopie)
@@ -12,9 +12,8 @@
  */
 function load_adodb() 
 {
-  global $gCms;
   global $ADODB_vers;
-  $config = $gCms->GetConfig();
+  $config =& cmsms()->GetConfig();
 
 	// @TODO: Remove dependence on PEAR for error handling	
 	if ($config['debug'] == true)
@@ -34,12 +33,13 @@
 		if (! file_exists($full_adodb))
 		{
 			# Full ADOdb cannot be found, show a debug error message
-			$gCms->errors[] = 'CMS Made Simple is configured to use the full ADOdb
Database Abstraction library, but it\'s not in the lib' .DIRECTORY_SEPARATOR.
'adodb directory. Switched back to ADOdb Lite.';
+			debug_buffer('CMS Made Simple is configured to use the full ADOdb Database
Abstraction library, but it\'s not in the lib' .DIRECTORY_SEPARATOR. 'adodb
directory. Switched back to ADOdb Lite.');
 		}
 		else
 		{
 			# Load (full) ADOdb
 			require($full_adodb);
+			define('CMS_ADODB_DT', 'T');
 			$loaded_adodb = true;
 		}
 	}
@@ -51,6 +51,7 @@
 		{
 			# Load ADOdb Lite
 			require($adodb_light);
+			define('CMS_ADODB_DT', 'DT');
 		}
 		else
 		{
@@ -58,8 +59,6 @@
die('The ADOdb Lite database abstraction library cannot be found, CMS Made
Simple cannot load.');
 		}
 	}
-	
-	define('CMS_ADODB_DT', $config['use_adodb_lite'] ? 'DT' : 'T');
 }
 
 /**
@@ -70,8 +69,7 @@
  */
 function & adodb_connect()
 {
-	global $gCms;
-	$config = $gCms->GetConfig();
+	$config =& cmsms()->GetConfig();
 	
$dbinstance =& ADONewConnection($config['dbms'],
'pear:date:extend:transaction');
 	$dbinstance->raiseErrorFn = "adodb_error";
@@ -105,7 +103,14 @@
 	{
if(!empty($config['default_encoding']) && $config['default_encoding'] ==
'utf-8' && $config['set_names'] == true)
 		{
-			$dbinstance->Execute("SET NAMES 'utf8'");
+		    if ((CMS_ADODB_DT == 'T') || (isset($USE_OLD_ADODB) && (1 ==
$USE_OLD_ADODB)))
+			{
+		        $dbinstance->SetCharSet('utf8');
+		    }
+			else
+			{
+				$dbinstance->Execute("SET NAMES 'utf8'");
+			}
 		}
 	}
 	

      
avatar
Date: 2011-01-07 15:20
Posted By: Ronny Krijt (ronnyk)

Investigated post 1.9.3.
      
avatar
Date: 2012-04-13 10:47
Posted By: Robert Campbell (calguy1000)

CMSMS 1.11 will now not support the full adodb.  the use_adodb_lite config
option is removed.
      
Updates

Updated: 2012-08-02 12:53
state: Open => Closed

Updated: 2012-04-13 10:47
resolution_id: 6 => 8
cmsms_version_id: => -1

Updated: 2011-01-07 15:20
resolution_id: 5 => 6
assigned_to_id: 100 => 102

Updated: 2010-12-09 18:24
resolution_id: => 5