带有表达式引擎 2 的 Cron 作业?

发布于 2024-12-22 10:33:30 字数 219 浏览 4 评论 0原文

我正在开发一个表达式引擎网站。该站点有一个由外部提要填充的数据库表,并且该提要每天需要解析两次。

显然, 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 技术交流群。

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

发布评论

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

评论(1

娇柔作态 2024-12-29 10:33:30

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.

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