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 17 Jul 2008 09:43:56 PM UTC  
 
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 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

 

Attached Files
file #16327:  class.db.inc.php 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 21 Aug 2008 09:32:32 AM UTCsigurdneAttached File#16315=>Removed
    Thu 21 Aug 2008 09:31:58 AM UTCsigurdneAttached File-=>Added class.db.inc.php, #16327
    Thu 21 Aug 2008 04:49:21 AM UTCskwashdStatusNone=>Postponed
    Tue 19 Aug 2008 01:08:41 PM UTCsigurdneAttached File-=>Added pdo.diff, #16316
    Tue 19 Aug 2008 10:04:19 AM UTCsigurdneAttached File#16158=>Removed
    Tue 19 Aug 2008 10:03:25 AM UTCsigurdneAttached File-=>Added class.db.inc.php, #16315
    Sat 19 Jul 2008 03:31:37 PM UTCsigurdneAttached File-=>Added class.db.inc.php, #16158
    Sat 19 Jul 2008 03:30:55 PM UTCsigurdneAttached File#16157=>Removed
    Sat 19 Jul 2008 03:14:35 PM UTCsigurdneAttached File#16151=>Removed
    Sat 19 Jul 2008 03:14:18 PM UTCsigurdneAttached File-=>Added class.db.inc.php, #16157
    Fri 18 Jul 2008 10:38:18 PM UTCsigurdneAttached File#16131=>Removed
    Fri 18 Jul 2008 10:37:53 PM UTCsigurdneAttached File-=>Added class.db_pdo.inc.php, #16151
      Attached File-=>Added test_pdo.php, #16152
    Thu 17 Jul 2008 09:43:56 PM UTCsigurdneAttached File-=>Added class.db_pdo.inc.php, #16131

    Back to the top


    Powered by Savane 3.1-cleanup