[wp-hackers] Adding wp-includes/class folder
Stephane Daury
wordpress at tekartist.org
Fri Aug 31 04:10:54 GMT 2007
Not a debate, but an agreement on my side.
But can you develop on the loss of Opcode Caching?
Stephane
On Aug 30, 2007, at 23:17, Jacob Santos wrote:
> What debate could there be for adding a class folder to wp-
> includes? I know the current standard is to have 'class-
> whatever.php' file to wp-includes folder. This would allow for
> better convention and organization moving forward. I mean this for
> external developers.
>
> One disadvantage is that developers would have to browse through
> multiple directories to find the current file. This setup is
> confusing to beginners and well everyone that isn't intimate to the
> code. Another disadvantage that using the PEAR convention you lose
> *perceived* *initial* Opcode Caching speed boost.
>
> The advantages are
>
> 1. Easier to unit test, can remove classes from presentation files.
> 2. Also keep the class model separate from application logic.
> 3. Using the PEAR convention, you would be able to use __autoload()
> on PHP 5.
> 4. Easier to extend later (once the convention is established, any
> new classes can be applied).
> 5. Simplifies more root WordPress files.
>
> I suggest keeping the functions where they are and just separating
> the classes into their own file, so you would have 1 class per
> file, instead of cramming as many classes as there in that feature
> in a single file. Using Dashes to represent folder paths, so
> wp_xmlrpc_server would be /wp-includes/class/wp/xmlrpc/server.php.
> Would also suggestion using Pascal naming convention for class
> names: WP_Xmlrpc_Server or ABSPATH . WPINC . '/class/WP/Xmlrpc/
> Server.php'.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list