News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Dev Center

Started by Diego Andrés, December 18, 2012, 03:05:26 AM

Previous topic - Next topic

Diego Andrés

Link to the mod




Dev Center
Developed by Diego Andrés
Original Developer: NanoSector




Introduction
Dev Center adds a couple of settings to the admin panel that might be useful when developing a modification.

Features
  • Enable and display debugging information.
  • Adds another phpinfo() page in a phpinfo action for easy and quick access.
  • Monitor server load in the footer.

Localization
English
Spanish by davidhs


Changelog
GitHub

SMF Tricks - Free & Premium Responsive Themes for SMF.

Gryzor

Well, this could be useful indeed, but why not add a server load indicator? Perhaps next to the Admin menu, just like the errors number?

Thanks!

NanoSector

Quite possible, I'll look into adding it in a future version. Thanks :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Gryzor

At first I was actually looking for a special section showing the load, until I looked at the description more closely and understood the scope.

Heck, it'd be fantastic (maybe another mod...) if the admin could have a small box sitting at a corner providing server stats - cpu, mem, db hits, stuff like that. I wonder how come nobody has thought of that before :D

Anyhow, thanks for the mod, it's neat!

NanoSector

If you want to have such a mod I can look in creating one that provides the functionality for you. :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Gryzor

I think lots of people would be interested in it... very convenient, in place of opening a console window to keep track of things.

Other possibilities: response times (from an external service of course), uptime, FS size (or maybe just forum dir size)...

Arantor

The one thing that bothers me about this, just as I found when writing my own version of this ages ago -  http://custom.simplemachines.org/mods/index.php?mod=2441 - is that you're still adding a query per page that the admin is browsing, even though if the error log is MyISAM, it's quite a cheap query.

What you might want to do is expand things such that if an error is logged, add it to a central count of errors.

NanoSector

Quote from: Arantor on January 04, 2013, 01:45:23 PM
The one thing that bothers me about this, just as I found when writing my own version of this ages ago -  http://custom.simplemachines.org/mods/index.php?mod=2441 - is that you're still adding a query per page that the admin is browsing, even though if the error log is MyISAM, it's quite a cheap query.

What you might want to do is expand things such that if an error is logged, add it to a central count of errors.
I actually tore this package apart and submitted it as an external package and the Cust. team at that time rejected it because it found your package better written :)

Thanks for your suggestion, do you think storing the count in $modSettings and updating that variable whenever an error is logged is a good idea?

I should definitely rewrite this one time because I wrote this a while ago and haven't updated it since.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Well, essentially yes. ;)

The tricks are: up front, start a counter of 0, then as an error occurs, add 1 to the count, and then before obexit is called, update $modSettings. Then, when you do go to the error log, validate whether the number is different, and if it is, update $modSettings because then you have an empirical source to play with.

NanoSector

Quote from: Arantor on January 04, 2013, 01:52:41 PM
Well, essentially yes. ;)

The tricks are: up front, start a counter of 0, then as an error occurs, add 1 to the count, and then before obexit is called, update $modSettings.
Okay, but can't I create an install script that gets the count at the time of installing the mod? Not that people can't just visit the Error Log panel but I'd like to have stuff in order right when installing :)

QuoteThen, when you do go to the error log, validate whether the number is different, and if it is, update $modSettings because then you have an empirical source to play with.
This is a good plan, though what variable should I be looking for when in the Error Log panel?

I'm not too familar with SMFs error logging system, sorry :)
Thank you :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

QuoteOkay, but can't I create an install script that gets the count at the time of installing the mod? Not that people can't just visit the Error Log panel but I'd like to have stuff in order right when installing

Missing the point. Start the counter of 0 at the start of the *page*, then only update the counter if there actually have been errors.

You can additionally update it when first installing, sure.

NanoSector

Quote from: Arantor on January 04, 2013, 02:02:23 PM
QuoteOkay, but can't I create an install script that gets the count at the time of installing the mod? Not that people can't just visit the Error Log panel but I'd like to have stuff in order right when installing

Missing the point. Start the counter of 0 at the start of the *page*, then only update the counter if there actually have been errors.

You can additionally update it when first installing, sure.
Ah wait I see, you mean that I should gather how many errors occured on the current page, and add that to the $modSettings variable just before quitting? That's a bloody good idea, actually, thanks :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Yup, that's what I mean.

* Arantor is not being entirely theoretical here.

NanoSector

I've updated the mod, thanks very much Arantor :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Shambles

Other than "adds a couple of settings to the admin panel.." what does this mod actually do? And what is DevCenter? A search of DevCenter doesn't show anything other than this mod  ???

Scuse my ignorance in this matter...

Arantor

DevCenter is the name of the mod, nothing more... it is a few things given to developers in an attempt to help them out.

Firstly, it adds a page where PHP info can be seen, action=phpinfo to show that helpful page. Fortunately, Zend has finally fixed phpinfo's underlying function not to be an XSS vulnerability, which is nice.

Secondly, it adds an option to show the current load of the host, useful to use the load balancing options. But that's only really an option if you're on a system that has load balancing enabled and usable and most people for whom that applies, well, they are probably using a VPS or similar where they can get that information themselves without little extra effort (e.g. using `top` in a shell)

Lastly, it adds the ability to show the number of errors in the error log, but does so in the admin menu itself, so you'll know just by browsing your forum how many errors there are. That one is useful, though I'd note that there are other mods that allow you to get that without any extra stuff as linked earlier (you might recognise the handiwork of mod 2441's author :D)

NanoSector

Quote from: ®Shambles on January 05, 2013, 09:42:25 AM
Other than "adds a couple of settings to the admin panel.." what does this mod actually do? And what is DevCenter? A search of DevCenter doesn't show anything other than this mod  ???

Scuse my ignorance in this matter...
I added a few screenshots, hope it gets clearer now :)

Thanks for explaining Arantor, that's exactly what the mod does (or, is supposed to do, rather ;))
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Shambles

I appreciate the time you spent creating that summary, I really do.

Maybe those details could form part of the mod's description, as now I can see it being beneficial to more than just developers.

The authorship of mod 2441 had not passed me by, as it happens... ;)


ETA: [above was for the member known as Arantor]
ETAA: [additional info from the member known as Yoshi2889 is also appreciated]

NanoSector

Quote from: ®Shambles on January 05, 2013, 09:55:29 AM
I appreciate the time you spent creating that summary, I really do.

Maybe those details could form part of the mod's description, as now I can see it being beneficial to more than just developers.
Yes, I was lazy at the time of writing the description :P I'll update it straight away, thanks for letting me know it's vague.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

I'd argue that making phpinfo open to any user is a security risk, however trivial. What I'd be inclined to do is move it to a page in the admin panel somewhere and possibly even enforce allowedTo('admin_forum') first.

Advertisement: