[symfony-users] Re: propel-load-data

2008-05-22 Thread Tom Haskins-Vaughan
Thanks, Nicholas. That works like a charm! Nicolas Perriault wrote: > 2008/5/22 Tom Haskins-Vaughan <[EMAIL PROTECTED]>: > >> When I do this, I don;t get any warnings like before, but I get a >> sfException: >> >> [sfException] >> Call to undefined method sfUser::getUserId > > That's normal

[symfony-users] Re: propel-load-data

2008-05-21 Thread Nicolas Perriault
2008/5/22 Tom Haskins-Vaughan <[EMAIL PROTECTED]>: > When I do this, I don;t get any warnings like before, but I get a > sfException: > > [sfException] > Call to undefined method sfUser::getUserId That's normal, as you have no session then no currently connected user id (the thing sfUser::ge

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
OK, I'm getting closer. I think I may have an older version of symfony (1.0.12) so the following seems to work: symfony propel-load-data frontend cli data/fixtures/import_data.yml When I do this, I don;t get any warnings like before, but I get a sfException: [sfException] Call to unde

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
Thanks, Thomas. I've tried both of the following: symfony propel-load-data --env=cli frontend symfony propel-load-data --env='cli' frontend And when I call die(SF_ENVIRONMENT); in my save() method it still returns 'dev'. Any suggestions? Thomas Rabaix wrote: > When you call sfContect::getIns

[symfony-users] Re: propel-load-data

2008-05-21 Thread Thomas Rabaix
When you call sfContect::getInstance() all the factories are loaded. So the session storage too. Your session storage uses the sfSessionStorage with the auto_start = true. That's why you get the error : "Warning: session_start(): Cannot send session cookie" When you run the propel-load-data, try

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
Thanks, Nicholas. I think the problem is, whenever I try to access sfContext::getInstance() even to see if it exists, it tries to start a session. Maybe I'm wrong though. Here's the error: >> propelload data from "/home/projects/...inah-2.0/symfony/data/fixtures" PHP Warning: session_sta

[symfony-users] Re: propel-load-data

2008-05-21 Thread Nicolas Perriault
2008/5/21 Tom Haskins-Vaughan <[EMAIL PROTECTED]>: > Thanks Nicholas, but you've gone a little over my head. Can you let me > know how to do that? In your save action, at the beginning: if (!sfContext::getInstance()->getStorage() instanceof sfSessionStorage) { return parent::save();

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
Thanks Nicholas, but you've gone a little over my head. Can you let me know how to do that? Nicolas Perriault wrote: > 2008/5/21 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > >> I'm not sure but I think a user always exists, but it's not the same >> instance depending on the context (web or cli). >

[symfony-users] Re: propel-load-data

2008-05-21 Thread Nicolas Perriault
2008/5/21 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > I'm not sure but I think a user always exists, but it's not the same > instance depending on the context (web or cli). True, you should check via instanceof the type of session storage class, eg if you detect something like sfNoStorage, dont cha

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
Thanks for your help, let me know if this means anything to you: >> propelload data from "/home/projects/...inah-2.0/symfony/data/fixtures" PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /usr/share/pear/symfony/vendor/pake/pakeFuncti

[symfony-users] Re: propel-load-data

2008-05-21 Thread [EMAIL PROTECTED]
Please try to add this at the beginning of your save() method and tell us what's displayed when used with CLI (in propel-load-data for example) : $class = get_class(sfContext::getInstance()->getUser(); for ($classes[] = $class; $class = get_parent_class($class); $classes[] = $class); print_r($cla

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
Yeah, I noticed that. I tried clear-cache but it didn't make any difference. Thomas Rabaix wrote: > Hello, > > It look like the factorie settings are ignored. The error refers to > 'sfSessionStorage', however the session handler should by > 'sfSessionTestStorafe' > > Thomas > > On Wed, May 21,

[symfony-users] Re: propel-load-data

2008-05-21 Thread Thomas Rabaix
Hello, It look like the factorie settings are ignored. The error refers to 'sfSessionStorage', however the session handler should by 'sfSessionTestStorafe' Thomas On Wed, May 21, 2008 at 6:47 PM, Tom Haskins-Vaughan <[EMAIL PROTECTED]> wrote: > > Thanks, Thomas. I tried that but I got the same

[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan
Thanks, Thomas. I tried that but I got the same error: >> propelload data from "/home/projects/...inah-2.0/symfony/data/fixtures" PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366

[symfony-users] Re: propel-load-data

2008-05-21 Thread Thomas Rabaix
Hello, I am not sure at 100% about what I am going to say : - sfSessionStorage start the session when you access to the user - The command line uses the 'cli' env configuration - You have to change the cli factories to use the sfSessionTestStorage, which do not used php session. The use of se

[symfony-users] Re: propel-load-data

2008-05-20 Thread Tom Haskins-Vaughan
If I change the first if statement to the following it works fine: if (!session_id()) { return parent::save(); } Am I going to cause any problems with symfony doing it like this? Nicolas Perriault wrote: > 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>: > >> Everything works fine, except

[symfony-users] Re: propel-load-data

2008-05-20 Thread Tom Haskins-Vaughan
Thanks, Nicolas. But I get: >> propelload data from "/home/projects/...inah-2.0/symfony/data/fixtures" PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in /usr/share/pear/symfo

[symfony-users] Re: propel-load-data

2008-05-20 Thread Nicolas Perriault
2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>: > Everything works fine, except when I run the propel-load-data task, > because of course there is no session. I may be missing the point but here's what I'd do: public function save($con = null) { if (!$user = sfContext::getInstance()-