NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] CakePHP Debugging


Joined: 06 Jun 2007
Posts: 5
Reply with quote
It's great to see a 'how-to' for phped debugging within the CakePHP environment. I'd posted a question last year and essentially got the old rtfm response. Perhaps justified, but I'd stopped using phped until this morning when I received the how-to email.

I've downloaded and installed the latest version and I must admit it's quite improved from the earlier version I used, but.... I'm still having the same problem from last year. So under the heading of 'hope springs eternal', I thought I'd give this one more try.

To summarize the problem: my 'Root Directory' and 'Remote root directory' is one level below the main sources that I need to debug. I can open those files and view them, I can set a breakpoint and run the app from the root directory index.php, and the app runs fine, but I never hit the breakpoint since the to the file is outside the open workspace.

Now I'm sure there's a way to map or include this parent directory and its files, but I've culled through the NuSphere Forums, tried many different settings within phped but alas, no combination seems to work for me.

I'd like to continue using phped (read that buy the update) - I'd grown accustom to its features on a previous project (before cake) and know just how much it can speed my development and debugging. But right now, I'm dead in the water.

Thanks in advance!

tdodev
View user's profileFind all posts by tdodevSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
Hi tdodev, thanks for posting again. I'll do my best to help. Can you do us a big favor and just post the tree of your files here (e.g. screenshot) as well as your project properties? One sneaky trick, btw, that works for me all the time ( and I am not saying that is the best or even right way of doing it, but still): put the call to DebugBreak() instead of the breakpoint in your file outside of the workspace. No,no, once again - I am not saying this is the solution, it is just what I do when I get too lazy. You know there is a story about a boy who got a hummer as a gift - and everything became a nail after that Smile
Thanks.
View user's profileFind all posts by yfaktorSend private message


Joined: 06 Jun 2007
Posts: 5
Reply with quote
Hi yfaktor,

Thanks for your time to reply and offer of help. My apologies for my delay on this response. There are two configurations that appear, to me, to be mutually exclusive - one allows me to see and access the various project files but won't run in a web environment, the other allows me to run in a web environment but doesn't allow me to set breakpoints in the files. Argh....

I'm sure I'm missing something fundamental but I've read, and re-read these forums, help, and the latest cake tutorial with no luck.

Here is the screen shot you'd requested:



Cake files are organized in parallel directories. The apache docroot is in webroot, while the mvc (model, view, controller) files are all in parallel directories to webroot. So setting the root directory in the project properties allows me to run the application, but no debugging, and when I set it to the parent directory, I can see the files, but it won't run. Does that make sense?

Thanks again for your offer of help!

tdodev
View user's profileFind all posts by tdodevSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
indeed, there are two possible ways to organize your project.

1st one is what you submitted with the screenshot. In this case all your model and other files aren't in the project. If you need them to be parsed and shown in the code completion, just add the directories into "Code Insight Includes" list.

2nd one is below:
-make the project root one level upper (c:\apache\htdocs\cake\transparent)
-make the root URL empty (b'ze no URLs correspond to the project root directory)
-update remote root to be the same as project's root directory
-add an additional mapping entry on the Mappings page:
=root directory c:\apache\htdocs\cake\transparent\webroot
=URL http://localhost/
=remote root c:\apache\htdocs\cake\transparent\webroot

whenever you work with local Apache, please keep REMOTE ROOT == PROJECT ROOT DIRECTORY, otherwise breakpoint may not work.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 06 Jun 2007
Posts: 5
Reply with quote
Dmitri,

This would be an extremely valuable addition to your Cake how-to. It would have saved me (and possibly others) a tremendous amount of frustration.

Mostly arising from using your tools on earlier projects and not being able to use them on cake projects.

But what I really want to know is, how did you go back to 2003 to answer this question? I don't think Cake was very well baked back then.

tdodev
View user's profileFind all posts by tdodevSend private message


Joined: 05 May 2008
Posts: 36
Reply with quote
http://forum.nusphere.com/howto-setup-project-with-scripts-located-out-of-web-tree-t646.html

This link in Mini-FAQ is very useful if u want setup custom project Smile
View user's profileFind all posts by VodochnikSend private messageICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
how did you go back to 2003 to answer this question?

The answer is very simple, it's forum was created in this year and I joined it.
Whan the post was created is shown there:
Posted: 14 Apr 2008 11:42 pm Post subject: [resolved] CakePHP Debugging

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
[resolved] CakePHP Debugging
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