{"action":"created","issue":{"url":"https://api.github.com/repos/bolt/bolt/issues/2529","labels_url":"https://api.github.com/repos/bolt/bolt/issues/2529/labels{/name}","comments_url":"https://api.github.com/repos/bolt/bolt/issues/2529/comments","events_url":"https://api.github.com/repos/bolt/bolt/issues/2529/events","html_url":"https://github.com/bolt/bolt/pull/2529","id":55183597,"number":2529,"title":"Refactor Config::getWhichEnd() to work with PHP CLI Server and use Symfony Req Object","user":{"login":"caseyamcl","id":53035,"avatar_url":"https://avatars.githubusercontent.com/u/53035?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyamcl","html_url":"https://github.com/caseyamcl","followers_url":"https://api.github.com/users/caseyamcl/followers","following_url":"https://api.github.com/users/caseyamcl/following{/other_user}","gists_url":"https://api.github.com/users/caseyamcl/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyamcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyamcl/subscriptions","organizations_url":"https://api.github.com/users/caseyamcl/orgs","repos_url":"https://api.github.com/users/caseyamcl/repos","events_url":"https://api.github.com/users/caseyamcl/events{/privacy}","received_events_url":"https://api.github.com/users/caseyamcl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-22T17:32:44Z","updated_at":"2015-01-25T20:08:20Z","closed_at":"2015-01-25T18:40:23Z","pull_request":{"url":"https://api.github.com/repos/bolt/bolt/pulls/2529","html_url":"https://github.com/bolt/bolt/pull/2529","diff_url":"https://github.com/bolt/bolt/pull/2529.diff","patch_url":"https://github.com/bolt/bolt/pull/2529.patch"},"body":"The `Config::getWhichEnd()` method relies some custom logic that uses the `$_SERVER` superglobal to determine which 'end' of the application is being used.  I propose instead using the Symfony `Request` object, since it does a better job of determining path information for various environments.\r\n\r\nIf the `$app['request']` hasn't been initialized yet, we can create a local copy of the Symfony `Request` object using `createFromGlobals()`.  This will ensure that the `getWhichEnd()` uses the same HTTP interpretation logic that the routing does.\r\n\r\nThis benefits of this pull request include:\r\n\r\n- simplifies the code in the `getWhichEnd()` method, and\r\n- fixes an issue where certain pages in the admin section throw \"missing Twig template\" errors; specifically pages where the URI ends with a file extension (e.g. `/bolt/file/edit/app/config/contenttypes.yml`).  This error occurs when using the PHP built-in webserver"},"comment":{"url":"https://api.github.com/repos/bolt/bolt/issues/comments/71390086","html_url":"https://github.com/bolt/bolt/pull/2529#issuecomment-71390086","issue_url":"https://api.github.com/repos/bolt/bolt/issues/2529","id":71390086,"user":{"login":"GawainLynch","id":1427081,"avatar_url":"https://avatars.githubusercontent.com/u/1427081?v=3","gravatar_id":"","url":"https://api.github.com/users/GawainLynch","html_url":"https://github.com/GawainLynch","followers_url":"https://api.github.com/users/GawainLynch/followers","following_url":"https://api.github.com/users/GawainLynch/following{/other_user}","gists_url":"https://api.github.com/users/GawainLynch/gists{/gist_id}","starred_url":"https://api.github.com/users/GawainLynch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GawainLynch/subscriptions","organizations_url":"https://api.github.com/users/GawainLynch/orgs","repos_url":"https://api.github.com/users/GawainLynch/repos","events_url":"https://api.github.com/users/GawainLynch/events{/privacy}","received_events_url":"https://api.github.com/users/GawainLynch/received_events","type":"User","site_admin":false},"created_at":"2015-01-25T20:08:20Z","updated_at":"2015-01-25T20:08:20Z","body":"@caseyamcl & @CarsonF, what versions of PHP are you testing on?\r\n\r\nc.f. #1351"}}