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 authentification level.

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

Submitted by:  Sigurd Nes <sigurdne>
Submitted on:  Thu Jul 17 21:43:56 2008  
Category: API - phpGWapiPriority: 5 - Normal
Item Group: SVN trunk (dev code)Status: Postponed
Privacy: PublicAssigned to: None
Open/Closed: Open

(Jump to the original submission Jump to the original submission)

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


  • 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...



(file #16327)

Sigurd Nes <sigurdne>
Project Member
Thu Aug 21 08:32:51 2008, 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 Aug 21 08:10:21 2008, 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



Sigurd Nes <sigurdne>
Project Member
Thu Aug 21 04:49:21 2008, 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 Aug 19 13:08:41 2008, comment #4:

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



(file #16316)

Sigurd Nes <sigurdne>
Project Member
Tue Aug 19 12:15:21 2008, 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 Jul 19 15:14:19 2008, 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 Jul 18 22:37:53 2008, 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 Jul 17 21:43:56 2008, 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:

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


Attached Files
file #16327: added by sigurdne (25kB - text/x-php - Updated to latest)
file #16316:  pdo.diff added by sigurdne (5kB - application/octet-stream - needed changes to make the pdo-db work)
file #16152:  test_pdo.php added by sigurdne (4kB - 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
  • -unavailable- added by skwashd (Posted a comment)
  • -unavailable- added by maat (Posted a comment)
  • -unavailable- added by sigurdne (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 14 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Aug 21 09:32:32 2008sigurdneAttached File#16315=>Removed
    Thu Aug 21 09:31:58 2008sigurdneAttached File-=>Added, #16327
    Thu Aug 21 04:49:21 2008skwashdStatusNone=>Postponed
    Tue Aug 19 13:08:41 2008sigurdneAttached File-=>Added pdo.diff, #16316
    Tue Aug 19 10:04:19 2008sigurdneAttached File#16158=>Removed
    Tue Aug 19 10:03:25 2008sigurdneAttached File-=>Added, #16315
    Sat Jul 19 15:31:37 2008sigurdneAttached File-=>Added, #16158
    Sat Jul 19 15:30:55 2008sigurdneAttached File#16157=>Removed
    Sat Jul 19 15:14:35 2008sigurdneAttached File#16151=>Removed
    Sat Jul 19 15:14:18 2008sigurdneAttached File-=>Added, #16157
    Fri Jul 18 22:38:18 2008sigurdneAttached File#16131=>Removed
    Fri Jul 18 22:37:53 2008sigurdneAttached File-=>Added, #16151
      Attached File-=>Added test_pdo.php, #16152
    Thu Jul 17 21:43:56 2008sigurdneAttached File-=>Added, #16131

    Back to the top

    Powered by Savane 3.1-cleanup1