[buddypress-trac] [BuddyPress Trac] #6870: All classes should be in their own files
buddypress-trac
noreply at wordpress.org
Wed Feb 3 05:07:31 UTC 2016
#6870: All classes should be in their own files
--------------------------+------------------
Reporter: boonebgorges | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.5
Component: API | Version:
Severity: normal | Resolution:
Keywords: |
--------------------------+------------------
Changes (by boonebgorges):
* type: defect (bug) => enhancement
Comment:
[attachment: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:
* All files (not in `/classes/`) that include a class are moved via `svn
cp` to `/classes/`. This preserves SVN history.
* The `class-{$classname}.php` convention is kept, for compliance with the
autoload technique proposed in #6853. This means that we have a file named
`bp-activity/classes/class-bp-akismet.php`. The autoloader will need to
have a special entry for classes like this.
* Where the class previously appeared in the `bp-activity-*.php` file,
it's been replaced with a `require` 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 a `do_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.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6870#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list