Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#46630 closed enhancement (duplicate)

Remove SPL-Autoload polyfill

Reported by: ayeshrajans Owned by:
Priority: normal Milestone:
Component: Bootstrap/Load Version: 4.2
Severity: normal Keywords: has-patch
Cc: Focuses: performance

Description

Follow up to #46594 and #40109

PHP 7.2 deprecated the __autoload function to autoload PHP classes in favor of spl_autoload_register. For PHP versions <= 5.2, one can have PHP versions without SPL, which added the spl_autoload_register.

To make sure tests pass, I split the WordPress's __autoload implementation to a separate file spl-autoload-compat.php.

Now that we require PHP 5.6.30 in trunk, we can safely remove this polyfill!

Attachments (1)

46630.patch​ (3.6 KB ) - added by ayeshrajans 8 years ago.
Travis: ​https://travis-ci.org/Ayesh/wordpress-develop/builds/510720605

Download all attachments as: .zip

Change History (5)

#1 @ayeshrajans
8 years ago

  • Keywords has-patch added
  • Version trunk → 4.2

#3 @pento
7 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Thank you for the ticket and patch @ayeshrajans!

I'm going to roll this into #47698, where similar code cleanup is taking place.

#4 @pento
7 years ago

In 45637:

Code Modernisation: Remove the SPL autoloader polyfill.

As of PHP 5.3, the SPL extension cannot be disabled, so we no longer need this polyfill.

The file is kept with a _deprecated_file() call, to alert any plugins or themes that may be loading it directly.

Props jrf, ayeshrajans.
See #47698, #46630.

Note: See TracTickets for help on using tickets.