【问题标题】:cakephp - Call shell from componentcakephp - 从组件调用 shell
【发布时间】:2014-04-03 11:44:02
【问题描述】:

如何从我的组件调用 shell。

这是我的外壳

<?php 
   class PrintShell extends AppShell {

    function main()
    {
        App::import(‘Component’, ‘BusinessLogic’);
        $businessLogic = & new BusinessLogicComponent();
        $businessLogic->initialize();
        $settings = $businessLogic->senReminderEmail();
        // senReminderEmail Mail function is defined in my Controller/Components/BusinessLogicComponent.php File
    }

}
?>

我不希望它使用命令来调用。 我该怎么做。任何帮助 这有意义吗?

【问题讨论】:

  • 这是什么意思? “从我的组件调用外壳”。 Shell 用于 cronjob 内容或您希望通过控制台而不是组件运行的任何操作。你想让我做什么?不给我场景..
  • 你不能直接从前面运行shell。

标签: php shell cakephp


【解决方案1】:

你想调用 shell 我想,你想在 cakephp 中使用 cron 作业吗? 大多数 appshell 曾经与 cron 作业一起工作,我也遇到过这个问题,我没有使用过 appshell 我从 godaddy 服务器设置了我的 cron 作业,并将所有文件放在 webroot 文件夹中,该文件夹可能在 cron 时间内运行,所以我刚刚验证了..亲爱的..

【讨论】:

  • 是回答还是其他问题?
  • 我不想要一个 cron 工作。我想从我的组件中运行命令。我该怎么做。我不知道这是否有意义。请感谢任何其他替代解决方案
猜你喜欢
  • 2013-08-23
  • 2012-12-07
  • 1970-01-01
  • 2013-06-01
  • 2023-03-28
  • 1970-01-01
  • 2011-06-24
  • 1970-01-01
  • 2011-09-18
相关资源
最近更新 更多