duanmibei1929 2012-01-06 13:34
浏览 33
已采纳

在MVC框架中处理cronjobs

At work we've developed our own MVC framework which provides us with as many as possible automated code-generation/handling. A few minutes ago I was talking with my collegue about how to handle cronjobs via a(ny) framework.

Basically we have cronjobs for:

  1. Mailing purposes
  2. Update procedures
  3. Garbage collection

What is your opinion/vision/best-practise on how to set up cronjobs? Is a cronjob just a PHP file using some controllers which use models to perform their tasks, or should a class be created for this?

In our opinion a cronjob is a procedure which needs controllers to do their work. What's your opinion?

  • 写回答

1条回答 默认 最新

  • douzhi19900102 2012-01-06 15:47
    关注

    As you've followed best design practice and coded all your business logic into your models, all you need is a new controller that can process commandline input and a simple view that just outputs the results to STDOUT.

    You did put all your business logic in your models, right? Cos if there's a lot of it in the controllers then you're in trouble ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64