带有表达式引擎 2 的 Cron 作业?
我正在开发一个表达式引擎网站。该站点有一个由外部提要填充的数据库表,并且该提要每天需要解析两次。
显然, cron 作业似乎很适合这个,但我苦苦挣扎的是,我应该把代码放在哪里?我想使用 EE 框架,并让 cron 作业命中 URL,但我真的不想创建一个模板只是为了将一些表达式引擎模板标签放入其中以运行操作。
是否有另一种方法来创建可以使用表达式引擎核心的脚本,但不必为其创建模板和模板标记?
I'm developing an Expression Engine site. The site has a database table populated from an external feed, and this feed needs to be parsed twice daily.
Obviously, a cron job seems a good fit for this, but where I'm struggling is, where do I put the code for this? I want to use the EE framework, and have the cron job hit a URL, but I don't really want to create a template just to drop some Expression Engine template tags into in order to run an action.
Is there an alternative way to create a script that I can use the Expression Engine core, but not have to create a template and template tag for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
EE 没有可以连接的内部伪 cron 进程,但有一个 第一方添加-on 就可以解决问题。问题是,它需要传递一个插件方法或模块类和模块方法,而不是 URL。因此,您必须编写一个快速插件,在执行时通过 cURL 或其他方法调用您的操作 URL。
在商业方面,有一个 35 美元的Automat:ee 模块,可以 在模拟的 cron 作业中点击 URL。
EE doesn't have an internal faux-cron process you can hook into, but there is a first-party add-on that can do the trick. The thing is, it requires a plugin method or module class and module method be passed to it, not a URL. So, you'd have to write a quick plugin that, when executed, calls your action URL via cURL or what-have-you.
On the commercial side, there's the $35 Automat:ee module that can hit a URL in a simulated cron job.