Open alombarte opened 12 years ago
Woooooo! proceed with caution. :-) I can't imagine somethink like a "migration script", we (and lot of SIFO-projects, I think) are using ADODB methods in all of our Models (getAll, getRow, getOne, Execute, Autoexecute, etc.) Are there specific equivalents in PDO?
A specific class ADODB to PDO that implements all this ADODB methods (getOne, getRow) ... but using PDO would be implemented
Could be a solution. This AdoDBToPDO class + a migration manual would be great. :-)
Agreed, I'll take a look at this
Can you give me a list with the most used AdoDB methods?
Most used models in ADODB:
AutoExecute Execute GetOne GetAll GetArray GetAssoc GetCol GetRow Query Affected_Rows Insert_ID ErrorNo Query ErrorMsg
Less common, but present:
BeginTrans BindDate BindTimeStamp Close CommitTrans CompleteTrans Concat Connect DBDate DBTimeStamp Disconnect escape FailTrans GenID GetInsertSQL GetUpdateSQL HasFailedTrans IgnoreErrors nextId q QMagic qstr Quote Replace RollbackLock RollbackTrans SetTransactionMode StartTrans Time UnixDate UnixTimeStamp
There are more methods, but I don't think they are used at all (like sequences for mysql).
Do not forget that there are many methods of Model, not related to adodb like
nextQueryInMaster storeInRegistry inRegistry closeConnectionDatabase
I did a first test replacing current version by 5.18 and it seems to work. The only thing to be fixed is the following notice, generated by the debug:
Notice: Undefined property: ADODB_mysql::$_querySQL in /var/www/wc/alo/libs/Sifo/Database.php on line 320
This is the internal variable that stores current SQL query. Fixing that I think we can migrate it and test in devel.
UPDATE: ADODB keeps alive with PHP5 support (see: http://sourceforge.net/projects/adodb/). The last update is from June 2013 and current version is 5.18. SIFO is using 5.06 right now.
Multiple driver database feature will be lost per default (Mysql, postgresql, oracle...) and we will stick to Mysql when it comes to relational databases.
A class to maintain backwards compatibility could be created, or a migration script. I don't know which of them are more painful