[pLog-svn] r6194 - plog/trunk/class/database

mark at devel.lifetype.net mark at devel.lifetype.net
Fri Feb 29 03:40:56 EST 2008


Author: mark
Date: 2008-02-29 03:40:55 -0500 (Fri, 29 Feb 2008)
New Revision: 6194

Modified:
   plog/trunk/class/database/ltdb.class.php
Log:
Set the default character set UTF-8, I think this will cause some problems for those mysql configured with default character as Latin1.

Modified: plog/trunk/class/database/ltdb.class.php
===================================================================
--- plog/trunk/class/database/ltdb.class.php	2008-02-29 08:29:37 UTC (rev 6193)
+++ plog/trunk/class/database/ltdb.class.php	2008-02-29 08:40:55 UTC (rev 6194)
@@ -1,6 +1,10 @@
 <?php
 
+	//TODO: 1. we need to add database selection in installation wizard.
+	//      2. In 2.0 the charset is utf8 only. I think this will cause some problems in those
+	//         database with default character set as latin1 ... :(
 	define( "DEFAULT_DATABASE_DRIVER", "mysql" );
+	define( "DEFAULT_DATABASE_CHARSET", "utf8" );
 
 	/**
 	 * \defgroup Database
@@ -69,7 +73,7 @@
                 $password  = $fileConfig->getValue( "db_password" );
                 $host      = $fileConfig->getValue( "db_host" );
                 $dbname    = $fileConfig->getValue( "db_database" );
-                $dbcharset = $fileConfig->getValue( "db_character_set" );
+                $dbcharset = $fileConfig->getValue( "db_character_set", DEFAULT_DATABASE_CHARSET );
                 $dbpersistent   = $fileConfig->getValue( "db_persistent" );
                 if($dbpersistent == true) {
 	            	if( !$db->PConnect( $host, $username, $password, $dbname, $dbcharset )) {



More information about the pLog-svn mailing list