Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from ADODB to PDO #13

Open
alombarte opened this issue Jul 26, 2012 · 7 comments
Open

Migrate from ADODB to PDO #13

alombarte opened this issue Jul 26, 2012 · 7 comments

Comments

@alombarte
Copy link
Contributor

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.

ADODB is a deprecated PHP4 project that no longer makes sense to continue supporting.

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

@obokaman-com
Copy link
Member

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?

@alombarte
Copy link
Contributor Author

A specific class ADODB to PDO that implements all this ADODB methods (getOne, getRow) ... but using PDO would be implemented

@obokaman-com
Copy link
Member

Could be a solution. This AdoDBToPDO class + a migration manual would be great. :-)

@thedae
Copy link
Contributor

thedae commented Aug 16, 2012

Agreed, I'll take a look at this

Can you give me a list with the most used AdoDB methods?

@alombarte
Copy link
Contributor Author

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

@alombarte
Copy link
Contributor Author

@alombarte
Copy link
Contributor Author

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.

@kpicaza kpicaza removed this from the Sifo 3.1 milestone Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants