Make WordPress Core

Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#16764 closed enhancement (maybelater)

PHP5-port - wpdb class

Reported by: hakre's profile hakre Owned by:
Milestone: Priority: lowest
Severity: normal Version: 3.1
Component: Database Keywords: has-patch close
Focuses: Cc:

Description

The wpdb class can benefit from porting the code to PHP5.

Related: #16756; #16757, #16571 (#16760), #16762

Attachments (3)

16764.patch (38.6 KB) - added by hakre 14 years ago.
wpdb with interface and base class
16764.2.patch (27.5 KB) - added by hakre 14 years ago.
wpdb with interface, no base class, variables sorted by access-type, single file
16764.3.patch (21.3 KB) - added by hakre 14 years ago.
Simplified version, visibility mainly, constructor and small adds only

Download all attachments as: .zip

Change History (10)

@hakre
14 years ago

wpdb with interface and base class

@hakre
14 years ago

wpdb with interface, no base class, variables sorted by access-type, single file

@hakre
14 years ago

Simplified version, visibility mainly, constructor and small adds only

#1 @westi
14 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to lowest
  • Type changed from defect (bug) to feature request

This change is going to create a lot of unnecessary churn in the code.

The whole point to me of requiring PHP5 is not to then rewrite the whole of WordPress using a different paradigm but to be able to use PHP5 functionality more freely when adding new features or making incremental improvements.

#2 @hakre
14 years ago

  • Type changed from feature request to enhancement

I beg your pardon westi, wpdb is one of the classes that get's replaced more often. This can benefit from visiblity and interface. It's not introducing a different paradigm at least the changes suggested here were not intended to do so.

The opposite is the case, it's a try to only do minimal changes so that overall code can benefit without introducing too much new things, e.g. a factory for wpdb or similar. The ticket here is just a very lightweight refactoring suggestion.

However, you're totally right that PHP 5 is backwards comptabile with classes that do not make use of interfaces and visibility. The downside is, that you can only program against concrete classes and all methods and members are public.

Wpdb has been designed with private members in mind and thanks to PHP 5, that paradigm can now be reflected even in code and not only in documentation. That's far away from a feature request.

#3 @hakre
14 years ago

Related: #12257

#5 @pento
13 years ago

  • Resolution set to maybelater
  • Status changed from new to closed

Per nacin's link, there is no need to refactor wpdb at this time.

#6 @SergeyBiryukov
13 years ago

  • Milestone Future Release deleted

#7 @Mamaduka
13 years ago

  • Cc georgemamadashvili@… added
Note: See TracTickets for help on using tickets.