News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

PHP Helper Framework

Started by jonesH, December 16, 2015, 11:31:18 AM

Previous topic - Next topic

jonesH

Some programming languages that I am more or less familiar with can use tools that help the programmer with execution flow, debugging, breakpoints, stuff related to variables and so on. I tried using Chrome Developer Tools but it's not what I wanted (good for lots of other duties, though). My usual working environment is localhost on Windows 7 Pro with WAMPStack or OSX Snow Leopard with MAMPStack.

For instance, I would like to read the value that $context takes, to see which functions are loaded and when, whether conditions are met or not etc. I expect this would help me better understand the workings of SMF.

Is anyone aware of some such tools? Perhaps a PHP helper? It need not be too complicated, as my PHP working knowledge is not that deep... Of course I can search for one on the web and try until I find something, but I would imagine folks here have already tried some and can tell about.Regards.

Kindred

As far as I know, no one has done this.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Bigguy

Are you referring to a php editor ?? If so Php Designer is a good tool to use. If your talking about browser add-ons then firebug and web developer for FF is great to use as well.

margarett

AFAIR it's a bit more complicated than that. You can use integrated developer tools like Zend *if* the target platform is/was built supported on said platforms. SMF isn't. SMF was built from scratch and its roots comes from before that.
Want to know what $context carries at some point? print_r/var_dump are your friends ;)

Browser developer tools cannot ever know what PHP is doing as they only see what the server sends them and that's one (or two) step after PHP was executed.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Matthew K.

You should be able to set breakpoints in any modern IDE such as PHPStorm (Mac, Windows, Linux) or PHP Designer (Windows)

Honestly though, even a lot of times at work, nothing beats: echo '<pre>', var_dump($context), '</pre>'; die();

margarett

Quote from: Labradoodle-360 on December 16, 2015, 06:51:13 PM
(...) nothing beats: echo '<pre>', var_dump($context), '</pre>'; die();
^^ What he said! (well, the die(); isn't strictly necessary :P )
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

jonesH

I get the picture. Back in the day, I used to do lots of Microsoft VB work and there were cool built-in helpers. Since PHP comes without, I was hoping to find a similar add-on for PHP.


Anyway, your replies give me direction. In general, I am little inclined to pay for software that I might in the end not even keep using, even aside from the required learning curve. I toyed around with var_dump and boy does it rock!


I also consider moving away from Safari/Chrome to FireFox and see if it offers better/more dev tools.


Thank you all. I will mark this as solved, but anyone is welcome to add to it.

Joshua Dickerson

Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

nend

Quote from: Labradoodle-360 on December 16, 2015, 06:51:13 PM
Honestly though, even a lot of times at work, nothing beats: echo '<pre>', var_dump($context), '</pre>'; die();
if (isset($_REQUEST['sidebug']) && $context['user']['is_admin']) {
$tmp = $GLOBALS;
$tmp['_SERVER'] = null;
$tmp['_ENV'] = null;
$tmp['db_passwd'] = null;
$tmp['db_user'] = null;
$tmp['db_name'] = null;
$tmp['db_name'] = null;
$tmp['db_prefix'] = null;
$tmp['smcFunc'] = null;
print_r($tmp);
die();
}

Check  :D

Advertisement: