您如何在 Zend Framework 中存储 cron 作业的脚本?

2021-12-29 00:00:00 cron php zend-framework

因为 ZF 的所有 URL 都依赖于 mod 重写,所以我不太清楚应该在哪里存储本地脚本以用于 cron 作业.

Because ZF depends on mod rewrite for all it's URLs, it's not immediately apparent to me where I should store local scripts for use with a cron job.

有没有人有任何建议,或者有官方接受"的方式吗?

Does anyone have any recommendations, or is there an "officially accepted" way?

推荐答案

我使用 模块化目录结构 在我的网站设计中,以便我为我网站的每个单独模块创建控制器、视图等.每个模块中都有一个脚本(或 cron)目录,用于存储该特定模块的所有 cron 脚本.

I use the Modular Directory Structure in the design of my websites so that I have controllers, views, etc created for each separate module of my websites. Included within each module I have a scripts (or a cron) directory that stores all of the cron scripts for that particular module.

我个人发现,在从 Zend Framework 和实际 Web 应用程序访问资源时,这使事情变得简单.

Personally I find that this keeps things simple when it comes to access resources from Zend Framework as well as from the actual web application.

相关文章