WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 3 years ago

#13208 closed defect (bug) (worksforme)

shared code in get_mu_plugins() and get_dropins()

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

Aka code buplication.

FYI closedir() is not necessary in PHP. It only consumes runtime and memory if you use it especially with the @ operator.

Attachments (1)

13208.patch (3.9 KB) - added by hakre 7 years ago.

Download all attachments as: .zip

Change History (8)

@hakre
7 years ago

#1 @hakre
7 years ago

  • Keywords has-patch added

#2 @hakre
7 years ago

duplicate code went in [13233], related Ticket is #11861

#3 follow-up: @nacin
7 years ago

closedir() was taken directly from get_plugins. If you split this into two patches, we can consider drying up the code for 3.0. Not really necessary though -- it's quite similar code across the three functions, but extracting out the duplicated code isn't less complicated because of the differences.

#4 @nacin
7 years ago

  • Milestone changed from 3.0 to 3.1

#5 in reply to: ↑ 3 @hakre
7 years ago

Replying to nacin:

closedir() was taken directly from get_plugins.

The note for closedir was just a sidenote - no need to focus on that, that was informative.

If you split this into two patches, we can consider drying up the code for 3.0. Not really necessary though -- it's quite similar code across the three functions, but extracting out the duplicated code isn't less complicated because of the differences.

Standard plugins are handling directories recursively, mu and dropins don't to that. To not be so invasive, this is for those two only. So I would first love to see this in before extending it over other places as well.

#6 @nacin
6 years ago

  • Milestone changed from Awaiting Triage to Future Release

#7 @nacin
3 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.