推进加载数据导致错误

发布于 2024-08-28 03:17:22 字数 1369 浏览 7 评论 0原文

我正在尝试加载固定装置,但 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

森林散布 2024-09-04 03:17:22

此错误是由于模型中我重写的保存方法之一存在问题所致。

该错误导致 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 break

青柠芒果 2024-09-04 03:17:22

CLI 任务不应该触发会话内容(从逻辑上讲,使用 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.

花开雨落又逢春i 2024-09-04 03:17:22

仅供参考,
在 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 的提示。

小心 !

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 !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文