{"action":"created","issue":{"url":"https://api.github.com/repos/laruence/yar/issues/73","labels_url":"https://api.github.com/repos/laruence/yar/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/laruence/yar/issues/73/comments","events_url":"https://api.github.com/repos/laruence/yar/issues/73/events","html_url":"https://github.com/laruence/yar/pull/73","id":129010907,"number":73,"title":"支持在php.ini或代码中设置magic_num","user":{"login":"leeeboo","id":877939,"avatar_url":"https://avatars.githubusercontent.com/u/877939?v=3","gravatar_id":"","url":"https://api.github.com/users/leeeboo","html_url":"https://github.com/leeeboo","followers_url":"https://api.github.com/users/leeeboo/followers","following_url":"https://api.github.com/users/leeeboo/following{/other_user}","gists_url":"https://api.github.com/users/leeeboo/gists{/gist_id}","starred_url":"https://api.github.com/users/leeeboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeeboo/subscriptions","organizations_url":"https://api.github.com/users/leeeboo/orgs","repos_url":"https://api.github.com/users/leeeboo/repos","events_url":"https://api.github.com/users/leeeboo/events{/privacy}","received_events_url":"https://api.github.com/users/leeeboo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/laruence/yar/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-27T02:44:18Z","updated_at":"2016-01-28T04:17:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/laruence/yar/pulls/73","html_url":"https://github.com/laruence/yar/pull/73","diff_url":"https://github.com/laruence/yar/pull/73.diff","patch_url":"https://github.com/laruence/yar/pull/73.patch"},"body":"说明：\r\n由于这个功能修改较多，提交的目的是请鸟哥审阅。我们是Yar第一批的重度用户，希望有贡献。如果初衷与Yar本身不符，就不merge。\r\n\r\n初衷：\r\n由于有跨公网的RPC需求，涉及到了安全性。所以考虑用magic_num去最简单地防止恶意请求（虽然这种方式仍然可能不是很稳固）。\r\n\r\n实现：\r\n实现了在php.ini中采用yar.packager=\"0x80DFEC60\"的形式设置magic_num；\r\n实现了在php代码中采用$service->SetOpt(YAR_OPT_MAGIC_NUM, \"0x80DFEC60\");的形式设置magic_num（为了在同一个运行时下兼容各种Yar Server）。"},"comment":{"url":"https://api.github.com/repos/laruence/yar/issues/comments/175964092","html_url":"https://github.com/laruence/yar/pull/73#issuecomment-175964092","issue_url":"https://api.github.com/repos/laruence/yar/issues/73","id":175964092,"user":{"login":"leeeboo","id":877939,"avatar_url":"https://avatars.githubusercontent.com/u/877939?v=3","gravatar_id":"","url":"https://api.github.com/users/leeeboo","html_url":"https://github.com/leeeboo","followers_url":"https://api.github.com/users/leeeboo/followers","following_url":"https://api.github.com/users/leeeboo/following{/other_user}","gists_url":"https://api.github.com/users/leeeboo/gists{/gist_id}","starred_url":"https://api.github.com/users/leeeboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeeboo/subscriptions","organizations_url":"https://api.github.com/users/leeeboo/orgs","repos_url":"https://api.github.com/users/leeeboo/repos","events_url":"https://api.github.com/users/leeeboo/events{/privacy}","received_events_url":"https://api.github.com/users/leeeboo/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T04:17:58Z","updated_at":"2016-01-28T04:17:58Z","body":"这个版本已经在我们的生产环境中跑了一阵子了。完全兼容现有的yar server。"}}