One of the "goals" is to move all the queries out of the controllers, well let's see after one year of work where we are.
I did a simple search of the code using $db->query, finding:
/controllers/ => 137
/admin/ => 96
Well, to be honest I hoped/had the feeling we were in a "better shape", though it's not that bad and we can (and should) improve. :P
To do a comparison with what we started in SMF I searched (excluding all the "Subs-*" and "db" files) $smcFunc['db_query, finding 1104 instances.
Well 1104 down to 233 is a pretty darn good start ... plus we MAY have added a query or two along they way :P
Agree we need to 'finish' the improvement job :D
/me is innocent! :P
Actually is +14 because I didn't notice the $db_search->search_query, so 247. Still a good reduction. :D
Yep!
In the meantime, an update after merging a couple of branches:
/controllers/ => 142
/admin/ => 88
And a bit of additional analysis.
Regarding the /admin/ dir:
RepairBoards.php is the one accounting for the relative majority of the queries: 39. That file is scary TBH...do we really need all this? Can it be reworked to use functions we already have? What do you think?
The second file in terms of queries is ManageAttachments, this is as usual a bit tricky I think...
Special case (I think) AdminDebug.controller.php: it has both queries and markup. I'm not sure if it is a special case, since I suppose it should just adhere to the standards of the rest of the code...or not?
The /controllers/ dir, instead, is more "messy", there are still 5 files with more than 10 queries:
PersonalMessage (20)
Recent (17)
RemoveTopic (16)
ProfileHistory (15)
* ProfileInfo (15)
Just made the pr for profile info, so knock 15 more off the list :)
YAY!
OK, this is extremely refreshing for the codebase, and incomparable by a great length with SMF. And unbelievable, how fast you folks went through it.
@Trek,
How about you grumble at us meanies to give you details on this reasons -> progress -> achievement -> consequences, then please, help shape up our mumbling into a decent form.
For the mid-level development documentation (changes from SMF, Elk presentation, oriented dev-wise). We have similar github wiki pages already, they just want added to. ;)
And update after the last merges:
/controllers/ => 122 (110+12)
/admin/ => 76 (74+2)
Grand total: 198
Under the 200! YAY!
Next goal is 100! ;D
Another week and:
/controllers/ => 113 (101+12)
/admin/ => 17 (17+0)
Grand total: 130
If I did the same search(s) I think its now
Controllers (75 / 12)
Admin (3 / 0)
Total of 90 !
but we need the master counter to verify O:-)
(http://www.easymemes.com/uploads/memes/101329_aLKmwXwa1VXGEGh.jpg)
This is for when it will reach 0: http://i76.photobucket.com/albums/j24/mambutu/official_seal_of_approval.jpg :P
I look forward to the awesome sauce !
Final count for 1.0 is:
controllers: 68 / 12
admin: 1 / 0
Total: 81.
Very good situation considering where we started! :D
The development branch is already at:
controllers: 47 / 0
admin: 0 / 0
So, just 47 queries in total!
Thanks to
@groundup for his contributions to the task! :D (Or maybe it was at bringing back to controllers things that were not supposed to stay in subs... either way thanks. :P)
Wow ... its all a blur now :P ... 1000+ knocked down to 81! Awesome job everyone!
One other goal/objective in 1.1 would be to combine any duplicate/similar ones where it makes sense ... I know we have a few similar to one another in a few places,. Just getting them out of the controllers was monumental task to start with, and I must say being able to use them in addons is a delight :D
oh, that's great :D