isPublic() && $a[0] != '_' && (!$method->isConstructor() && !$method->isDestructor()); } try{ $c = $_REQUEST['c']; $a = $_REQUEST['a']; if (!empty($gOnlyRoutes) && !getXVal($gOnlyRoutes, $c, null)) { die(); return; } if (!empty($gExcludeRoutes) && getXVal($gExcludeRoutes, $c, null)) { die(); return; } $classname = $c .'Controller'; $beginTick = phpcommon\getTickCount(); $obj = eval('return new $classname();'); $method = null; try { $method = new ReflectionMethod($classname, $a); } catch (Exception $e) { } $methodS = null; try { $methodS = new ReflectionMethod($classname, $a . 'S'); } catch (Exception $e){ } if (isValidActionAction($a, $method)) { $obj->_handlePre(); $method->invoke($obj); $obj->_handlePost(); } else if (isValidActionAction($a, $methodS)) { //如果原版函数不存在并且S版函数存在,则自动切换为S版 echo json_encode(array( 'errcode' => 1006, 'errmsg' => 'already upgrade to safe api', 'payload' => 1, )); die(); } } catch (Exception $e){ error_log($e); }