自动化任务处理与报表生成实战
1. 任务处理脚本搭建
在构建任务调度系统时,我们需要创建一个能在 Yii 应用上下文中运行的任务处理脚本。以下是具体步骤:
1. 创建项目目录 :在 ch7 | Source Files | protected 中右键选择 New | Folder ,输入 utils ,用于存放任务相关脚本。
2. 创建自定义 Yii 入口脚本 :在 utils 目录下创建 job_entry.php 文件,代码如下:
<?php
// change the following paths if necessary
$yii='/opt/lampp/htdocs/yii/framework/yii.php';
$config=dirname(__FILE__).'/../config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be
//shown in each log message
defined('YII_TRACE_LEVEL') or
d
超级会员免费看
订阅专栏 解锁全文
2957

被折叠的 条评论
为什么被折叠?



