phant0m Posted June 15, 2010 Share Posted June 15, 2010 I was wondering what Class naming guidelines you follow for autoloading and how you put them into directories Some_NameSpace_Class_TypeOne --> Some/NameSpace/Class/TypeOne.php or some/name.space/class/type.one.class.php I'm just trying to collect some ideas to see what ideas people have come up with. Link to comment https://forums.phpfreaks.com/topic/204884-php-class-naming-guidelines/ Share on other sites More sharing options...
Alex Posted June 15, 2010 Share Posted June 15, 2010 The first method you mentioned, also known as the PEAR naming scheme, is a pretty popular. One added advantage it gives you is the ability to do something like this: function __autoload($classname) { $path = str_replace('_', DIRECTORY_SEPARATOR, $classname); require_once("$path.php"); } Link to comment https://forums.phpfreaks.com/topic/204884-php-class-naming-guidelines/#findComment-1072584 Share on other sites More sharing options...
Mchl Posted June 15, 2010 Share Posted June 15, 2010 Here's one proposal: http://groups.google.com/group/php-standards/web/psr-0-final-proposal Link to comment https://forums.phpfreaks.com/topic/204884-php-class-naming-guidelines/#findComment-1072593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.