value的形式 * * @return string */ public function key() { $list = Config::read(); //unset($list['manage']); return $list; } /** * set * * @return string */ public function set() { $config = $this->get(); $key = Input::get('key'); $index = Input::get('index', 'lang'); $value = Input::get('value'); Config::update($key, $index, $value); } /** * name * * @return string */ public function name($key) { $project = Config::load($key); if($project) { return $project['lang']; } else { return $key; } } /** * config * * @return string */ public function config($key) { $project = Config::load($key); if($project) { return $project; } else { return $key; } } /** * path * * @return string */ public function path($key) { $project = Config::load($key); if($project) { return $project['path']; } else { return $key; } } public function loop() { while(true) { $this->cron(); sleep(10); } } /** * cron * * @return string */ public function cron() { $time = time(); # 获取所有的计划任务 $data = Maze::load('manage/cron-get', array('where_ldate' => $time)); if($data) { # 比如属于weixin项目的group_list # weixin.mazephp.com/data.group_list foreach($data as $k => $v) { Maze::daemon($v['interface'], $v['project']); $param['where_id'] = $v['id']; $param['set_ldate'] = $time + $v['time']; if($v['time'] <= 0) { $param['set_state'] = 2; } Maze::load('manage/cron-update',$param); } } } }