GitHub PullRequestReviewCommentEvent at 2014-09-21 14:27:55
Repository: symfony
Actor: pgodel
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/17825720","id":17825720,"diff_hunk":"@@ -0,0 +1,154 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\Process;\n+\n+/**\n+ * @author Romain Neutron <imprec@gmail.com>\n+ */\n+class Command\n+{\n+    private $parts;\n+    private $appended = array();\n+    private $piped;\n+    private $redirects = array();\n+\n+    public function __construct(array $parts = array(), $escape = true)\n+    {\n+        $this->parts = $escape ? array_map([self, 'escape'], $parts) : $parts;\n+    }\n+\n+    public function add($parts, $escape = true, $prepend = false)\n+    {\n+        if (!is_array($parts)) {\n+            $parts = array($parts);\n+        }\n+\n+        if ($prepend) {\n+            $this->parts = ($escape ? array_map([self, 'escape'], $parts) : $parts) + $this->parts;\n+        } else {\n+            $this->parts += $escape ? array_map([self, 'escape'], $parts) : $parts;\n+        }\n+\n+        return $this;\n+    }\n+\n+    public function append(Command $command)\n+    {\n+        $this->appended[] = $command;\n+\n+        return $this;\n+    }\n+\n+    public function pipe(Command $command)\n+    {\n+        $this->piped = $command;\n+\n+        return $command;\n+    }\n+\n+    public function redirect($fd, $target = null, $append = false)\n+    {\n+        $this->redirects[$fd] = ['target' => $target, 'append' => $append];\n+\n+        return $this;\n+    }\n+\n+    public function prepareForexecution()\n+    {\n+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {\n+            return 'cmd /V:ON /E:ON /C \"('.$this.')\"';\n+        }\n+\n+        return (string) $this;\n+    }\n+\n+    public function __toString()\n+    {\n+        return implode(' ', $this->parts).array_map('; ', $this->appended).$this->getredirects().($this->piped ? ' | '.$this->piped : '');\n+    }\n+\n+    public static function fromString($commandline)\n+    {\n+        $command = new self();\n+\n+        $command->add($commandline, false);\n+\n+        return $command;\n+    }\n+\n+    private function getredirects()","path":"src/Symfony/Component/Process/Command.php","position":88,"original_position":88,"commit_id":"f6ca2219fb9d54e6263862dc3286003cb44f3f63","original_commit_id":"f6ca2219fb9d54e6263862dc3286003cb44f3f63","user":{"login":"pgodel","id":18968,"avatar_url":"https://avatars.githubusercontent.com/u/18968?v=2","gravatar_id":"bd983ec08684f396a53ff85a197e3e67","url":"https://api.github.com/users/pgodel","html_url":"https://github.com/pgodel","followers_url":"https://api.github.com/users/pgodel/followers","following_url":"https://api.github.com/users/pgodel/following{/other_user}","gists_url":"https://api.github.com/users/pgodel/gists{/gist_id}","starred_url":"https://api.github.com/users/pgodel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgodel/subscriptions","organizations_url":"https://api.github.com/users/pgodel/orgs","repos_url":"https://api.github.com/users/pgodel/repos","events_url":"https://api.github.com/users/pgodel/events{/privacy}","received_events_url":"https://api.github.com/users/pgodel/received_events","type":"User","site_admin":false},"body":"should be getRedirects()","created_at":"2014-09-21T14:27:55Z","updated_at":"2014-09-21T14:27:55Z","html_url":"https://github.com/symfony/symfony/pull/11972#discussion_r17825720","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/11972","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/17825720"},"html":{"href":"https://github.com/symfony/symfony/pull/11972#discussion_r17825720"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11972"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/11972","id":21548410,"html_url":"https://github.com/symfony/symfony/pull/11972","diff_url":"https://github.com/symfony/symfony/pull/11972.diff","patch_url":"https://github.com/symfony/symfony/pull/11972.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/11972","number":11972,"state":"open","locked":false,"title":"[WIP][Processs] Add Process\\Command","user":{"login":"romainneutron","id":137574,"avatar_url":"https://avatars.githubusercontent.com/u/137574?v=2","gravatar_id":"ce776a5e957c937a56c721b7d6701960","url":"https://api.github.com/users/romainneutron","html_url":"https://github.com/romainneutron","followers_url":"https://api.github.com/users/romainneutron/followers","following_url":"https://api.github.com/users/romainneutron/following{/other_user}","gists_url":"https://api.github.com/users/romainneutron/gists{/gist_id}","starred_url":"https://api.github.com/users/romainneutron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainneutron/subscriptions","organizations_url":"https://api.github.com/users/romainneutron/orgs","repos_url":"https://api.github.com/users/romainneutron/repos","events_url":"https://api.github.com/users/romainneutron/events{/privacy}","received_events_url":"https://api.github.com/users/romainneutron/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | yes\r\n| Tests pass?   | yes\r\n| Fixed tickets | #10025\r\n| License       | MIT\r\n| Doc PR        | todo\r\n\r\nI open a PR for this work-in-progress as an alternative to #11971. The implementation of the Process Command is quite okay, it should be tested and the API validated. \r\n\r\nThis Command would help us to enforce the use of the ProcessBuilder and provide a way to avoid command injections.","created_at":"2014-09-21T14:02:58Z","updated_at":"2014-09-21T14:27:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1341eba8ecea929f0de8a1c07298d5233ec859a6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/11972/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/11972/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments/{number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/11972/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/f6ca2219fb9d54e6263862dc3286003cb44f3f63","head":{"label":"romainneutron:process-pipe","ref":"process-pipe","sha":"f6ca2219fb9d54e6263862dc3286003cb44f3f63","user":{"login":"romainneutron","id":137574,"avatar_url":"https://avatars.githubusercontent.com/u/137574?v=2","gravatar_id":"ce776a5e957c937a56c721b7d6701960","url":"https://api.github.com/users/romainneutron","html_url":"https://github.com/romainneutron","followers_url":"https://api.github.com/users/romainneutron/followers","following_url":"https://api.github.com/users/romainneutron/following{/other_user}","gists_url":"https://api.github.com/users/romainneutron/gists{/gist_id}","starred_url":"https://api.github.com/users/romainneutron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainneutron/subscriptions","organizations_url":"https://api.github.com/users/romainneutron/orgs","repos_url":"https://api.github.com/users/romainneutron/repos","events_url":"https://api.github.com/users/romainneutron/events{/privacy}","received_events_url":"https://api.github.com/users/romainneutron/received_events","type":"User","site_admin":false},"repo":{"id":4369387,"name":"symfony","full_name":"romainneutron/symfony","owner":{"login":"romainneutron","id":137574,"avatar_url":"https://avatars.githubusercontent.com/u/137574?v=2","gravatar_id":"ce776a5e957c937a56c721b7d6701960","url":"https://api.github.com/users/romainneutron","html_url":"https://github.com/romainneutron","followers_url":"https://api.github.com/users/romainneutron/followers","following_url":"https://api.github.com/users/romainneutron/following{/other_user}","gists_url":"https://api.github.com/users/romainneutron/gists{/gist_id}","starred_url":"https://api.github.com/users/romainneutron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainneutron/subscriptions","organizations_url":"https://api.github.com/users/romainneutron/orgs","repos_url":"https://api.github.com/users/romainneutron/repos","events_url":"https://api.github.com/users/romainneutron/events{/privacy}","received_events_url":"https://api.github.com/users/romainneutron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romainneutron/symfony","description":"The Symfony2 PHP framework","fork":true,"url":"https://api.github.com/repos/romainneutron/symfony","forks_url":"https://api.github.com/repos/romainneutron/symfony/forks","keys_url":"https://api.github.com/repos/romainneutron/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romainneutron/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romainneutron/symfony/teams","hooks_url":"https://api.github.com/repos/romainneutron/symfony/hooks","issue_events_url":"https://api.github.com/repos/romainneutron/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/romainneutron/symfony/events","assignees_url":"https://api.github.com/repos/romainneutron/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/romainneutron/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/romainneutron/symfony/tags","blobs_url":"https://api.github.com/repos/romainneutron/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romainneutron/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romainneutron/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/romainneutron/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romainneutron/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/romainneutron/symfony/languages","stargazers_url":"https://api.github.com/repos/romainneutron/symfony/stargazers","contributors_url":"https://api.github.com/repos/romainneutron/symfony/contributors","subscribers_url":"https://api.github.com/repos/romainneutron/symfony/subscribers","subscription_url":"https://api.github.com/repos/romainneutron/symfony/subscription","commits_url":"https://api.github.com/repos/romainneutron/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/romainneutron/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/romainneutron/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/romainneutron/symfony/issues/comments/{number}","contents_url":"https://api.github.com/repos/romainneutron/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/romainneutron/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romainneutron/symfony/merges","archive_url":"https://api.github.com/repos/romainneutron/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romainneutron/symfony/downloads","issues_url":"https://api.github.com/repos/romainneutron/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/romainneutron/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/romainneutron/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/romainneutron/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romainneutron/symfony/labels{/name}","releases_url":"https://api.github.com/repos/romainneutron/symfony/releases{/id}","created_at":"2012-05-18T13:11:05Z","updated_at":"2014-06-17T20:02:24Z","pushed_at":"2014-09-21T14:25:49Z","git_url":"git://github.com/romainneutron/symfony.git","ssh_url":"git@github.com:romainneutron/symfony.git","clone_url":"https://github.com/romainneutron/symfony.git","svn_url":"https://github.com/romainneutron/symfony","homepage":"symfony.com","size":43018,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"a469c560fbdf995369a821a42ea8aa7a9a119790","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=2","gravatar_id":"bc6312a5b583c4258c9fad11122c6e31","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=2","gravatar_id":"bc6312a5b583c4258c9fad11122c6e31","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments/{number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","created_at":"2010-01-04T14:21:21Z","updated_at":"2014-09-21T08:49:38Z","pushed_at":"2014-09-21T07:12:17Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":181867,"stargazers_count":8911,"watchers_count":8911,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":3438,"mirror_url":null,"open_issues_count":839,"forks":3438,"open_issues":839,"watchers":8911,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11972"},"html":{"href":"https://github.com/symfony/symfony/pull/11972"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/11972"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/11972/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11972/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11972/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/f6ca2219fb9d54e6263862dc3286003cb44f3f63"}}}}