{"action":"opened","number":74,"pull_request":{"url":"https://api.github.com/repos/paragonie/random_compat/pulls/74","id":48652282,"html_url":"https://github.com/paragonie/random_compat/pull/74","diff_url":"https://github.com/paragonie/random_compat/pull/74.diff","patch_url":"https://github.com/paragonie/random_compat/pull/74.patch","issue_url":"https://api.github.com/repos/paragonie/random_compat/issues/74","number":74,"state":"open","locked":false,"title":"Refacto to allow fine grained bootstrapping on PHP 5.3 and up","user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars.githubusercontent.com/u/243674?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"body":"Diff may be best viewed ignoring whitespaces differences:\r\nhttps://github.com/paragonie/random_compat/pull/74/files?w=1\r\n\r\nThis proposed changes refactorize the source so that implementations are separated from the bootstrapping logic:\r\n- implementations are encapsulated in static classes so that they can be lazy-loaded using php autoloading\r\n- PHP 5.2 compatibility is preserved: `require 'lib/random.php';` still works the same (no autoload required)\r\n- when composer is used (ie on PHP5.3+), `lib/autoload.php` is used instead, which is a <10 lines bootstrapping script that is all what's required when no random_* function is used in a script\r\n\r\nThen I then changed some behaviors:\r\n- thrown exceptions/errors now have the very same error message than the PHP7 ones,\r\n- argument and result buffer validation is factorized in a single class (RandomBytes) so that each random source adapter doesn't have to care about that now,\r\n- when possible, `isset()` is used in place of `strlen` so that the mbstring safe strlen is loaded only when really required","created_at":"2015-10-24T09:14:45Z","updated_at":"2015-10-24T09:14:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/paragonie/random_compat/pulls/74/commits","review_comments_url":"https://api.github.com/repos/paragonie/random_compat/pulls/74/comments","review_comment_url":"https://api.github.com/repos/paragonie/random_compat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paragonie/random_compat/issues/74/comments","statuses_url":"https://api.github.com/repos/paragonie/random_compat/statuses/d4b9244ea9e90bf5830c46235563be165a085e0f","head":{"label":"nicolas-grekas:php53","ref":"php53","sha":"d4b9244ea9e90bf5830c46235563be165a085e0f","user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars.githubusercontent.com/u/243674?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"repo":{"id":44513522,"name":"random_compat","full_name":"nicolas-grekas/random_compat","owner":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars.githubusercontent.com/u/243674?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nicolas-grekas/random_compat","description":"PHP 5.x support for random_bytes() and random_int()","fork":true,"url":"https://api.github.com/repos/nicolas-grekas/random_compat","forks_url":"https://api.github.com/repos/nicolas-grekas/random_compat/forks","keys_url":"https://api.github.com/repos/nicolas-grekas/random_compat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nicolas-grekas/random_compat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nicolas-grekas/random_compat/teams","hooks_url":"https://api.github.com/repos/nicolas-grekas/random_compat/hooks","issue_events_url":"https://api.github.com/repos/nicolas-grekas/random_compat/issues/events{/number}","events_url":"https://api.github.com/repos/nicolas-grekas/random_compat/events","assignees_url":"https://api.github.com/repos/nicolas-grekas/random_compat/assignees{/user}","branches_url":"https://api.github.com/repos/nicolas-grekas/random_compat/branches{/branch}","tags_url":"https://api.github.com/repos/nicolas-grekas/random_compat/tags","blobs_url":"https://api.github.com/repos/nicolas-grekas/random_compat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nicolas-grekas/random_compat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nicolas-grekas/random_compat/git/refs{/sha}","trees_url":"https://api.github.com/repos/nicolas-grekas/random_compat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nicolas-grekas/random_compat/statuses/{sha}","languages_url":"https://api.github.com/repos/nicolas-grekas/random_compat/languages","stargazers_url":"https://api.github.com/repos/nicolas-grekas/random_compat/stargazers","contributors_url":"https://api.github.com/repos/nicolas-grekas/random_compat/contributors","subscribers_url":"https://api.github.com/repos/nicolas-grekas/random_compat/subscribers","subscription_url":"https://api.github.com/repos/nicolas-grekas/random_compat/subscription","commits_url":"https://api.github.com/repos/nicolas-grekas/random_compat/commits{/sha}","git_commits_url":"https://api.github.com/repos/nicolas-grekas/random_compat/git/commits{/sha}","comments_url":"https://api.github.com/repos/nicolas-grekas/random_compat/comments{/number}","issue_comment_url":"https://api.github.com/repos/nicolas-grekas/random_compat/issues/comments{/number}","contents_url":"https://api.github.com/repos/nicolas-grekas/random_compat/contents/{+path}","compare_url":"https://api.github.com/repos/nicolas-grekas/random_compat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nicolas-grekas/random_compat/merges","archive_url":"https://api.github.com/repos/nicolas-grekas/random_compat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nicolas-grekas/random_compat/downloads","issues_url":"https://api.github.com/repos/nicolas-grekas/random_compat/issues{/number}","pulls_url":"https://api.github.com/repos/nicolas-grekas/random_compat/pulls{/number}","milestones_url":"https://api.github.com/repos/nicolas-grekas/random_compat/milestones{/number}","notifications_url":"https://api.github.com/repos/nicolas-grekas/random_compat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nicolas-grekas/random_compat/labels{/name}","releases_url":"https://api.github.com/repos/nicolas-grekas/random_compat/releases{/id}","created_at":"2015-10-19T05:42:40Z","updated_at":"2015-10-19T05:42:41Z","pushed_at":"2015-10-24T09:03:15Z","git_url":"git://github.com/nicolas-grekas/random_compat.git","ssh_url":"git@github.com:nicolas-grekas/random_compat.git","clone_url":"https://github.com/nicolas-grekas/random_compat.git","svn_url":"https://github.com/nicolas-grekas/random_compat","homepage":"https://paragonie.com/projects","size":807,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"paragonie:master","ref":"master","sha":"2fa50aa2f17066fa74ba00d943e8cee1a98284af","user":{"login":"paragonie","id":11591525,"avatar_url":"https://avatars.githubusercontent.com/u/11591525?v=3","gravatar_id":"","url":"https://api.github.com/users/paragonie","html_url":"https://github.com/paragonie","followers_url":"https://api.github.com/users/paragonie/followers","following_url":"https://api.github.com/users/paragonie/following{/other_user}","gists_url":"https://api.github.com/users/paragonie/gists{/gist_id}","starred_url":"https://api.github.com/users/paragonie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paragonie/subscriptions","organizations_url":"https://api.github.com/users/paragonie/orgs","repos_url":"https://api.github.com/users/paragonie/repos","events_url":"https://api.github.com/users/paragonie/events{/privacy}","received_events_url":"https://api.github.com/users/paragonie/received_events","type":"Organization","site_admin":false},"repo":{"id":38710819,"name":"random_compat","full_name":"paragonie/random_compat","owner":{"login":"paragonie","id":11591525,"avatar_url":"https://avatars.githubusercontent.com/u/11591525?v=3","gravatar_id":"","url":"https://api.github.com/users/paragonie","html_url":"https://github.com/paragonie","followers_url":"https://api.github.com/users/paragonie/followers","following_url":"https://api.github.com/users/paragonie/following{/other_user}","gists_url":"https://api.github.com/users/paragonie/gists{/gist_id}","starred_url":"https://api.github.com/users/paragonie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paragonie/subscriptions","organizations_url":"https://api.github.com/users/paragonie/orgs","repos_url":"https://api.github.com/users/paragonie/repos","events_url":"https://api.github.com/users/paragonie/events{/privacy}","received_events_url":"https://api.github.com/users/paragonie/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paragonie/random_compat","description":"PHP 5.x support for random_bytes() and random_int()","fork":false,"url":"https://api.github.com/repos/paragonie/random_compat","forks_url":"https://api.github.com/repos/paragonie/random_compat/forks","keys_url":"https://api.github.com/repos/paragonie/random_compat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paragonie/random_compat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paragonie/random_compat/teams","hooks_url":"https://api.github.com/repos/paragonie/random_compat/hooks","issue_events_url":"https://api.github.com/repos/paragonie/random_compat/issues/events{/number}","events_url":"https://api.github.com/repos/paragonie/random_compat/events","assignees_url":"https://api.github.com/repos/paragonie/random_compat/assignees{/user}","branches_url":"https://api.github.com/repos/paragonie/random_compat/branches{/branch}","tags_url":"https://api.github.com/repos/paragonie/random_compat/tags","blobs_url":"https://api.github.com/repos/paragonie/random_compat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paragonie/random_compat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paragonie/random_compat/git/refs{/sha}","trees_url":"https://api.github.com/repos/paragonie/random_compat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paragonie/random_compat/statuses/{sha}","languages_url":"https://api.github.com/repos/paragonie/random_compat/languages","stargazers_url":"https://api.github.com/repos/paragonie/random_compat/stargazers","contributors_url":"https://api.github.com/repos/paragonie/random_compat/contributors","subscribers_url":"https://api.github.com/repos/paragonie/random_compat/subscribers","subscription_url":"https://api.github.com/repos/paragonie/random_compat/subscription","commits_url":"https://api.github.com/repos/paragonie/random_compat/commits{/sha}","git_commits_url":"https://api.github.com/repos/paragonie/random_compat/git/commits{/sha}","comments_url":"https://api.github.com/repos/paragonie/random_compat/comments{/number}","issue_comment_url":"https://api.github.com/repos/paragonie/random_compat/issues/comments{/number}","contents_url":"https://api.github.com/repos/paragonie/random_compat/contents/{+path}","compare_url":"https://api.github.com/repos/paragonie/random_compat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paragonie/random_compat/merges","archive_url":"https://api.github.com/repos/paragonie/random_compat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paragonie/random_compat/downloads","issues_url":"https://api.github.com/repos/paragonie/random_compat/issues{/number}","pulls_url":"https://api.github.com/repos/paragonie/random_compat/pulls{/number}","milestones_url":"https://api.github.com/repos/paragonie/random_compat/milestones{/number}","notifications_url":"https://api.github.com/repos/paragonie/random_compat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paragonie/random_compat/labels{/name}","releases_url":"https://api.github.com/repos/paragonie/random_compat/releases{/id}","created_at":"2015-07-07T19:45:38Z","updated_at":"2015-10-24T08:29:07Z","pushed_at":"2015-10-23T13:24:45Z","git_url":"git://github.com/paragonie/random_compat.git","ssh_url":"git@github.com:paragonie/random_compat.git","clone_url":"https://github.com/paragonie/random_compat.git","svn_url":"https://github.com/paragonie/random_compat","homepage":"https://paragonie.com/projects","size":1628,"stargazers_count":130,"watchers_count":130,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":5,"forks":15,"open_issues":5,"watchers":130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paragonie/random_compat/pulls/74"},"html":{"href":"https://github.com/paragonie/random_compat/pull/74"},"issue":{"href":"https://api.github.com/repos/paragonie/random_compat/issues/74"},"comments":{"href":"https://api.github.com/repos/paragonie/random_compat/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/paragonie/random_compat/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/paragonie/random_compat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paragonie/random_compat/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/paragonie/random_compat/statuses/d4b9244ea9e90bf5830c46235563be165a085e0f"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":828,"deletions":783,"changed_files":26}}