HEAD ON! Support has been added for Pear::DB!
Along those lines, we have already made many great changes. First, we have some people wanting to use bitweaver, however they want to use Pear::DB instead of ADODB. I have abstracted out our BitDB class and the core is now working 100% on both, with a simple toggle of a variable in kernel/config_inc.php
ADODB is our prefered mechanism and is still required for things like the installer, and a handful of admin pages that verifyInstalledPackages. However, this reworking allows for PEAR or the addition of the new native PDO stuff if it happens to turn out to be any good. Pear::DB is slower than ADODB, and feature incomplete IMHO (missing DataDict for one..), however there is a lot of handy stuff written in PEAR some people need/prefer.
Very little changes were needed to make the transition thanks to ADODB's and Pear's almost identical behaviors for the key functions. BitDb has been broken apart into the following classes:
BitDbBase.php - Pure Virtual Base Class, and common functions like convertQuery
|->BitDbAdodb.php - ADODB implementation
|->BitDbPear.php - PEAR implmentation
Very few things have changed. backticks in our queries are still handled the same way. convertQuery is still in the BitDbBase class, as is convert_sortmode and others.
What does need to change is the use of $result->EOF and $result->fields in the results sets. We don't do this everywhere, but it is common. However, it is very easy to change like the following:
while( !$result->EOF ) { if( array_key_exists( strtolower( $result->fields['title'] ), $ret ) ) { $result->fields['description'] = tra( 'Multiple pages with this name' ); } $ret[strtolower( $result->fields['title'] )] = $result->fields; $result->MoveNext(); } Changes to: while( $row = $result->fetchRow() ) { if( array_key_exists( strtolower( $row['title'] ), $ret ) ) { $row['description'] = tra( 'Multiple pages with this name' ); } } $ret[strtolower( $row['title'] )] = $row; }
Also, queries that snag a single row and then use $rs->fields should revert to the simpler getRow() funciton in the BitDb classes.
I have not cleared out all the packages, but a good bit of them are all working with a restored bw.o dump. If you want to try out PEAR, update to HEAD, run "pear install DB", and add "$gBitDbSystem = 'pear';" to your kernel/config_inc.php
Related Items
Documentation » Technical Documentation
Documentation geared towards developers and people who want to learn about the core processes of bitweaver
HEAD ON! Support has been added for Pear::DB! • Oracle Reservations for Two • ReleaseTwo: Shedding that last bits of our roots, finding the core of our being • getContentList • How to add a pagination to an object list • Moving bw in another directory • pma and mysql • safe mode on / open_base_dir • sequence and auto • The package I am currently developping is suddenly desactivated • APIDocumentation • Archived Picture Upload with Fisheye under Windows • Bitweaver and Browser Cookies • bitweaverCVS • bitweaverFeatures • bitweaverPerformance • CodingGuidelines • CreatingServices • CssSchema • InstallbitweaverDoc • IntegrationTutorial • LibertyFormats • LibertyMime • LibertyServices • phpdoc content status • PortingTikiWikiPackages • PrototypeAjaxObject • PrototypeReference • SamplePackage • SearchPackageDevNotes • TUTORIAL - Displaying Icons ONLY to AUTHORS of the page • Tutorial - Liberty Plugins • Tutorial - Liberty Plugins II • UsersDoc
Comments
tggzsyln