function get_access_token() { $token = QMC::read("token"); if (!$token) { $authurl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxee6c914fca02f4dd&secret=1d0fe2e4f06a42caf289ab817a56d331"; $html = file_get_contents($authurl); $obj = json_decode($html); $token = $obj->access_token; $time = $obj->expires_in; QMC::store("token", $token, $time - 60); } return $token; }
private function regHandler($user, $devid) { # code... include './qmc.php'; QMC::store($devid, array($user)); }