2010-04-07 49 views
0

我想加载灯具,但我的项目在CLI错误并启动索引器进程。推进负载数据导致错误

我曾尝试:

  • 重建架构和模型
  • 清空数据库,并再次启动
  • 清除缓存
  • 验证YML文件,并试图更简单的数据转储

我的平台是Windows上的Symfony 1.0

一些似乎也有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

这个错误在那里是一个问题,我重写保存在模型方法之一所致。

的错误导致propel-load-data打破

1

会话东西不应该被触发的CLI任务(在逻辑上,使用CLI当你不作出sfWebRequest)这样的东西在你的代码是使一个假设。我想你正试图在对象的save()方法中使用会话存储或某些实例sfContext来做些事情 - 如果你需要这样做,总是在你的动作中做,而不是模型。

1

只是在symfony的1.4任务信息, 我有同样的消息 和我的解决办法是那些线搬回到标准任务execute()方法:

// 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); 

我搬到他们另一种方法之前,即使该方法被execute()调用,我仍然会有警告。感谢Raise提示。

保重!