Agree as well.naderman wrote:I agree entirely. MODs should be in includes/mod/<modname> and follow the standard conventions. Making the auto loader generic so you can use another instance for loading from a different location makes sense, but should not be encouraged for regular MODs.
[RFC|Merged] Autoloading & Class Naming Convention
- DavidIQ
- Customisations Team Leader
- Posts: 1905
- Joined: Thu Mar 02, 2006 4:29 pm
- Location: Earth
- Contact:
Re: [RFC|Merged] Autoloading & Class Naming Convention
Re: [RFC|Merged] Autoloading & Class Naming Convention
My concern here is what do we actually define as <modname>.
Here are some examples of MODs names (no idea if they could use classes, just f.e.):
We need some guideline about naming <modname> then.
Here are some examples of MODs names (no idea if they could use classes, just f.e.):
Having folders like Security_Blanket_Spam_Blocker_by_Area-51-X.com and corresponding classes like phpbb_class_Security_Blanket_Spam_Blocker_by_Area-51-X.com_whatever would be a headache.Multiple File Upload(addon for UserBlogMod)
Living Avatars Member Control Panel Integration
Security Blanket Spam Blocker by Area-51-X.com
We need some guideline about naming <modname> then.
- DavidIQ
- Customisations Team Leader
- Posts: 1905
- Joined: Thu Mar 02, 2006 4:29 pm
- Location: Earth
- Contact:
Re: [RFC|Merged] Autoloading & Class Naming Convention
That would be part of the guidelines that are included with the package. Something like:
- All lower cased letters
- No special characters (with the exception of hyphens maybe?)
- Must be standard alphabet letters (I.e. No accented letters)
Re: [RFC|Merged] Autoloading & Class Naming Convention
Think we probably can just add a requirement of shortened names for MODs.
Thus MOD will have a regular, not restricted by characters and/or length, descriptive name and a shortened one that should be used to name folders and classes the MOD creates.
Thus MOD will have a regular, not restricted by characters and/or length, descriptive name and a shortened one that should be used to name folders and classes the MOD creates.
Re: [RFC|Merged] Autoloading & Class Naming Convention
I'd say the MOD can pick whatever directory name they feel like which follows naming conventions. Typically it'll end up being something short, cause you actually need to use it in class names. This however brings me back to wondering if using _ for both directory seperation and word seperation in a name makes sense. Maybe we should actually use two different characters in class names to distinguish the directories/namespaces from each other and words within a directory/namespace.
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: [RFC|Merged] Autoloading & Class Naming Convention
So you want folder-location_class-name to result in includes/folder-location/class-name.php
and folder_location-class_name in includes/folder/location-class/name.php
and folder_location-class_name in includes/folder/location-class/name.php
Member of the Development-Team — No Support via PM
Re: [RFC|Merged] Autoloading & Class Naming Convention
Yeah something like that, just not sure about the character to use, - looks a bit cofusing from your examples, don't you think?
Re: [RFC|Merged] Autoloading & Class Naming Convention
I think it's a bad idea. With my initial class name proposal (without autoloading) this would have been possible. But imo, if people want to namespace stuff, they should just add another subfolder.