0) { $wechat = new Wechat($send['i'], $send['a']); $param = array(); if (!isset($send['p'])) { $send['p'] = false; } if ($send['s']) { $param = Dever::load($send['a'] . '/' . $send['s'], $send['p']); } if (isset($param['run_num']) && $param['run_num'] > 1) { for ($i = 1; $i <= $param['run_num']; $i++) { $result = $wechat->curl($send['t'], $param, false); if ($send['e']) { Dever::load($send['a'] . '/' . $send['e'], $send['i'], $result, $send['p']); } } if ($send['e']) { Dever::load($send['a'] . '/' . $send['e'], $send['i'], $result, $send['p'], true); } } else { $result = $wechat->curl($send['t'], $param, false); if ($send['e']) { Dever::load($send['a'] . '/' . $send['e'], $send['i'], $result, $send['p']); if (isset($param['run_num'])) { Dever::load($send['a'] . '/' . $send['e'], $send['i'], $result, $send['p'], true); } } } return $result; } return array(); } class Core { static public function run($id, $method, $start, $end, $app, $param = false, $state = false) { $send = array(); $send['i'] = $id; $send['t'] = $method; $send['s'] = $start; $send['e'] = $end; $send['a'] = $app; $send['p'] = $param; if ($state == false) { $result = Dever::daemon(self::url($send), 'main'); } else { $result = callAction($send); } return $result; } static public function url($send) { $send = base64_encode(json_encode($send)); $url = 'lib/core.call?param=' . $send; return $url; } public function call_api() { $send = json_decode(base64_decode(Dever::input('param')), true); $result = callAction($send); if (isset($result)) { print_r($result); die; } return; } }