|Anonymous | Login | Signup for a new account||2017-12-18 03:42 EST|
|My View | View Issues | Change Log | Roadmap | Repositories | My Account|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005208||ATutor||MultiSite||public||2013-02-25 16:12||2013-03-04 15:00|
|Target Version||2.1.1||Fixed in Version|
|Summary||0005208: queryDB switch db source|
|Description||Currently there is no way to access more than one database with queryDB. Need a way to specify the db handle. Eg when upgrading subsites.|
|Tags||No tags attached.|
Is it possible to implement the following logic in ATutor and AContent
/ multisite is loaded /
/ figure out what $db object should be created for that particular multisite /
/ cache it if not cached /
/ Create a function which would be able to return a proper $db object based from the cache based on the multisite /
/ Replace global $db; with $db = func_to_return_db(); in queryDB /
This way queryDB stays atomic with less parameters. It still would work and will require developer NOT care about multisite or other extra parameters and concentrate on the business logic WHICH IS: SQL query and its parameters.
At the same time func_to_return_db() will be one of the core ATutor functions which would not need any developer's intervention (I guess it depends on its implementation) and could be used outside of queryDB (if needed)
Personally, I do not want to pass any extra $db parameter into queryDB() to keep it simple and to make a developer worry only about SQL queries and what they return.
These are just few of my thoughts about this matter.
Let me know what do you think.
|2013-02-25 16:12||greg||New Issue|
|2013-03-04 15:00||greg||Note Added: 0006194|
|Copyright © 2000 - 2017 MantisBT Team|