[symfony-users] Re: How to get user object on libs to not get the erro The default context does not exist.

2010-02-22 Thread Nei Rauni Santos
I had to change this function to work both on functional test and unit test. public static function getUser(){ if( ! sfContext::hasInstance() ){ $configuration = sfApplicationConfiguration::getApplicationConfiguration( sfConfig::get('sf_app') ); $context =

[symfony-users] Re: How to get user object on libs to not get the erro The default context does not exist.

2010-02-22 Thread lawrence
On Feb 19, 12:08 pm, Nei Rauni Santos nra...@gmail.com wrote: It worked for me, do you think it's a good solution? ?php class tools {   /*    * This code is used to allow get the user object on sf 1.3    * I usually used to $sf_user = sfContext::getInstance()-getUser();    * but it

[symfony-users] Re: How to get user object on libs to not get the erro The default context does not exist.

2010-02-19 Thread Nei Rauni Santos
It worked for me, do you think it's a good solution? ?php class tools { /* * This code is used to allow get the user object on sf 1.3 * I usually used to $sf_user = sfContext::getInstance()-getUser(); * but it throw exception with the message: The default context does not exist. *

[symfony-users] Re: How to get user object on libs to not get the erro The default context does not exist.

2010-02-19 Thread rooster (Russ)
This is not a good solution as your libs will be referencing the context you create, and not the singleton that is running your app. It may seem to work, since the configuration will be identical - but it's really not a good solution. You have 2 options in my opinion. 1. Dirty: Create an