1

im trying to debug a symfony app.

I've added a debug_backtrace() calling to this function below. It outputs a list of functions called, but the save() function (that is just before the debug_backtrace() calling) is not that list.. why? any other way to debug that shows more things, in this case the save() calling ?

protected function processForm(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()));

    if ($form->isValid())
    {

      $sf_guard_user = $form->save();

      var_dump(debug_backtrace());
     die("fsdgsgsdf");

      $this->redirect('guardausuario/edit?id='.$sf_guard_user-
>getId());

    }
  } 

Regards

Javi

tirenweb
  • 30,963
  • 73
  • 183
  • 303
  • What is it exactly that you're having a problem with, that you feel you need to debug? Or does everything just work and you're curious :-) – richsage Apr 01 '10 at 22:28

3 Answers3

3

I've just got my target using

xdebug_start_trace('/tmp/foo');
$usuario = $form->save();
xdebug_stop_trace();

http://www.xdebug.org/docs/all_functions

Javi

tirenweb
  • 30,963
  • 73
  • 183
  • 303
1

Symfony's web developer bar has some great information.

What exactly are you trying to see? Somethings it is good to echo $form because it will reveal all of the fields and any hidden fields in the form. Also, remember to include [_csrf_token] in your View if you are writing a custom View.

And... Symfony and xDebug are a good combination.

Christopher Altman
  • 4,868
  • 2
  • 33
  • 49
0

In php.net (http://php.net/manual/es/function.debug-print-backtrace.php) bishop exposes this solution:

$e = new Exception();
$e->getTraceAsString();

It gives a short but concise response for all the functions being called. It perfectly suited my needs, so I can log what happened without being lost.

Stranger
  • 10,332
  • 18
  • 78
  • 115
Samuel Vicent
  • 991
  • 10
  • 16