[buddypress-trac] [BuddyPress Trac] #6853: Autoload BP classes

buddypress-trac noreply at wordpress.org
Fri Jan 29 07:04:25 UTC 2016


#6853: Autoload BP classes
-----------------------------------+------------------------------
 Reporter:  boonebgorges           |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  API                    |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |
-----------------------------------+------------------------------

Comment (by r-a-y):

 Looks good!

 `02.patch` replaces a few older instances of `autoload` with
 `do_autoload`.

 > Is it crazy to do this without PHP 5.3, with mandatory SPL and
 namespaces? Seems to me it's worth considering, given the memory
 improvements.

 Since the BP codebase is getting larger and larger, we should try to
 optimize wherever we can, so big +1!

 If we could ignore PHP 5.2, it would probably be better to follow a PSR
 standard.  But, hey, we're tied to WordPress -- for better or worse.

 > One concern is that the autoload logic - which looks for classes named
 BP_{$component}_{$foo} against a whitelist of BP components - might hit a
 false positive in a plugin that has a class name like BP_Groups_Whatever.

 Good call.  It might be good to write a sample plugin using the
 `BP_Component` class to see if we can trip it up.

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


More information about the buddypress-trac mailing list