Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#50085 closed enhancement (maybelater)

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

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

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 6 years ago.

Download all attachments as: .zip

Change History (3)

@ayeshrajans
6 years ago

#1 @SergeyBiryukov
6 years 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.

#2 @desrosj
6 years ago

  • Keywords close removed
  • Milestone Awaiting Review
  • Resolutionmaybelater
  • Status newclosed
  • Version trunk

Going to close this one out in favor of submitting the changes upstream to the Requests library.

If in the future updating wp-tests-config-sample.php becomes possible without the backwards compatibility problems, this can be reopened or a new ticket can be created.

Note: See TracTickets for help on using tickets.