{"action":"created","comment":{"url":"https://api.github.com/repos/manala/manalize/pulls/comments/82518687","pull_request_review_id":3422502,"id":82518687,"diff_hunk":"@@ -0,0 +1,133 @@\n+<?php\n+\n+/*\n+ * This file is part of the Manalize project.\n+ *\n+ * (c) Manala <contact@manala.io>\n+ *\n+ * For the full copyright and license information, please refer to the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Manala\\Manalize\\Command;\n+\n+use Symfony\\Component\\Console\\Command\\Command;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use Symfony\\Component\\Console\\Style\\SymfonyStyle;\n+use Manala\\Manalize\\Application;\n+\n+/**\n+ * Manala self-update command.\n+ *\n+ * Mostly taken from https://github.com/FriendsOfPhp/PHP-CS-FIXER licensed under MIT\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *     Dariusz Rumiński <dariusz.ruminski@gmail.com>\n+ *\n+ * @author Robin Chalas <robin.chalas@gmail.com>\n+ */\n+class SelfUpdateCommand extends Command\n+{\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function configure()\n+    {\n+        $this\n+            ->setName('self-update')\n+            ->setAliases(['selfupdate'])\n+            ->setDescription('Updates manalize to the latest stable version.')\n+        ;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function execute(InputInterface $input, OutputInterface $output)\n+    {\n+        $io = new SymfonyStyle($input, $output);\n+\n+        if (!$this->isPharInstallation()) {\n+            $io->error('Self-update is available only for PHAR installation.');\n+\n+            return 1;\n+        }\n+\n+        $lastTag = $this->getLastTag();\n+\n+        if (null === $lastTag) {\n+            $io->error('Unable to determine newest version.');\n+\n+            return 1;\n+        }\n+\n+        if ('v'.$this->getApplication()->getVersion() === $lastTag) {\n+            $io->success(sprintf('manalize is already up to date (%s).', $lastTag));\n+\n+            return 0;\n+        }\n+\n+        $remoteFilename = sprintf('https://github.com/manala/manalize/releases/download/%s/manalize.phar', $lastTag);","path":"src/Command/SelfUpdateCommand.php","position":70,"original_position":70,"commit_id":"24cbb1eb3051fd59239b3f77fa53b511a0e26aae","original_commit_id":"24cbb1eb3051fd59239b3f77fa53b511a0e26aae","user":{"login":"ogizanagi","id":2211145,"avatar_url":"https://avatars.githubusercontent.com/u/2211145?v=3","gravatar_id":"","url":"https://api.github.com/users/ogizanagi","html_url":"https://github.com/ogizanagi","followers_url":"https://api.github.com/users/ogizanagi/followers","following_url":"https://api.github.com/users/ogizanagi/following{/other_user}","gists_url":"https://api.github.com/users/ogizanagi/gists{/gist_id}","starred_url":"https://api.github.com/users/ogizanagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogizanagi/subscriptions","organizations_url":"https://api.github.com/users/ogizanagi/orgs","repos_url":"https://api.github.com/users/ogizanagi/repos","events_url":"https://api.github.com/users/ogizanagi/events{/privacy}","received_events_url":"https://api.github.com/users/ogizanagi/received_events","type":"User","site_admin":false},"body":"```diff\r\n- $remoteFilename = sprintf('https://github.com/manala/manalize/releases/download/%s/manalize.phar', $lastTag);\r\n+ $remoteFilename = sprintf('https://github.com/%s/releases/download/%s/manalize.phar', Application::REPOSITORY_NAME, $lastTag);\r\n```","created_at":"2016-10-09T09:35:35Z","updated_at":"2016-10-09T09:50:20Z","html_url":"https://github.com/manala/manalize/pull/53#discussion_r82518687","pull_request_url":"https://api.github.com/repos/manala/manalize/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/manala/manalize/pulls/comments/82518687"},"html":{"href":"https://github.com/manala/manalize/pull/53#discussion_r82518687"},"pull_request":{"href":"https://api.github.com/repos/manala/manalize/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/manala/manalize/pulls/53","id":88547087,"html_url":"https://github.com/manala/manalize/pull/53","diff_url":"https://github.com/manala/manalize/pull/53.diff","patch_url":"https://github.com/manala/manalize/pull/53.patch","issue_url":"https://api.github.com/repos/manala/manalize/issues/53","number":53,"state":"open","locked":false,"title":"Add self-update command","user":{"login":"chalasr","id":7502063,"avatar_url":"https://avatars.githubusercontent.com/u/7502063?v=3","gravatar_id":"","url":"https://api.github.com/users/chalasr","html_url":"https://github.com/chalasr","followers_url":"https://api.github.com/users/chalasr/followers","following_url":"https://api.github.com/users/chalasr/following{/other_user}","gists_url":"https://api.github.com/users/chalasr/gists{/gist_id}","starred_url":"https://api.github.com/users/chalasr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalasr/subscriptions","organizations_url":"https://api.github.com/users/chalasr/orgs","repos_url":"https://api.github.com/users/chalasr/repos","events_url":"https://api.github.com/users/chalasr/events{/privacy}","received_events_url":"https://api.github.com/users/chalasr/received_events","type":"User","site_admin":false},"body":"- [x] Add self-update command\r\n- [ ] Test it","created_at":"2016-10-08T14:13:44Z","updated_at":"2016-10-09T09:50:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cae1020f774cf362fc6f7ca1307c380500cfeb9d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/manala/manalize/pulls/53/commits","review_comments_url":"https://api.github.com/repos/manala/manalize/pulls/53/comments","review_comment_url":"https://api.github.com/repos/manala/manalize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/manala/manalize/issues/53/comments","statuses_url":"https://api.github.com/repos/manala/manalize/statuses/24cbb1eb3051fd59239b3f77fa53b511a0e26aae","head":{"label":"manala:feature/command/self-update","ref":"feature/command/self-update","sha":"24cbb1eb3051fd59239b3f77fa53b511a0e26aae","user":{"login":"manala","id":17640904,"avatar_url":"https://avatars.githubusercontent.com/u/17640904?v=3","gravatar_id":"","url":"https://api.github.com/users/manala","html_url":"https://github.com/manala","followers_url":"https://api.github.com/users/manala/followers","following_url":"https://api.github.com/users/manala/following{/other_user}","gists_url":"https://api.github.com/users/manala/gists{/gist_id}","starred_url":"https://api.github.com/users/manala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manala/subscriptions","organizations_url":"https://api.github.com/users/manala/orgs","repos_url":"https://api.github.com/users/manala/repos","events_url":"https://api.github.com/users/manala/events{/privacy}","received_events_url":"https://api.github.com/users/manala/received_events","type":"Organization","site_admin":false},"repo":{"id":62733701,"name":"manalize","full_name":"manala/manalize","owner":{"login":"manala","id":17640904,"avatar_url":"https://avatars.githubusercontent.com/u/17640904?v=3","gravatar_id":"","url":"https://api.github.com/users/manala","html_url":"https://github.com/manala","followers_url":"https://api.github.com/users/manala/followers","following_url":"https://api.github.com/users/manala/following{/other_user}","gists_url":"https://api.github.com/users/manala/gists{/gist_id}","starred_url":"https://api.github.com/users/manala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manala/subscriptions","organizations_url":"https://api.github.com/users/manala/orgs","repos_url":"https://api.github.com/users/manala/repos","events_url":"https://api.github.com/users/manala/events{/privacy}","received_events_url":"https://api.github.com/users/manala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manala/manalize","description":"Entry point of Manala' ansible roles providing vagrant stacks on the fly","fork":false,"url":"https://api.github.com/repos/manala/manalize","forks_url":"https://api.github.com/repos/manala/manalize/forks","keys_url":"https://api.github.com/repos/manala/manalize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manala/manalize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manala/manalize/teams","hooks_url":"https://api.github.com/repos/manala/manalize/hooks","issue_events_url":"https://api.github.com/repos/manala/manalize/issues/events{/number}","events_url":"https://api.github.com/repos/manala/manalize/events","assignees_url":"https://api.github.com/repos/manala/manalize/assignees{/user}","branches_url":"https://api.github.com/repos/manala/manalize/branches{/branch}","tags_url":"https://api.github.com/repos/manala/manalize/tags","blobs_url":"https://api.github.com/repos/manala/manalize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manala/manalize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manala/manalize/git/refs{/sha}","trees_url":"https://api.github.com/repos/manala/manalize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manala/manalize/statuses/{sha}","languages_url":"https://api.github.com/repos/manala/manalize/languages","stargazers_url":"https://api.github.com/repos/manala/manalize/stargazers","contributors_url":"https://api.github.com/repos/manala/manalize/contributors","subscribers_url":"https://api.github.com/repos/manala/manalize/subscribers","subscription_url":"https://api.github.com/repos/manala/manalize/subscription","commits_url":"https://api.github.com/repos/manala/manalize/commits{/sha}","git_commits_url":"https://api.github.com/repos/manala/manalize/git/commits{/sha}","comments_url":"https://api.github.com/repos/manala/manalize/comments{/number}","issue_comment_url":"https://api.github.com/repos/manala/manalize/issues/comments{/number}","contents_url":"https://api.github.com/repos/manala/manalize/contents/{+path}","compare_url":"https://api.github.com/repos/manala/manalize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manala/manalize/merges","archive_url":"https://api.github.com/repos/manala/manalize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manala/manalize/downloads","issues_url":"https://api.github.com/repos/manala/manalize/issues{/number}","pulls_url":"https://api.github.com/repos/manala/manalize/pulls{/number}","milestones_url":"https://api.github.com/repos/manala/manalize/milestones{/number}","notifications_url":"https://api.github.com/repos/manala/manalize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manala/manalize/labels{/name}","releases_url":"https://api.github.com/repos/manala/manalize/releases{/id}","deployments_url":"https://api.github.com/repos/manala/manalize/deployments","created_at":"2016-07-06T15:49:26Z","updated_at":"2016-10-08T13:57:43Z","pushed_at":"2016-10-09T09:48:15Z","git_url":"git://github.com/manala/manalize.git","ssh_url":"git@github.com:manala/manalize.git","clone_url":"https://github.com/manala/manalize.git","svn_url":"https://github.com/manala/manalize","homepage":"http://www.manala.io","size":213,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"manala:master","ref":"master","sha":"f04db2c115cfda3de2ef86cf4a2461178e2288b5","user":{"login":"manala","id":17640904,"avatar_url":"https://avatars.githubusercontent.com/u/17640904?v=3","gravatar_id":"","url":"https://api.github.com/users/manala","html_url":"https://github.com/manala","followers_url":"https://api.github.com/users/manala/followers","following_url":"https://api.github.com/users/manala/following{/other_user}","gists_url":"https://api.github.com/users/manala/gists{/gist_id}","starred_url":"https://api.github.com/users/manala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manala/subscriptions","organizations_url":"https://api.github.com/users/manala/orgs","repos_url":"https://api.github.com/users/manala/repos","events_url":"https://api.github.com/users/manala/events{/privacy}","received_events_url":"https://api.github.com/users/manala/received_events","type":"Organization","site_admin":false},"repo":{"id":62733701,"name":"manalize","full_name":"manala/manalize","owner":{"login":"manala","id":17640904,"avatar_url":"https://avatars.githubusercontent.com/u/17640904?v=3","gravatar_id":"","url":"https://api.github.com/users/manala","html_url":"https://github.com/manala","followers_url":"https://api.github.com/users/manala/followers","following_url":"https://api.github.com/users/manala/following{/other_user}","gists_url":"https://api.github.com/users/manala/gists{/gist_id}","starred_url":"https://api.github.com/users/manala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manala/subscriptions","organizations_url":"https://api.github.com/users/manala/orgs","repos_url":"https://api.github.com/users/manala/repos","events_url":"https://api.github.com/users/manala/events{/privacy}","received_events_url":"https://api.github.com/users/manala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manala/manalize","description":"Entry point of Manala' ansible roles providing vagrant stacks on the fly","fork":false,"url":"https://api.github.com/repos/manala/manalize","forks_url":"https://api.github.com/repos/manala/manalize/forks","keys_url":"https://api.github.com/repos/manala/manalize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manala/manalize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manala/manalize/teams","hooks_url":"https://api.github.com/repos/manala/manalize/hooks","issue_events_url":"https://api.github.com/repos/manala/manalize/issues/events{/number}","events_url":"https://api.github.com/repos/manala/manalize/events","assignees_url":"https://api.github.com/repos/manala/manalize/assignees{/user}","branches_url":"https://api.github.com/repos/manala/manalize/branches{/branch}","tags_url":"https://api.github.com/repos/manala/manalize/tags","blobs_url":"https://api.github.com/repos/manala/manalize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manala/manalize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manala/manalize/git/refs{/sha}","trees_url":"https://api.github.com/repos/manala/manalize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manala/manalize/statuses/{sha}","languages_url":"https://api.github.com/repos/manala/manalize/languages","stargazers_url":"https://api.github.com/repos/manala/manalize/stargazers","contributors_url":"https://api.github.com/repos/manala/manalize/contributors","subscribers_url":"https://api.github.com/repos/manala/manalize/subscribers","subscription_url":"https://api.github.com/repos/manala/manalize/subscription","commits_url":"https://api.github.com/repos/manala/manalize/commits{/sha}","git_commits_url":"https://api.github.com/repos/manala/manalize/git/commits{/sha}","comments_url":"https://api.github.com/repos/manala/manalize/comments{/number}","issue_comment_url":"https://api.github.com/repos/manala/manalize/issues/comments{/number}","contents_url":"https://api.github.com/repos/manala/manalize/contents/{+path}","compare_url":"https://api.github.com/repos/manala/manalize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manala/manalize/merges","archive_url":"https://api.github.com/repos/manala/manalize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manala/manalize/downloads","issues_url":"https://api.github.com/repos/manala/manalize/issues{/number}","pulls_url":"https://api.github.com/repos/manala/manalize/pulls{/number}","milestones_url":"https://api.github.com/repos/manala/manalize/milestones{/number}","notifications_url":"https://api.github.com/repos/manala/manalize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manala/manalize/labels{/name}","releases_url":"https://api.github.com/repos/manala/manalize/releases{/id}","deployments_url":"https://api.github.com/repos/manala/manalize/deployments","created_at":"2016-07-06T15:49:26Z","updated_at":"2016-10-08T13:57:43Z","pushed_at":"2016-10-09T09:48:15Z","git_url":"git://github.com/manala/manalize.git","ssh_url":"git@github.com:manala/manalize.git","clone_url":"https://github.com/manala/manalize.git","svn_url":"https://github.com/manala/manalize","homepage":"http://www.manala.io","size":213,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/manala/manalize/pulls/53"},"html":{"href":"https://github.com/manala/manalize/pull/53"},"issue":{"href":"https://api.github.com/repos/manala/manalize/issues/53"},"comments":{"href":"https://api.github.com/repos/manala/manalize/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/manala/manalize/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/manala/manalize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/manala/manalize/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/manala/manalize/statuses/24cbb1eb3051fd59239b3f77fa53b511a0e26aae"}}}}
{"actor":{"display_login":"ogizanagi"}}