2010-04-07 48 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提示。

保重!