#6870 closed enhancement (fixed)
All classes should be in their own files
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: | slaFFik, espellcaste@… |
Attachments (1)
Change History (24)
#3
@
9 years ago
I guess it feels a little weird to see the main loader classes moved in such a way, but those *are* classes, so... make it so!
This ticket was mentioned in Slack in #buddypress by boone. View the logs.
9 years ago
#16
@
9 years ago
- Resolution set to fixed
- Status changed from new to closed
I've finished the moves for all components.
I don't expect that these will be the final resting places for all of the files. A number of the classes in bp-members/classes/
that once lived in bp-core should probably go back there, to simplify our autoloader. And it's likely that we'll eventually want to do some proper testing to see if it's possible to move/consolidate the inline require
statements that have resulted from these changes. But for now, I've tried to be as conservative as possible - no functional changes, even for people who are including files manually.
I'm going to mark this resolved and continue work on autoloading over at #6853.
6870.diff sketches how this might be done for the Activity component, which is pretty representative of the other components. Beware: it's a large diff. Here are the important points:
/classes/
) that include a class are moved viasvn cp
to/classes/
. This preserves SVN history.class-{$classname}.php
convention is kept, for compliance with the autoload technique proposed in #6853. This means that we have a file namedbp-activity/classes/class-bp-akismet.php
. The autoloader will need to have a special entry for classes like this.bp-activity-*.php
file, it's been replaced with arequire
command. This ensures 100% backward compatibility with anyone who may be loading these files directly (may Providence have mercy on their Souls). When autoloading is introduced, these require statements can be wrapped in ado_autoload
check.Does the approach look correct to everyone? It will be an absolute blast to walk through the process for each component (NOT!!1!! LOL) but am volunteering myself for the job, if everyone's in agreement.