后台程序执行统一规范
来自技术开发小组内部wiki
为了加强后台执行程序的管理,方便调取已经存在的各种模型,现规范统一的后台执行环境
后台程序统一放置到fmb.dianping的代码目录中
fmb.dianping/application/controllers/cmdrun
后台程序的编写方式
<source lang="php"> //该语句必须包含 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); //必须加载该系统类 require_once(APPPATH."controllers/cmdrun/system.php");
//自己编写的类从System继承过来
class test extends System{
public function __construct(){ parent::__construct(); }
public function test2(){ echo "test\n"; } } </source>
后台程序的代码执行方式
<source lang="php"> php index.php test[执行环境] cmdrun[固定目录] test[控制器] test2[方法名] </source>