[wp-trac] [WordPress Trac] #4899: Create wp-includes/class folder to store WordPress classes Proposal

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 3 18:37:21 GMT 2007


#4899: Create wp-includes/class folder to store WordPress classes Proposal
-------------------------+--------------------------------------------------
 Reporter:  darkdragon   |       Owner:  anonymous       
     Type:  enhancement  |      Status:  new             
 Priority:  normal       |   Milestone:  2.4 (next)      
Component:  General      |     Version:  2.3             
 Severity:  normal       |    Keywords:  classes proposal
-------------------------+--------------------------------------------------
 Classes should be organized in its own folder for several reasons.

  1. Allows for Classes to be Unit Tested easily. Some classes are within
 files that contain presentation, which doesn't easily allow for unit
 testing the class.
  1. Single location to find classes, moves classes that are within other
 files into a location where developers and plugin authors can find them.
 Intuitive locations.
  1. Submitting Patches for classes should allow for better versioning.
  1. Possible optimization by only including the classes that are needed.
 (Think Administration or installer)

 I propose that the PEAR class organization should be used for WordPress
 classes. The external libraries should also be located in {{{wp-
 includes/class}}}, but not broken up into the PEAR convention.

 The PEAR convention is to organize the files in folders between the dashes
 and use dashes as '/'.

 '''Backwards Compat'''

 The old include files will be retained and just include the classes that
 existed in the file previously.

 '''Examples'''

 {{{WP_Cache}}}: {{{wp-includes/class/WP/Cache.php}}}

 {{{WP_Ajax_Response}}}: {{{wp-includes/class/WP/Ajax/Response.php}}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4899>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list