I am an autodidact so dont know much about conventional web development however, I have wrote a complete social networking website yet I dont know how to debug. My website has some problems and I need to learn de开发者_开发问答buggin things around/
First of all I need instructions how to install Xdebug on WAMP (since I use phpDesigner). I tried a lot using tutorials on the web everytime I get a new error. I also tried puting it in the /ext/ directory and activating it from the WAMP PHP Extensions menu. Doesnt Work!
So if anyone odf you out there uses PHPDesigner with Xdebug (not the package that comes along, rather install it on WAMP) please help me and I would really be grateful. BTW PHP version is 5.3.0
Next thing is this is how is the the control flow of my website :-
htaccess -> redirect everything to index.php if file doesn't exist.
index.php ->
include all libraries (__autoload).
initialize classes.
Get the $_SERVER['REQUEST_URI'] to get the $page.
If $page is found
Check if the user is logged in,
if yes then include view/$page.php
or else redirect to login.php page
If page is not found then
redirect to 404.php
Is this control flow good for debugging? because I really cant understand the real MVC concept so I created something like this.
There is a tutorial for installing XDebug for use with phpDesigner here.
MVC is an organizing principle (also called a "design pattern"). It can be helpful keeping logically similar parts of a project together, and encouraging clean interfaces between them, but—especially for low complexity projects—strict MVC modeling isn't always an improvement.
You ask:
Is this control flow good for debugging?
Debugging is to identify flaws in programs. Writing a program to be easy to debug is like intentionally driving a car off the left side of the road so you'll know where to direct an ambulance to find you. Granted—there are small things which can be done to greatly improve debugability. But the point is to architect any control structure so it naturally expresses the algorithm. By doing that, it is far more likely to avoid the need to debug. Anything you can do to write correctly functioning code is justifiable.
Your control flow is clear to me. I wouldn't have any qualms about working on it.
Use xDebug.
Its very easy to install and use. and you can download xDebug from here http://www.xdebug.org/
step by step tutorial for setup xdebug with WAMP is available at sachithsays.blogspot.com/
精彩评论