O'Reilly logo

Yii Rapid Application Development Hotshot by James R. Hamilton III, Lauren J. O'Meara

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Job Processing

In this task, we will create a simple job consumption script. We will use cron to run the script every so often. When it runs, it will query for jobs that need to run in this time frame, queue them up, execute them, and record the results. We want the jobs to run within the context of Yii, because we want to:

  • Use the same database configuration as our web application
  • Take advantage of Yii's libraries, primarily the database access utilities

To do this, our job processing script will be written as a Yii command, like the RBAC command we used in Project 4, Level Up! Permission Levels.

Engage Thrusters

  1. Create a project directory named utils. Right-click on ch7 | Source Files | protected, select New | Folder, and enter utils. We ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required