Thanks, Thomas. I tried that but I got the same error: >> propel load 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/symfony/storage/sfSessionStorage.class.php on line 77
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/symfony/storage/sfSessionStorage.class.php on line 77 PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77 [sfException] Call to undefined method sfUser::getUserId Thomas Rabaix wrote: > 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 session_id() is not the best way to do it as sessions can > be handled by others "systems" > > Thomas > > > On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan > <[EMAIL PROTECTED]> wrote: >> 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 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()->getUser()) >>> { >>> return parent::save(); >>> } >>> >>> if ($this->isNew()) >>> { >>> $this->setCreatedBy($user->getUserId()); >>> } >>> >>> if ($this->isModified()) >>> { >>> $this->setUpdatedBy($user->getUserId()); >>> } >>> >>> parent::save(); >>> } >>> >>> ++ >>> >> -- >> Tom Haskins-Vaughan >> Temple Street Media: Design and Development for the Web >> [EMAIL PROTECTED] | www.templestreetmedia.com >> > > > -- Tom Haskins-Vaughan Temple Street Media: Design and Development for the Web [EMAIL PROTECTED] | www.templestreetmedia.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---