Make WordPress Core

Opened 16 years ago

Closed 14 years ago

Last modified 14 years ago

#16764 closed enhancement (maybelater)

PHP5-port - wpdb class

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

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 16 years ago.
wpdb with interface and base class
16764.2.patch​ (27.5 KB ) - added by hakre 16 years ago.
wpdb with interface, no base class, variables sorted by access-type, single file
16764.3.patch​ (21.3 KB ) - added by hakre 16 years ago.
Simplified version, visibility mainly, constructor and small adds only

Download all attachments as: .zip

Change History (10)

@hakre
16 years ago

wpdb with interface and base class

@hakre
16 years ago

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

@hakre
16 years ago

Simplified version, visibility mainly, constructor and small adds only

#1 @westi
16 years ago

  • Milestone Awaiting Review → Future Release
  • Priority normal → lowest
  • Type defect (bug) → 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
16 years ago

  • Type feature request → 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
16 years ago

Related: #12257

#5 @pento
14 years ago

  • Resolution → maybelater
  • Status new → closed

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

#6 @SergeyBiryukov
14 years ago

  • Milestone Future Release

#7 @Mamaduka
14 years ago

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