{"action":"created","comment":{"url":"https://api.github.com/repos/mishak87/archive-tar/pulls/comments/58189752","id":58189752,"diff_hunk":"@@ -4,13 +4,19 @@\n \n class Reader implements \\Iterator {\n \n-\n+\tprivate $compression;\n \tprivate $filename;\n \n-\tpublic function __construct($filename)\n+\tpublic function __construct($filename, $compression = null)\n \t{\n \t\t$this->filename = $filename;\n-\t\t$this->detectCompression();\n+\n+\t\tif (!isset($compression)) {\n+\t\t\t$this->detectCompression();\n+\t\t} else {\n+\t\t\t$this->compression = $compression;\n+\t\t}","path":"Reader.php","position":18,"original_position":18,"commit_id":"884bd8a71fd7b5893463576ec3966d0541b70878","original_commit_id":"884bd8a71fd7b5893463576ec3966d0541b70878","user":{"login":"mishak87","id":276500,"avatar_url":"https://avatars.githubusercontent.com/u/276500?v=3","gravatar_id":"","url":"https://api.github.com/users/mishak87","html_url":"https://github.com/mishak87","followers_url":"https://api.github.com/users/mishak87/followers","following_url":"https://api.github.com/users/mishak87/following{/other_user}","gists_url":"https://api.github.com/users/mishak87/gists{/gist_id}","starred_url":"https://api.github.com/users/mishak87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishak87/subscriptions","organizations_url":"https://api.github.com/users/mishak87/orgs","repos_url":"https://api.github.com/users/mishak87/repos","events_url":"https://api.github.com/users/mishak87/events{/privacy}","received_events_url":"https://api.github.com/users/mishak87/received_events","type":"User","site_admin":false},"body":"```php\r\n} else {\r\n    throw new InvalidArgumentException;\r\n}\r\n```","created_at":"2016-04-01T10:45:27Z","updated_at":"2016-04-01T10:45:27Z","html_url":"https://github.com/mishak87/archive-tar/pull/3#discussion_r58189752","pull_request_url":"https://api.github.com/repos/mishak87/archive-tar/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/mishak87/archive-tar/pulls/comments/58189752"},"html":{"href":"https://github.com/mishak87/archive-tar/pull/3#discussion_r58189752"},"pull_request":{"href":"https://api.github.com/repos/mishak87/archive-tar/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/mishak87/archive-tar/pulls/3","id":64898627,"html_url":"https://github.com/mishak87/archive-tar/pull/3","diff_url":"https://github.com/mishak87/archive-tar/pull/3.diff","patch_url":"https://github.com/mishak87/archive-tar/pull/3.patch","issue_url":"https://api.github.com/repos/mishak87/archive-tar/issues/3","number":3,"state":"open","locked":false,"title":"Enable setting the compression type","user":{"login":"timgws","id":1050232,"avatar_url":"https://avatars.githubusercontent.com/u/1050232?v=3","gravatar_id":"","url":"https://api.github.com/users/timgws","html_url":"https://github.com/timgws","followers_url":"https://api.github.com/users/timgws/followers","following_url":"https://api.github.com/users/timgws/following{/other_user}","gists_url":"https://api.github.com/users/timgws/gists{/gist_id}","starred_url":"https://api.github.com/users/timgws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgws/subscriptions","organizations_url":"https://api.github.com/users/timgws/orgs","repos_url":"https://api.github.com/users/timgws/repos","events_url":"https://api.github.com/users/timgws/events{/privacy}","received_events_url":"https://api.github.com/users/timgws/received_events","type":"User","site_admin":false},"body":"I have a file I wanted to decompress that was a tar, but did not have an extension.\r\n\r\nI knew that the file was tar.\r\n\r\nThis quick patch allows setting the compression type if you don't need the compression type to be determined.\r\n\r\nAs a side note, maybe it wouldn't be a horrible idea to implement magic file type detection?","created_at":"2016-04-01T05:53:39Z","updated_at":"2016-04-01T10:45:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a90bcfd2952f9842424694e4c3d7778117594c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mishak87/archive-tar/pulls/3/commits","review_comments_url":"https://api.github.com/repos/mishak87/archive-tar/pulls/3/comments","review_comment_url":"https://api.github.com/repos/mishak87/archive-tar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mishak87/archive-tar/issues/3/comments","statuses_url":"https://api.github.com/repos/mishak87/archive-tar/statuses/884bd8a71fd7b5893463576ec3966d0541b70878","head":{"label":"timgws:master","ref":"master","sha":"884bd8a71fd7b5893463576ec3966d0541b70878","user":{"login":"timgws","id":1050232,"avatar_url":"https://avatars.githubusercontent.com/u/1050232?v=3","gravatar_id":"","url":"https://api.github.com/users/timgws","html_url":"https://github.com/timgws","followers_url":"https://api.github.com/users/timgws/followers","following_url":"https://api.github.com/users/timgws/following{/other_user}","gists_url":"https://api.github.com/users/timgws/gists{/gist_id}","starred_url":"https://api.github.com/users/timgws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgws/subscriptions","organizations_url":"https://api.github.com/users/timgws/orgs","repos_url":"https://api.github.com/users/timgws/repos","events_url":"https://api.github.com/users/timgws/events{/privacy}","received_events_url":"https://api.github.com/users/timgws/received_events","type":"User","site_admin":false},"repo":{"id":55207125,"name":"archive-tar","full_name":"timgws/archive-tar","owner":{"login":"timgws","id":1050232,"avatar_url":"https://avatars.githubusercontent.com/u/1050232?v=3","gravatar_id":"","url":"https://api.github.com/users/timgws","html_url":"https://github.com/timgws","followers_url":"https://api.github.com/users/timgws/followers","following_url":"https://api.github.com/users/timgws/following{/other_user}","gists_url":"https://api.github.com/users/timgws/gists{/gist_id}","starred_url":"https://api.github.com/users/timgws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgws/subscriptions","organizations_url":"https://api.github.com/users/timgws/orgs","repos_url":"https://api.github.com/users/timgws/repos","events_url":"https://api.github.com/users/timgws/events{/privacy}","received_events_url":"https://api.github.com/users/timgws/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timgws/archive-tar","description":"Lightweight implementation of TAR archive reader for PHP with support for gz, bz2, xz (experimental) and files larger then 2 GB","fork":true,"url":"https://api.github.com/repos/timgws/archive-tar","forks_url":"https://api.github.com/repos/timgws/archive-tar/forks","keys_url":"https://api.github.com/repos/timgws/archive-tar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timgws/archive-tar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timgws/archive-tar/teams","hooks_url":"https://api.github.com/repos/timgws/archive-tar/hooks","issue_events_url":"https://api.github.com/repos/timgws/archive-tar/issues/events{/number}","events_url":"https://api.github.com/repos/timgws/archive-tar/events","assignees_url":"https://api.github.com/repos/timgws/archive-tar/assignees{/user}","branches_url":"https://api.github.com/repos/timgws/archive-tar/branches{/branch}","tags_url":"https://api.github.com/repos/timgws/archive-tar/tags","blobs_url":"https://api.github.com/repos/timgws/archive-tar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timgws/archive-tar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timgws/archive-tar/git/refs{/sha}","trees_url":"https://api.github.com/repos/timgws/archive-tar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timgws/archive-tar/statuses/{sha}","languages_url":"https://api.github.com/repos/timgws/archive-tar/languages","stargazers_url":"https://api.github.com/repos/timgws/archive-tar/stargazers","contributors_url":"https://api.github.com/repos/timgws/archive-tar/contributors","subscribers_url":"https://api.github.com/repos/timgws/archive-tar/subscribers","subscription_url":"https://api.github.com/repos/timgws/archive-tar/subscription","commits_url":"https://api.github.com/repos/timgws/archive-tar/commits{/sha}","git_commits_url":"https://api.github.com/repos/timgws/archive-tar/git/commits{/sha}","comments_url":"https://api.github.com/repos/timgws/archive-tar/comments{/number}","issue_comment_url":"https://api.github.com/repos/timgws/archive-tar/issues/comments{/number}","contents_url":"https://api.github.com/repos/timgws/archive-tar/contents/{+path}","compare_url":"https://api.github.com/repos/timgws/archive-tar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timgws/archive-tar/merges","archive_url":"https://api.github.com/repos/timgws/archive-tar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timgws/archive-tar/downloads","issues_url":"https://api.github.com/repos/timgws/archive-tar/issues{/number}","pulls_url":"https://api.github.com/repos/timgws/archive-tar/pulls{/number}","milestones_url":"https://api.github.com/repos/timgws/archive-tar/milestones{/number}","notifications_url":"https://api.github.com/repos/timgws/archive-tar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timgws/archive-tar/labels{/name}","releases_url":"https://api.github.com/repos/timgws/archive-tar/releases{/id}","deployments_url":"https://api.github.com/repos/timgws/archive-tar/deployments","created_at":"2016-04-01T05:51:35Z","updated_at":"2016-04-01T05:51:35Z","pushed_at":"2016-04-01T05:51:55Z","git_url":"git://github.com/timgws/archive-tar.git","ssh_url":"git@github.com:timgws/archive-tar.git","clone_url":"https://github.com/timgws/archive-tar.git","svn_url":"https://github.com/timgws/archive-tar","homepage":"","size":9,"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":"mishak87:master","ref":"master","sha":"8a7e919429a8a7fa0f5956a0d845315fca54344b","user":{"login":"mishak87","id":276500,"avatar_url":"https://avatars.githubusercontent.com/u/276500?v=3","gravatar_id":"","url":"https://api.github.com/users/mishak87","html_url":"https://github.com/mishak87","followers_url":"https://api.github.com/users/mishak87/followers","following_url":"https://api.github.com/users/mishak87/following{/other_user}","gists_url":"https://api.github.com/users/mishak87/gists{/gist_id}","starred_url":"https://api.github.com/users/mishak87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishak87/subscriptions","organizations_url":"https://api.github.com/users/mishak87/orgs","repos_url":"https://api.github.com/users/mishak87/repos","events_url":"https://api.github.com/users/mishak87/events{/privacy}","received_events_url":"https://api.github.com/users/mishak87/received_events","type":"User","site_admin":false},"repo":{"id":7115500,"name":"archive-tar","full_name":"mishak87/archive-tar","owner":{"login":"mishak87","id":276500,"avatar_url":"https://avatars.githubusercontent.com/u/276500?v=3","gravatar_id":"","url":"https://api.github.com/users/mishak87","html_url":"https://github.com/mishak87","followers_url":"https://api.github.com/users/mishak87/followers","following_url":"https://api.github.com/users/mishak87/following{/other_user}","gists_url":"https://api.github.com/users/mishak87/gists{/gist_id}","starred_url":"https://api.github.com/users/mishak87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishak87/subscriptions","organizations_url":"https://api.github.com/users/mishak87/orgs","repos_url":"https://api.github.com/users/mishak87/repos","events_url":"https://api.github.com/users/mishak87/events{/privacy}","received_events_url":"https://api.github.com/users/mishak87/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mishak87/archive-tar","description":"Lightweight implementation of TAR archive reader for PHP with support for gz, bz2, xz (experimental) and files larger then 2 GB","fork":false,"url":"https://api.github.com/repos/mishak87/archive-tar","forks_url":"https://api.github.com/repos/mishak87/archive-tar/forks","keys_url":"https://api.github.com/repos/mishak87/archive-tar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mishak87/archive-tar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mishak87/archive-tar/teams","hooks_url":"https://api.github.com/repos/mishak87/archive-tar/hooks","issue_events_url":"https://api.github.com/repos/mishak87/archive-tar/issues/events{/number}","events_url":"https://api.github.com/repos/mishak87/archive-tar/events","assignees_url":"https://api.github.com/repos/mishak87/archive-tar/assignees{/user}","branches_url":"https://api.github.com/repos/mishak87/archive-tar/branches{/branch}","tags_url":"https://api.github.com/repos/mishak87/archive-tar/tags","blobs_url":"https://api.github.com/repos/mishak87/archive-tar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mishak87/archive-tar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mishak87/archive-tar/git/refs{/sha}","trees_url":"https://api.github.com/repos/mishak87/archive-tar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mishak87/archive-tar/statuses/{sha}","languages_url":"https://api.github.com/repos/mishak87/archive-tar/languages","stargazers_url":"https://api.github.com/repos/mishak87/archive-tar/stargazers","contributors_url":"https://api.github.com/repos/mishak87/archive-tar/contributors","subscribers_url":"https://api.github.com/repos/mishak87/archive-tar/subscribers","subscription_url":"https://api.github.com/repos/mishak87/archive-tar/subscription","commits_url":"https://api.github.com/repos/mishak87/archive-tar/commits{/sha}","git_commits_url":"https://api.github.com/repos/mishak87/archive-tar/git/commits{/sha}","comments_url":"https://api.github.com/repos/mishak87/archive-tar/comments{/number}","issue_comment_url":"https://api.github.com/repos/mishak87/archive-tar/issues/comments{/number}","contents_url":"https://api.github.com/repos/mishak87/archive-tar/contents/{+path}","compare_url":"https://api.github.com/repos/mishak87/archive-tar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mishak87/archive-tar/merges","archive_url":"https://api.github.com/repos/mishak87/archive-tar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mishak87/archive-tar/downloads","issues_url":"https://api.github.com/repos/mishak87/archive-tar/issues{/number}","pulls_url":"https://api.github.com/repos/mishak87/archive-tar/pulls{/number}","milestones_url":"https://api.github.com/repos/mishak87/archive-tar/milestones{/number}","notifications_url":"https://api.github.com/repos/mishak87/archive-tar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mishak87/archive-tar/labels{/name}","releases_url":"https://api.github.com/repos/mishak87/archive-tar/releases{/id}","deployments_url":"https://api.github.com/repos/mishak87/archive-tar/deployments","created_at":"2012-12-11T16:49:33Z","updated_at":"2016-03-01T06:50:01Z","pushed_at":"2016-04-01T05:53:39Z","git_url":"git://github.com/mishak87/archive-tar.git","ssh_url":"git@github.com:mishak87/archive-tar.git","clone_url":"https://github.com/mishak87/archive-tar.git","svn_url":"https://github.com/mishak87/archive-tar","homepage":"","size":141,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mishak87/archive-tar/pulls/3"},"html":{"href":"https://github.com/mishak87/archive-tar/pull/3"},"issue":{"href":"https://api.github.com/repos/mishak87/archive-tar/issues/3"},"comments":{"href":"https://api.github.com/repos/mishak87/archive-tar/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/mishak87/archive-tar/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/mishak87/archive-tar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mishak87/archive-tar/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/mishak87/archive-tar/statuses/884bd8a71fd7b5893463576ec3966d0541b70878"}}}}