protected static function setResource($resource) { if (empty($resource)) { return false; } self::$resource = $resource; }
private static function _yibanLinkin() { session_start(); if (isset($_SESSION['openid'])) { return true; } if (isset($_GET['openid'])) { $_SESSION['openid'] = $_GET['openid']; $resource['openid'] = $_GET['openid']; parent::setResource($resource); return true; } header("Location:http://q.yiban.cn/app/index/appid/1530"); return false; }
public static function run($exception) { $log = 'file[' . $exception->getFile() . '] '; $log .= 'line[' . $exception->getLine() . '] '; $log .= 'message[' . $exception->getMessage() . '] '; Vera_Log::addErr($log); $resource = parent::getResource(); if ($resource === NULL) { $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; $resource = (array) simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); } $msg = $exception->getMessage(); $errMsg = empty($msg) ? parent::$commonConf['errMsg'] : $msg; $ret = "<xml>\n \t\t <ToUserName><![CDATA[" . $resource['FromUserName'] . "]]></ToUserName>\n \t\t <FromUserName><![CDATA[" . $resource['ToUserName'] . "]]></FromUserName>\n \t\t <CreateTime>" . time() . "</CreateTime>\n \t\t <MsgType><![CDATA[text]]></MsgType>\n \t\t <Content><![CDATA[" . $errMsg . "]]></Content>\n \t\t</xml>"; echo $ret; exit; }
public static function run() { return true; session_start(); if (ACTION_NAME == 'Test') { return true; } // @temp: 网络文化节抽奖页面无条件通过 if (ACTION_NAME == 'Luck' || ACTION_NAME == 'Api_Luck' || ACTION_NAME == 'Data' || ACTION_NAME == 'Api_Data' || ACTION_NAME == 'Rank') { return true; } if (in_array(ACTION_NAME, self::$passList) && isset($_SESSION['culture'])) { return true; } if (!isset($_SESSION['num'])) { return false; } $resource = array('num' => $_SESSION['num']); parent::setResource($resource); Vera_Log::addNotice('name', $_SESSION['num']); //http://blog.csdn.net/cityice/article/details/9427035 //session文件锁的问题导致并发长轮询页面挂起,并附带整个网站无响应 session_write_close(); switch (ACTION_NAME) { case 'Api_Token': case 'Api_Act': if (!isset($_GET['m']) || !isset($_GET['act'])) { return false; } return true; break; case 'Index': if (!isset($_GET['act'])) { return false; } return true; break; default: break; } return true; }
function __construct($resource) { parent::__construct($resource); }