Search code examples
symfony1

Symfony: question about a piece of code of sfDoctrineGuardPlugin


there is this code below in sfDoctrineGuardPlugin.

$a = sfConfig::get('app_sf_guard_plugin_success_signin_url');

var_dump($a);

$signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url', $user->getReferer($request->getReferer()));

var_dump($signinUrl);

var_dump($user->getReferer($request->getReferer()));

It prints this:

null

string 'http://rs3.localhost/frontend_dev.php/' (length=38)

string 'http://rs3.localhost/frontend_dev.php/miembros' (length=46)

I don't know why the the second and the third lines are different..any idea?

Regards

Javi


Solution

  • Weird. Spooky.

    I wonder if maybe the two calls to getReferer() are in different contexts? Maybe the first (as the second arg to sfConfig::get()) implicitly uses __toString() whereas when you use var_dump(), maybe it's printing the raw value of the referer object?

    Hrmm... the API says getReferer() returns a string, so that's probably not it.

    What are you trying to do, BTW? Is it not honoring your app_sf_guard_plugin_success_signin_url setting from app.yml?