WordPress.org

Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#50085 new enhancement

Use `__DIR__` magic constant instead of `dirname(__FILE__)`

Reported by: ayeshrajans Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: General Keywords: has-patch close
Focuses: performance Cc:

Description

Now with WordPress requiring PHP 5.6 the minimum, we can replace dirname(__FILE__) calls with the PHP 5.3-introuced __DIR__ constant.

This ticket does not intend to change such calls in third party libraries, even on the ones that we are the de-facto maintainers due to the package age.

Attachments (1)

50085.patch (1.3 KB) - added by ayeshrajans 4 weeks ago.

Download all attachments as: .zip

Change History (2)

@ayeshrajans
4 weeks ago

#1 @SergeyBiryukov
4 weeks ago

  • Keywords close added

Thanks for the patch!

class-requests.php is a part of the Requests external library, any changes should be submitted upstream.

The change in wp-tests-config-sample.php was previously reverted in [47201] to avoid breaking unit tests created with WP-CLI scaffold command, see comment:15:ticket:48082 and #49377 for details.

Note: See TracTickets for help on using tickets.