开发者

Propel-load-data is causing an error

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\sy开发者_开发问答mfony\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


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


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.


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 !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜