[buddypress-trac] [BuddyPress Trac] #6083: Perhaps split up classes in existing component-class.php to separate files

buddypress-trac noreply at wordpress.org
Fri Feb 13 00:02:01 UTC 2015


#6083: Perhaps split up classes in existing component-class.php to separate files
--------------------------------------+-----------------------
 Reporter:  DJPaul                    |       Owner:  DJPaul
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  2.3
Component:  Tools - Code Improvement  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:                            |
--------------------------------------+-----------------------

Comment (by DJPaul):

 Per above comment, this was discussed at the last dev chat and derailed
 into a larger discussion about file naming conventions for the entire
 component. I'd like to limit this particular ticket to splitting up the
 bp-component-classes.php files. Using Activity as an example:

 * `bp-activity/bp-activity-classes.php` would be split by class into a
 new` bp-activity/classes/` subfolder.
 * `bp-activity/bp-activity-classes.php` would `require` each of those new
 class files in the same order that they are defined today (a kind-of
 autoloader, if you like). This prevents breaking any custom code that is
 directly including `bp-activity-classes.php` (that particular concern is
 out-of-scope of this ticket, but I wanted to briefly mention it).
 * For example, we would add `bp-activity/classes/class-bp-activity-
 activity.php`, `bp-activity/classes/class-bp-activity-query.php`, `bp-
 activity/classes/class-bp-activity-feed.php`, etc.
 * I'm proposing that this change would ONLY affect classes explicitly
 within the `bp-component-classes.php` files. Any other classes (for
 example `BP_Activity_Template`, which is in `bp-activity-template.php`
 would remain unchanged for now. We could in future decide to move those
 classes out of those other files.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6083#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list