Improve database access
Things we need to do for making the database access cleaner and easier.
Leave a comment
on 2010-12-11 19:11 *
By
If we are not envisioning database portability on HotaruCMS what we need is MySQLi extension available since PHP 5+. I've run the code through the converted found here and I've come to some points that the code needs manual conversion. After those are done, I will concentrate on getting prepared statements implemented throughout the core functionality, updating of plugins should come after that.
If on the other hand we come to the conclusion that database portability is a good thing and that we want to include it within Hotaru we should go ahead and use PDO. PDO is equally fast with the mysqli extension after PHP 5.3 since they are using the PDO_MYSQLND driver as the MySQLi extension is using since PHP 5+. IMHO, PDO brings a little more but the conversion of the code is somewhat tougher.
The HotaruCMS will be converted to use the MySQLi extension for now, since it is relatively painless. But we should decide whether to use PDO or not before we implement prepared statements.
If on the other hand we come to the conclusion that database portability is a good thing and that we want to include it within Hotaru we should go ahead and use PDO. PDO is equally fast with the mysqli extension after PHP 5.3 since they are using the PDO_MYSQLND driver as the MySQLi extension is using since PHP 5+. IMHO, PDO brings a little more but the conversion of the code is somewhat tougher.
The HotaruCMS will be converted to use the MySQLi extension for now, since it is relatively painless. But we should decide whether to use PDO or not before we implement prepared statements.
on 2010-12-12 00:08 *
By nick_ramsay
Sounds fair to me, but I was hoping to avoid "updating of plugins" by mapping things like $h->db->get_results() and $h->db->prepare() to the new functions. Otherwise we're looking at updating maybe 60+ plugins. Unless you just mean improving plugins in general, not specifically for the new db class?
on 2010-12-12 02:09 *
By
Of course the plugins would need to be tested... but we can use the Hotaru::Database(an AdapterClass)::(method that translates the query and the return to emulate the new Database class (the one that is going to be) to behave similar with the old Database class (the one we have now)