patchphpGroupWare - Patches: patch #6572, A test on using PDO in db-class

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6572: A test on using PDO in db-class

Submitter:  Sigurd Nes <sigurdne>
Submitted:  Thu 17 Jul 2008 09:43:56 PM UTC
 
Category:  API - phpGWapi Priority:  5 - Normal
Item Group:  SVN trunk (dev code) Status:  Postponed
Privacy:  Public Assigned to:  None
Open/Closed:  Open

( Jump to the original submission )

Thu 21 Aug 2008 09:31:58 AM UTC, comment #8: 

Update:

  • Seems like at least _LINE_ is needed as input to the function.
  • There is no problem with php5 - I'm using PHP Version 5.2.6 and it works perfectly.
  • clone is working

so - when you are ready...

Regards

Sigurd

(file #16327)

Sigurd Nes <sigurdne>
Project Member
Thu 21 Aug 2008 08:32:51 AM UTC, comment #7: 

So if i understand well :

1) This is a major change => we cannot include it just now as phpgw is in freeze-before-release status : OK that makes sense

2) There are technical issues (things we need to have like __clone() and __destruct(), php5 compatibility...) : OK that just need some work to be done, doesn't it ?

3) As this is a major change we'll have to check for side effects and then a large code review will be needed : OK that make sense too

=> Seems in a good way to me

Pascal Vilarem <maat>
Project Member
Thu 21 Aug 2008 08:10:21 AM UTC, comment #6: 

I'll just use it for my self then ;)

You are welcome to use it when you are ready.

It's not copied and pasted from any "All Rights Reserved" licensed site. Inspired by: yes - copied : no

Thanks for the comment on $line and $file

Regards

Sigurd

Sigurd Nes <sigurdne>
Project Member
Thu 21 Aug 2008 04:49:21 AM UTC, comment #5: 

This code isn't in a state that can be used, for the following reasons:

  • trunk is currently being stabilised for a release
  • It drops important functionality like __clone() and __destruct()
  • The "test" code bears no relationship to real world phpgw operations so the stated performance claims can't be verified.
  • There are bigger issues with the db abstraction layer than using PDO or not.  These issues should be addressed in a thorough review of the db code
  • The code is tainted as it has been copied and pasted from an "All Rights Reserved" licensed site - as acknowledged in the initial comment
  • $line and $file aren't needed when calling query as the error handler gets this information anyway
  • It is pretty easy to switch to PDO while still using ADOdb.
  • The code needs to be updated for PHP5
  • The list of other changes looks rather light on and incomplete.
  • There are other issues, but I think this list alone justifies postponing it until after the next release.
Dave Hall <skwashd>
Project Administrator
Tue 19 Aug 2008 01:08:41 PM UTC, comment #4: 

It is very few changes needed to the code to make it work - basically what is included in the attached pdo.diff

Regards

Sigurd

(file #16316)

Sigurd Nes <sigurdne>
Project Member
Tue 19 Aug 2008 12:15:21 PM UTC, comment #3: 

seems promising... how much work would it need to comply with phpgw coding standards ? can we hope to see it included mainstream ?

Pascal Vilarem <maat>
Project Member
Sat 19 Jul 2008 03:14:19 PM UTC, comment #2: 

I have finished the porting from adodb to pdo (except for some meta functions - which still calls adodb).

Have a look

(file #16157)

Sigurd Nes <sigurdne>
Project Member
Fri 18 Jul 2008 10:37:53 PM UTC, comment #1: 

The class is updated to handle prepared prepared statements for insert and select.

The test include test on FETCH_ASSOC and FETCH_BOTH - seems to make no difference in performance (speed)

(file #16151, file #16152)

Sigurd Nes <sigurdne>
Project Member
Thu 17 Jul 2008 09:43:56 PM UTC, original submission:  

I did a test on using PDO for db-connection.
The code is based on the current db-class from trunk and the tutorial found at:
http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html

Seems like it is about 5 % faster on reading and 20 % faster on writing compared to adodb with eaccelerator.

The class is not 100% complete - but most of it works.

What do you think.

Sigurd Nes <sigurdne>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #16327:  class.db.inc.php added by sigurdne (25KiB - text/x-php - Updated to latest)
file #16316:  pdo.diff added by sigurdne (5KiB - application/octet-stream - needed changes to make the pdo-db work)
file #16152:  test_pdo.php added by sigurdne (4KiB - application/octet-stream - Updated to handle prepared prepared statements for insert and select)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by skwashd (Posted a comment)
  • -email is unavailable- added by maat (Posted a comment)
  • -email is unavailable- added by sigurdne (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

     

     

    Follow 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-21 sigurdne Attached File#16315 Removed
    2008-08-21 sigurdne Attached File- Added class.db.inc.php, #16327
    2008-08-21 skwashd StatusNone Postponed
    2008-08-19 sigurdne Attached File- Added pdo.diff, #16316
    2008-08-19 sigurdne Attached File#16158 Removed
    2008-08-19 sigurdne Attached File- Added class.db.inc.php, #16315
    2008-07-19 sigurdne Attached File- Added class.db.inc.php, #16158
    2008-07-19 sigurdne Attached File#16157 Removed
    2008-07-19 sigurdne Attached File#16151 Removed
    2008-07-19 sigurdne Attached File- Added class.db.inc.php, #16157
    2008-07-18 sigurdne Attached File#16131 Removed
    2008-07-18 sigurdne Attached File- Added class.db_pdo.inc.php, #16151
        Attached File- Added test_pdo.php, #16152
    2008-07-17 sigurdne Attached File- Added class.db_pdo.inc.php, #16131

    Back to the top


    Powered by Savane 3.9