[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal

WordPress Trac noreply at wordpress.org
Tue Aug 30 11:09:57 UTC 2016


#36335: Next generation: core autoloader proposal
-----------------------------+------------------
 Reporter:  dnaber-de        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  4.7
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------

Comment (by schlessera):

 As already mentioned in Slack, I have created a custom WordPress
 autoloader generator and class loader that can be adapted to meet very
 specific WordPress needs: https://github.com/schlessera/composer-wp-
 autoload

 The code is not brilliant, as I am a bit pressed for time right now, and I
 have re-used large parts of the `xrstf/composer52` package. I intend to
 further clean it up in the coming days, though.

 Main features that differ from standard Composer autoloader (taken from
 `README.md` file):

 * The generated autoloader is compatible with PHP 5.2. Classes containing
 PHP 5.3+ code will be skipped and throw warnings.
 * The paths to the classes are relative to a set constant. The default
 constant being used is `ABSPATH`.
 * The class maps can optionally be configured to be case-insensitive.

 Regarding the case-insensitivity, I would recommend against using that, as
 the case-sensitivity just points to potential latent bugs. However, I
 provide the functionality as an optional setting nevertheless, as I
 wouldn't want the inclusion of an autoloader to be blocked because of
 minor case mismatches.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:131>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list