[wp-trac] [WordPress Trac] #60414: Core PHP autoloader proposal

WordPress Trac noreply at wordpress.org
Fri Aug 9 18:32:07 UTC 2024


#60414: Core PHP autoloader proposal
-------------------------------------+-------------------------------------
 Reporter:  aristath                 |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  General                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-unit-      |     Focuses:  performance,
  tests early                        |  sustainability
-------------------------------------+-------------------------------------

Comment (by azaozz):

 Replying to [comment:40 peterwilsoncc]:

 > Along similar lines, it's also regrettably practical to override a
 WordPress JavaScript file as Core provides a filter for the purpose:

 Right, however JavaScript works quite differently than PHP. It is a
 prototype-based language, i.e. any function, object (class), method, etc.
 can be replaced/overridden at any time by any script, even the built-in
 functions. There isn't such thing as `Fatal error: Cannot redeclare
 function_name() (previously declared in....)` in JS.

 For that reason it seems the ability to replace core scripts from PHP was
 intentional in the first iterations of Script Loader back in 2007-2008.

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


More information about the wp-trac mailing list