MODx Bug/Feature Tracker and Feature Requests
Welcome to the MODx CMS Tracker. Please choose the appropriate project from the drop down menu and provide as much information as possible regarding your server environment and browser. Thanks!
FS#393 — DBAPI hard to reuse without $modx global.
Attached to Project —
MODx
Opened by jorge monasterio (jorge) - Saturday, 13 May 2006, 11:26PM
Last edited by Ryan Thrash (rthrash) - Wednesday, 20 September 2006, 11:20PM
Opened by jorge monasterio (jorge) - Saturday, 13 May 2006, 11:26PM
Last edited by Ryan Thrash (rthrash) - Wednesday, 20 September 2006, 11:20PM
| Task Type | Bug Report |
|---|---|
| Category | Core Distribution |
| Status | Assigned |
| Assigned To |
Jason Coward (opengeek) |
| Operating System | All |
| Severity | Low |
|---|---|
| Priority | Normal |
| Reported Version | 0.9.2/0.9.2.1 |
| Due in Version | 0.9.7 |
| Due Date | Undecided |
| Percent Complete |
|
Details
The DBAPI library makes calls to the $modx (DocumentParser) object for a (very) few things like ->getMicroTime(), ->messageQuit();This is an unfortunate dependency, because I'd like to use DBAPI for DB session management, but I can't because the $modx isn't created yet at that point in config.inc.php. Instead I am forced to create an entire DocumentParser object just to do DB calls.
Also, since a DBAPI object is a member of $modx, it's a bit of a weird circular dependency that should be avoided.
Suggestions:
1) Move the utility functions ->getMicroTime, ->messageQuit, etc into another .INC file, so DBAPI can work without pulling in the entire DocumentParser object.
2) If these functions are only used in DBAPI, maybe they shouldn't be in $modx at all. Kinda doubt it.
3) Make DBAPI specific versions of these calls.
4) Create the $modx global earlier in config.inc.php, before sessions started.
This task depends upon
This task blocks these from closing
Comment by Ryan Thrash (rthrash) -
Wednesday, 20 September 2006, 11:21PM
This is a very good set of suggestions but needs to be deferred to the next release after 095. This next release will address your needs in a what I suspect you'll consider a more than outstanding way.