【发布时间】:2012-07-23 11:44:15
【问题描述】:
有什么方法可以在 CakePHP 中捕获 shell 的输出吗?
我编写了一些 shell 来为 CakePHP 2.x 应用程序生成报告。我可以在命令行上运行 shell 并查看输出,但是,现在我想通过电子邮件发送这些 shell 的结果。
我曾考虑使用另一个 shell 作为包装器,然后使用 $this->dispatchShell('shellname') 捕获其输出,但似乎 dispatchShell 只是运行 shell 并将其输出转储到 CLI。
【问题讨论】:
-
刚刚再次测试,它接受来自报告 shell 的 main 方法的返回值,而不是 $this->out 内容。
标签: cakephp cakephp-2.0