Zen Cart Logo
Forums / General Questions / Best practice for finding out 'what does what'?

Best practice for finding out 'what does what'?

Locked

Views: 2,535

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
19 Aug 2007, 3:06 PM
#1
budfox avatar

budfox

Zen Follower

Join Date:
Aug 2006
Posts:
88
Plugin Contributions:
0

Best practice for finding out 'what does what'?

I'm not too bad with ZC now, gradually getting to grips with CSS and the whole overrides thing.

However, what trips me up all of the time is know which modules do what, or in other words, where a piece of code is being generated.

Is there a best practice, a plug-in, or any kind of method to nail down which piece of content was generated by which bit of code?

Obviously the filenames help, but there often quite a few to guess from.

I can use the developrs tool kit to find specific words and phrases of course, but I often end up typing in 'hello' and seeing where it turns up in the page :-(

Perhaps it's just about getting more experienced, but I can believe one does that by guessing and bumbling along.

Any help gratefull received.

Thanks
Steve

https://www.in-the-spirit-shop.co.uk
https://www.wheredidyougetit.co.uk
https://www.towertothepeople.co.uk

19 Aug 2007, 3:09 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Best practice for finding out 'what does what'?

No magic bullet I'm afraid. One just follows the flow of the code and over time builds up a feel for what type of files do what (not 100% consistent but heading that way).

19 Aug 2007, 4:04 PM
#3
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Best practice for finding out 'what does what'?

One suggestion here I can give is to have some site wide flag as Debug=Tru or False and in case its True, which all files are getting called on any page(site or admin) should be shown at the boom
Just my two cents!

19 Aug 2007, 4:31 PM
#4
budfox avatar

budfox

Zen Follower

Join Date:
Aug 2006
Posts:
88
Plugin Contributions:
0

Re: Best practice for finding out 'what does what'?

superprg:

One suggestion here I can give is to have some site wide flag as Debug=Tru or False and in case its True, which all files are getting called on any page(site or admin) should be shown at the boom
Just my two cents!

Could you give an example of that please. A little beyond me but it sounds like it might help.

19 Aug 2007, 4:50 PM
#5
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Best practice for finding out 'what does what'?

I will post an example when I get
I can see that in my application in ASP.NET shop
where I have this option to set it to Debug mode as ON and then I am gettting list of all the files getting called to render this page along with the variables which are getting used in the entire page generation

19 Aug 2007, 6:01 PM
#6
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Best practice for finding out 'what does what'?

PHP itself includes a lot of help functions.

To show al included files for example you can use get-included-files():
http://us.php.net/manual/en/function.get-included-files.php

Also printing (i.e. using print_r()) super globals often helps debugging (http://nl3.php.net/manual/en/language.variables.predefined.php#language.variables.superglobals) or all contants (http://us.php.net/manual/en/function.get-defined-constants.php).