Classes naming May 29, 2014, 09:46:00 am I was looking around at the classes in /subs/, and... well, at the moment there are some naming variants:I see these patterns mainly: Something_Else in a file SomethingElse.class.php Something_Else in a file Else.class.php Something_Else in a file Something.class.php Something in a file Something.class.phpThen some completely unrelated class names with file names.And finally some special cases (search, control verification <= I should fix that, payment gateways).What would you like best?I think now it's one of the last moments to pick one and be happy for the 1.x line.I think the first is the most "autoloading-friendly".
Re: Classes naming Reply #1 – May 29, 2014, 11:15:31 am Where is the poll I think 1 is the way to go and then I need is a way to remember that !
Re: Classes naming Reply #3 – May 29, 2014, 02:23:23 pm And here it is:https://github.com/elkarte/Elkarte/pull/1593Try to review/test it before merging because I didn't. I'll try to test something later.
Re: Classes naming Reply #4 – May 29, 2014, 09:27:10 pm I'd use PSR compliant names: SomethingElse in SomethingElse.php
Re: Classes naming Reply #5 – May 30, 2014, 03:38:47 am Yeah, that could have been a solution, though it would have meant a rewrite of a lot of stuff in the first place...Yesterday evening just after this was merged I was playing with an autoloader and it worked "quite well" (few problems with specific classes like search, payments, database), but overall it worked fine! emanuele wanted a naming convention because of the autoloader. In the end the "_" is good because it helps identify the different kind of classes we have that need "special" rules for the autoload.The next step for 1.1 will be to harmonize the /sources/admin directory naming, so that we could guess the place of a class just by its name and not having to use file_exists.
Re: Classes naming Reply #6 – May 30, 2014, 04:15:18 pm https://github.com/emanuele45/Dialogo/compare/elkarte:development...autoloader?expand=1 Not yet ready to merge.
Re: Classes naming Reply #7 – June 13, 2014, 11:51:08 am Reminder bump: write these on the wiki somewhere.