推进加载数据导致错误
我正在尝试加载固定装置,但 myproject 在 CLI 上出错并启动索引器进程。
我尝试过:
- 重建架构和模型
- 清空数据库并重新开始
- 清除缓存
- 验证 YML 文件并尝试更简单的数据转储
我的平台是 Windows 上的 Symfony 1.0
有些似乎也有 过去有过同样的问题。
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此错误是由于模型中我重写的保存方法之一存在问题所致。
该错误导致
propel-load-data
中断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 breakCLI 任务不应该触发会话内容(从逻辑上讲,使用 CLI 时您不会发出 sfWebRequest),因此代码中的某些内容正在做出假设。我想您正在尝试使用会话存储或从对象的 save() 方法中实例化 sfContext 来执行某些操作 - 如果您需要执行类似的操作,始终在您的操作中执行此操作,而不是模型。
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.
仅供参考,
在 symfony 1.4 任务中我收到了相同的消息
我的解决方案是将这些行移回到标准任务execute()方法中:
我之前已将它们移到另一个方法中,即使该方法是由execute()调用的,我仍然会收到警告。感谢 Raise 的提示。
小心 !
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:
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 !