private function reflashSource() { $getTime = json_decode(file_get_contents($GLOBALS['mypath'] . '/tmpfiles/jock_time.dat'), true); if (date('d', time()) != date('d', $getTime['gettedTime'])) { $mhand = new interfaceHandler($GLOBALS['weixinId']); $jock = $mhand->getByCurl('http://api.laifudao.com/open/xiaohua.json'); $jock = preg_replace('/\\,\\]$/', ']', $jock); file_put_contents($GLOBALS['mypath'] . '/tmpfiles/jock.dat', $jock); // wxlog('getJockOnline'); $temp = json_encode(array('gettedTime' => time())); file_put_contents($GLOBALS['mypath'] . '/tmpfiles/jock_time.dat', $temp); $this->initJokeNum($jock); } }
function getUnionId($openId, $weixinId = 0) { if ($GLOBALS['ready']) { $itfc = $GLOBALS['mInterface']; } else { $itfc = new interfaceHandler($weixinId); } $url = 'https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=' . $openId . '&lang=zh_CN'; $jsonData = $itfc->getByCurl($url); return json_decode($jsonData, true); }