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

Convert db calls to PDO, allow support for multiple back-end engines #164

Closed
samilliken opened this issue Mar 28, 2013 · 3 comments
Closed
Assignees
Milestone

Comments

@samilliken
Copy link
Member

With the combination of the existing mysql() calls being deprecated in the near future, and the political fallout of Oracle regarding MySQL, convert all calls to the PDO abstraction library. This will allow for various DB back-ends, as long as the SQL statements remain non version specific.

@ghost ghost assigned samilliken Mar 28, 2013
samilliken added a commit that referenced this issue Apr 10, 2013
… that we'll start using PDO rather than mysql_* calls. This will need to be manually updated for all users as we convert - will need to test for the connection in the next install.php and display a message to the user if we can't connect.

#164
samilliken added a commit that referenced this issue Apr 11, 2013
… I have not removed the parameter passed to the methods as that will happen as we replace all calls to the Config class.

#164
samilliken added a commit that referenced this issue Apr 11, 2013
samilliken added a commit that referenced this issue May 8, 2013
Updated all of the User class methods to use PDO Library per #164

Updated the dc_stats, cabnavigator, and devices pages to base viewership on what departments a user is a member of, rather than the global ReadAccess right.

Use cabnavigator.php as the reference for how to handle the new right scheme.

#185
samilliken added a commit that referenced this issue May 15, 2013
Have completely converted the Cabinet class to PDO, set all of the $db parameters to be optional.  Updated files (contact and search) that used some methods with multiple parameters so that the $db is not passed at all.

#164
#185
samilliken added a commit that referenced this issue May 15, 2013
…es to PDO library. Had to modify cabinets.php to make it work correctly.

#164

#185
@wilpig
Copy link
Collaborator

wilpig commented May 18, 2013

mysqlerror

We need a better way of displaying these as this completely breaks things and in turn also was completely useless in figuring out what happened.

https://github.com/samilliken/openDCIM/blob/37f078739fb8d8df2e1507bd4315987d9ded8635/assets.inc.php#L887

[Fri May 17 20:31:31 2013] [error] [client 129.59.141.208] PHP Warning: PDO::exec(): SQLSTATE[HY000]: General error: trying to execute an empty query in openDCIM/assets.inc.php on line 887, referer: devices.php?action=new&cabinet=2

[Fri May 17 20:35:50 2013] [error] [client 129.59.141.208] PHP Warning: sprintf(): Too few arguments in openDCIM/assets.inc.php on line 885, referer: devices.php?action=new&cabinet=2

And there is a perfect argument on why sprintf is bad for these statements.

@samilliken
Copy link
Member Author

There's a PDO parameter we can set that will put the errors in the error log.

samilliken added a commit that referenced this issue May 18, 2013
…d. Need to propagate to the rest of the calls for consistency.

#164
samilliken added a commit that referenced this issue May 18, 2013
Conflicts:
	assets.inc.php

Fixed the error checking on the Device::CreateDevice method to send info to the error log.  Need to do to the rest of PDO calls for consistency.

#164
wilpig added a commit that referenced this issue May 18, 2013
wilpig added a commit that referenced this issue May 18, 2013
…ted malfunctioning date and equipment type parameters in same functions. Updated a few translation strings to sprintf with static variables per best practices. Updated all translation files. #164
samilliken added a commit that referenced this issue May 18, 2013
…med the SensorOID to TempSensorOID.

Update the Cabinet class to reflect.

Also converted all of Cabinet class to PDO with error display in the error_log.

#155 for temperature/humidity portion

#164 for PDO error logging
samilliken added a commit that referenced this issue May 19, 2013
…s that call other classes still must include the $db parameter until we're finished.

#164
wilpig added a commit that referenced this issue Jun 6, 2013
…hat appears to be complete. close #190. Converted over the db calls in the configuration file to the PDO methods #164
wilpig added a commit that referenced this issue Jun 6, 2013
wilpig added a commit that referenced this issue Jun 6, 2013
…A few functions are producing no data on return and it was interpreting that as an error even though it was a valid response. We need to be careful on straight select statements not to log an error if there is nothing returned. #164
wilpig added a commit that referenced this issue Jun 6, 2013
…here methods have been changed and it was never updated. Need to revisit and see if this page is even needed, it was added @e13e35e
wilpig added a commit that referenced this issue Jun 6, 2013
wilpig added a commit that referenced this issue Jun 7, 2013
wilpig added a commit that referenced this issue Jun 12, 2013
wilpig added a commit that referenced this issue Jun 12, 2013
wilpig added a commit that referenced this issue Jun 19, 2013
wilpig added a commit that referenced this issue Jun 25, 2013
…rting the method conversion. All ports methods are good to go except getPortList. No other files have been touched yet so attempting to alter switch connections will fail, right now. #191 #164
wilpig added a commit that referenced this issue Jul 11, 2013
…dated. Went ahead and ran a new gettext translation update as well. #164
wilpig added a commit that referenced this issue Jul 15, 2013
…laces the methods are used and remove the db variable from them though. Out of time for this morning. #164
wilpig added a commit that referenced this issue Jul 18, 2013
…stone was seeing with the updating a department.
wilpig added a commit that referenced this issue Jul 23, 2013
…erting all remaining instances of mysql_query #164
@samilliken
Copy link
Member Author

Closing.

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

2 participants