views:

134

answers:

3

I am trying to load fixtures but myproject is erroring at the CLI and starting the indexer process.

I have tried:

  • Rebuilding the schema and model
  • Emptying the database and starting again
  • Clearing the cache
  • Validating the YML file and trying much simpler data-dumps

My platform is Symfony 1.0 on Windows

Some also seems to have had the same issue in the past.

C:\web\my_project>symfony propel-load-data backend   
>> propel    load data from "C:\web\my_project\data\fixtures"

PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at C:\php\PEAR\symfony\vendor\pake\pakeFunction.php:366) in C:\php\PEAR\symfony\storage\sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\php\PEAR\symfony\vendor\pake\pakeFunction.php:366) in C:\php\PEAR\symfony\storage\sfSessionStorage.class.php on line 77

PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at C:\php\PEAR\symfony\vendor\pake\pakeFunction.php:366) in C:\php\PEAR\symfony\storage\sfSessionStorage.class.php on
line 77

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\php\PEAR\symfony\vendor\pake\pakeFunction.php:366) in C:\php\PEAR\symfony\storage\sfSessionStorage.class.php on line
77
+1  A: 

This error was due to there being a problem with one of my overridden save methods in the model.

The error causes propel-load-data to break

Jon Winstanley
+1  A: 

Session stuff shouldn't be triggered for a CLI task (logically, you're not making a sfWebRequest when using the CLI) so something in your code is making an assumption. I imagine you're trying to do something with session storage or something that instances sfContext from within the save() method of an object - if you need to do something like that, always do it in your action, not the model.

Raise
+1  A: 

hello, just for info, in a symfony 1.4 task I had the same messages and my solution was to move those lines back into the standard task execute() method:

// the following 2 lines need absolutely to stay in execute() to prevent 
$configuration = ProjectConfiguration::getApplicationConfiguration(
$this->options['application'],
$this->options['env'],
false
);
sfContext::createInstance($configuration);

I had moved them in another method before, even though that method was called by execute() I would still have the warnings. Thanks to Raise for the tip.

take care !

Jonathan-David Schröder