{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/93819338","pull_request_review_id":14355558,"id":93819338,"diff_hunk":"@@ -0,0 +1,123 @@\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\\Bundle\\WebServerBundle\\Command;\n+\n+use Symfony\\Bundle\\WebServerBundle\\WebServer;\n+use Symfony\\Component\\Console\\Input\\InputArgument;\n+use Symfony\\Component\\Console\\Input\\InputOption;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use Symfony\\Component\\Console\\Output\\ConsoleOutputInterface;\n+use Symfony\\Component\\Console\\Style\\SymfonyStyle;\n+\n+/**\n+ * Runs Symfony application using a local web server.\n+ *\n+ * @author Michał Pipa <michal.pipa.xsolve@gmail.com>\n+ */\n+class ServerRunCommand extends ServerCommand\n+{\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function configure()\n+    {\n+        $this\n+            ->setDefinition(array(\n+                new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)', '127.0.0.1:8000'),\n+                new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root', null),\n+                new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script', dirname(__DIR__).'/Resources/router.php'),\n+            ))\n+            ->setName('server:run')\n+            ->setDescription('Runs a local web server')\n+            ->setHelp(<<<'EOF'\n+The <info>%command.name%</info> runs a local web server:\n+\n+  <info>%command.full_name%</info>\n+\n+To change default bind address and port use the <info>address</info> argument:\n+\n+  <info>%command.full_name% 127.0.0.1:8080</info>\n+\n+To change default docroot directory use the <info>--docroot</info> option:\n+\n+  <info>%command.full_name% --docroot=htdocs/</info>\n+\n+If you have custom docroot directory layout, you can specify your own\n+router script using <info>--router</info> option:\n+\n+  <info>%command.full_name% --router=app/config/router.php</info>\n+\n+Specifing a router script is required when the used environment is not \"dev\",\n+\"prod\", or \"test\".\n+\n+See also: http://www.php.net/manual/en/features.commandline.webserver.php\n+\n+EOF\n+            )\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 (null === $documentRoot = $input->getOption('docroot')) {\n+            $documentRoot = $this->getContainer()->getParameter('kernel.root_dir').'/../web';\n+        }\n+\n+        if (!is_dir($documentRoot)) {\n+            $io->error(sprintf('The document root directory \"%s\" does not exist.', $documentRoot));\n+\n+            return 1;\n+        }\n+\n+        $env = $this->getContainer()->getParameter('kernel.environment');\n+        if ('prod' === $env) {\n+            $io->error('Running this server in production environment is NOT recommended!');\n+        }\n+\n+        $router = $input->getOption('router');\n+\n+        $callback = null;\n+        $disableOutput = false;\n+        if (OutputInterface::VERBOSITY_NORMAL > $output->getVerbosity()) {","path":"src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php","position":96,"original_position":96,"commit_id":"eed145d6297eed43ea7bcd33676357ccb44009ad","original_commit_id":"eed145d6297eed43ea7bcd33676357ccb44009ad","user":{"login":"lyrixx","id":408368,"avatar_url":"https://avatars.githubusercontent.com/u/408368?v=3","gravatar_id":"","url":"https://api.github.com/users/lyrixx","html_url":"https://github.com/lyrixx","followers_url":"https://api.github.com/users/lyrixx/followers","following_url":"https://api.github.com/users/lyrixx/following{/other_user}","gists_url":"https://api.github.com/users/lyrixx/gists{/gist_id}","starred_url":"https://api.github.com/users/lyrixx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyrixx/subscriptions","organizations_url":"https://api.github.com/users/lyrixx/orgs","repos_url":"https://api.github.com/users/lyrixx/repos","events_url":"https://api.github.com/users/lyrixx/events{/privacy}","received_events_url":"https://api.github.com/users/lyrixx/received_events","type":"User","site_admin":false},"body":"`->isQuiet()` ;)","created_at":"2016-12-24T17:14:59Z","updated_at":"2016-12-24T17:14:59Z","html_url":"https://github.com/symfony/symfony/pull/21039#discussion_r93819338","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/21039","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/93819338"},"html":{"href":"https://github.com/symfony/symfony/pull/21039#discussion_r93819338"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/21039"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/21039","id":99283798,"html_url":"https://github.com/symfony/symfony/pull/21039","diff_url":"https://github.com/symfony/symfony/pull/21039.diff","patch_url":"https://github.com/symfony/symfony/pull/21039.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/21039","number":21039,"state":"open","locked":false,"title":"Web server bundle","user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | yes\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | n/a\r\n| License       | MIT\r\n| Doc PR        | n/a\r\n\r\nMoved the `server:*` commands to a new bundle. It makes them more easily discoverable and more decoupled. Discoverability is important when not using symfony/symfony. In that case, the commands are not available unless you have the symfony/process component installed. With a dedicated bundle, installing the bundle also installs the dependency, making the whole process easier.\r\n\r\nThe last commit is more about making the router files more configurable.\r\n","created_at":"2016-12-23T21:49:03Z","updated_at":"2016-12-24T17:14:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"184f212d87b9e83410a1a9b3be68646bd6833fd7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/21039/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/21039/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/21039/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/eed145d6297eed43ea7bcd33676357ccb44009ad","head":{"label":"fabpot:web-server-bundle","ref":"web-server-bundle","sha":"eed145d6297eed43ea7bcd33676357ccb44009ad","user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"repo":{"id":458135,"name":"symfony","full_name":"fabpot/symfony","owner":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabpot/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/fabpot/symfony","forks_url":"https://api.github.com/repos/fabpot/symfony/forks","keys_url":"https://api.github.com/repos/fabpot/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabpot/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabpot/symfony/teams","hooks_url":"https://api.github.com/repos/fabpot/symfony/hooks","issue_events_url":"https://api.github.com/repos/fabpot/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/fabpot/symfony/events","assignees_url":"https://api.github.com/repos/fabpot/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/fabpot/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/fabpot/symfony/tags","blobs_url":"https://api.github.com/repos/fabpot/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabpot/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabpot/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabpot/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabpot/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/fabpot/symfony/languages","stargazers_url":"https://api.github.com/repos/fabpot/symfony/stargazers","contributors_url":"https://api.github.com/repos/fabpot/symfony/contributors","subscribers_url":"https://api.github.com/repos/fabpot/symfony/subscribers","subscription_url":"https://api.github.com/repos/fabpot/symfony/subscription","commits_url":"https://api.github.com/repos/fabpot/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabpot/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabpot/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabpot/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabpot/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/fabpot/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabpot/symfony/merges","archive_url":"https://api.github.com/repos/fabpot/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabpot/symfony/downloads","issues_url":"https://api.github.com/repos/fabpot/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/fabpot/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/fabpot/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/fabpot/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabpot/symfony/labels{/name}","releases_url":"https://api.github.com/repos/fabpot/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/fabpot/symfony/deployments","created_at":"2010-01-04T15:41:06Z","updated_at":"2016-11-23T21:19:14Z","pushed_at":"2016-12-24T12:14:29Z","git_url":"git://github.com/fabpot/symfony.git","ssh_url":"git@github.com:fabpot/symfony.git","clone_url":"https://github.com/fabpot/symfony.git","svn_url":"https://github.com/fabpot/symfony","homepage":"http://symfony.com/","size":79107,"stargazers_count":357,"watchers_count":357,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":0,"forks":49,"open_issues":0,"watchers":357,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"7bc268e8c0f8f313828cf87f211be5b66b4d9452","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","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=3","gravatar_id":"","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}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-12-24T04:34:01Z","pushed_at":"2016-12-24T16:36:40Z","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":81901,"stargazers_count":13511,"watchers_count":13511,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5246,"mirror_url":null,"open_issues_count":880,"forks":5246,"open_issues":880,"watchers":13511,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/21039"},"html":{"href":"https://github.com/symfony/symfony/pull/21039"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/21039"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/21039/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/21039/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/21039/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/eed145d6297eed43ea7bcd33676357ccb44009ad"}}}}
{"actor":{"display_login":"lyrixx"}}