NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
setting up debugging : htaccess:rewrite and MVC architecture


Joined: 08 Oct 2010
Posts: 10
Reply with quote
I am new to PHPed, and love a number of the features.
I am developing withe SilverStripe, a MVC based framework with integrated CMS.
My site is setup for local development, using a Xampp setup.
Within PHPed everything is working other than breakpoints and other debugging features.
I can click to run debugging, it opens the default load page (as set in the project settings) 'index.php' with a debug var set after.
My htaccess, rewrites the path to the site root (removes the index.php) and the variable.
The page is then displayed and I can navigate the site to where I would expect the breakpoint to be triggered, but nothing.
I imagine this is due to the rewrite of the url without the debug var.

Does anyone know how I can work around this, or has dealt with a similar issue?
currently, leaving the index.php on the url causes another issue with links withing the framework... I don't have any more ideas at the moment..
Help would be greatly appreciated!
View user's profileFind all posts by DsXSend private message


Joined: 27 Aug 2008
Posts: 25
Reply with quote
First step: make sure the dbg module is enabled (you can see it with a phpinfo() call) - something like this should be in there

Code:

Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with DBG v3.9.6, (C) 2000,2010, by Dmitri Dmitrienko


Once you have dbg installed you should be set to go. I usually use the project wizard to make sure everything is setup correctly.
View user's profileFind all posts by BoxieSend private message


Joined: 08 Oct 2010
Posts: 10
Reply with quote
I have the debugger setup, and it runs, but I can't for the life of me get to my breakpoint.
I know that the code that I have my breakpoint on is being run because the browser opens to the page where the ouput is.

I have run it with stop at first line enabled, this brings me into the bebugger, if I step through the code (takes a while since its a mvc framework) I should see my breakpoint at some point, but haven't yet (maybe I stepped past it, but I shouldn't be able to should I?). If I disable the stop on first line, it runs right through and loads the webpage. My log says the debug session has started and stop a number of times before the webpage is loaded.

How do I get the debugger to stop at and bring up the debug tabs when it reaches my breakpoint?

ps: I have tested further and can get a breakpoint in my index.php to trigger a stop, as well as a few others.
So it would appear that its a matter of the debugger not following all code execution through. The php page I want to debug contains a method that is called by a tag in a .ss file, this is a silverstripe specific template file. The method is used as a markup tag in the template but is run as php (making a sql query and more) so I would hope that I could debug it, but no matter what I try I can't seem to have a breakpoint in this method appear. Somethings else worth noting is that the same php file is called by another to run its init, while stepping through I can see this happen, and can even see the method I would like to debug but never actually get back to it.
View user's profileFind all posts by DsXSend private message


Joined: 08 Oct 2010
Posts: 10
Reply with quote
well.... still having trouble getting to breakpoint directly in the IDE, some will other won't. (its a matter of the session ending and starting all the time?)

That said , I get what I need by using the IE embedded browser and the PHPed plugin.. I can click to open with debug, navigate the output tab to the page I need and right click and select debug with PHPed and all is well.
View user's profileFind all posts by DsXSend private message
setting up debugging : htaccess:rewrite and MVC architecture
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic