{"action":"created","issue":{"url":"https://api.github.com/repos/vanilla/vanilla/issues/4160","repository_url":"https://api.github.com/repos/vanilla/vanilla","labels_url":"https://api.github.com/repos/vanilla/vanilla/issues/4160/labels{/name}","comments_url":"https://api.github.com/repos/vanilla/vanilla/issues/4160/comments","events_url":"https://api.github.com/repos/vanilla/vanilla/issues/4160/events","html_url":"https://github.com/vanilla/vanilla/pull/4160","id":163740985,"number":4160,"title":"Gdn_Dispatcher untagling, part 2","user":{"login":"tburry","id":97432,"avatar_url":"https://avatars.githubusercontent.com/u/97432?v=3","gravatar_id":"","url":"https://api.github.com/users/tburry","html_url":"https://github.com/tburry","followers_url":"https://api.github.com/users/tburry/followers","following_url":"https://api.github.com/users/tburry/following{/other_user}","gists_url":"https://api.github.com/users/tburry/gists{/gist_id}","starred_url":"https://api.github.com/users/tburry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tburry/subscriptions","organizations_url":"https://api.github.com/users/tburry/orgs","repos_url":"https://api.github.com/users/tburry/repos","events_url":"https://api.github.com/users/tburry/events{/privacy}","received_events_url":"https://api.github.com/users/tburry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vanilla/vanilla/labels/Awaiting%20Feedback","name":"Awaiting Feedback","color":"d93f0b"},{"url":"https://api.github.com/repos/vanilla/vanilla/labels/Blocker","name":"Blocker","color":"b60205"},{"url":"https://api.github.com/repos/vanilla/vanilla/labels/Needs%20Testing","name":"Needs Testing","color":"b60205"},{"url":"https://api.github.com/repos/vanilla/vanilla/labels/Overdue","name":"Overdue","color":"b60205"}],"state":"open","locked":false,"assignee":{"login":"linc","id":117672,"avatar_url":"https://avatars.githubusercontent.com/u/117672?v=3","gravatar_id":"","url":"https://api.github.com/users/linc","html_url":"https://github.com/linc","followers_url":"https://api.github.com/users/linc/followers","following_url":"https://api.github.com/users/linc/following{/other_user}","gists_url":"https://api.github.com/users/linc/gists{/gist_id}","starred_url":"https://api.github.com/users/linc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linc/subscriptions","organizations_url":"https://api.github.com/users/linc/orgs","repos_url":"https://api.github.com/users/linc/repos","events_url":"https://api.github.com/users/linc/events{/privacy}","received_events_url":"https://api.github.com/users/linc/received_events","type":"User","site_admin":false},"assignees":[{"login":"linc","id":117672,"avatar_url":"https://avatars.githubusercontent.com/u/117672?v=3","gravatar_id":"","url":"https://api.github.com/users/linc","html_url":"https://github.com/linc","followers_url":"https://api.github.com/users/linc/followers","following_url":"https://api.github.com/users/linc/following{/other_user}","gists_url":"https://api.github.com/users/linc/gists{/gist_id}","starred_url":"https://api.github.com/users/linc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linc/subscriptions","organizations_url":"https://api.github.com/users/linc/orgs","repos_url":"https://api.github.com/users/linc/repos","events_url":"https://api.github.com/users/linc/events{/privacy}","received_events_url":"https://api.github.com/users/linc/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/vanilla/vanilla/milestones/35","html_url":"https://github.com/vanilla/vanilla/milestones/Sprint%2018","labels_url":"https://api.github.com/repos/vanilla/vanilla/milestones/35/labels","id":1859975,"number":35,"title":"Sprint 18","description":"API: Endpoints.","creator":{"login":"linc","id":117672,"avatar_url":"https://avatars.githubusercontent.com/u/117672?v=3","gravatar_id":"","url":"https://api.github.com/users/linc","html_url":"https://github.com/linc","followers_url":"https://api.github.com/users/linc/followers","following_url":"https://api.github.com/users/linc/following{/other_user}","gists_url":"https://api.github.com/users/linc/gists{/gist_id}","starred_url":"https://api.github.com/users/linc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linc/subscriptions","organizations_url":"https://api.github.com/users/linc/orgs","repos_url":"https://api.github.com/users/linc/repos","events_url":"https://api.github.com/users/linc/events{/privacy}","received_events_url":"https://api.github.com/users/linc/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":6,"state":"open","created_at":"2016-07-01T14:44:18Z","updated_at":"2016-08-02T14:55:42Z","due_on":"2016-08-13T04:00:00Z","closed_at":null},"comments":11,"created_at":"2016-07-04T20:45:53Z","updated_at":"2016-08-02T15:12:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vanilla/vanilla/pulls/4160","html_url":"https://github.com/vanilla/vanilla/pull/4160","diff_url":"https://github.com/vanilla/vanilla/pull/4160.diff","patch_url":"https://github.com/vanilla/vanilla/pull/4160.patch"},"body":"This is a fairly big refactor, but is really only moving things out of large methods into smaller methods.\r\n\r\nThere is a bit of a methodology change too where controllers are discovered before their methods are examined. This mirrors where the dispatcher is going even though it currently doesn’t serve much of a great purpose.\r\n\r\nI recommend walking through the code to review this PR, starting at Gdn_Dispatcher->dispatch(). You should be able to see the logic of a dispatch more clearly now:\r\n\r\n1. Check to see if the application is in update mode.\r\n2. Check for GDN_Route URL rewrites.\r\n3. Check against private communities.\r\n4. Analyze the request, looking for a controller.\r\n5. Dispatch to that controller.\r\n\r\n    a) Instantiate the controller.\r\n    b) Look for the method to dispatch to.\r\n    c) Reflect the method's arguments.\r\n    d) Call the controller method.\r\n\r\nThere are two risks with this PR that will need special attention:\r\n\r\n**Lost events.** I may have missed a copy-paste of a call to fireEvent or missed the arguments necessary. You can compare dispatcher events by logging them to the debug bar:\r\n\r\n```php\r\npublic function Base_All_Handler($Sender, $Args, $Key) {\r\n        $ajaxBreakEvents = array(\r\n            'Gdn_Controller_Finalize_Handler',\r\n            'Gdn_Dispatcher_Cleanup_Handler',\r\n            'Base_Render_Before'\r\n        );\r\n\r\n        if (in_array($Key, $ajaxBreakEvents)) {\r\n            return;\r\n        }\r\n\r\n        unset($Args['WildEventStack']);\r\n        Logger::debug($Key, $Args);\r\n    }\r\n```\r\n\r\n**Different controller properties.** The dispatcher sets a tonne of controller properties. I'd dump the controller out just before calling its method on master and this branch and compare the properties. They should be the *exact* same or let me know.\r\n\r\n### TODO\r\n\r\n- [x] Support querystring passthrough.\r\n- [ ] Support case-insensitive delivery type, delivery method."},"comment":{"url":"https://api.github.com/repos/vanilla/vanilla/issues/comments/236935738","html_url":"https://github.com/vanilla/vanilla/pull/4160#issuecomment-236935738","issue_url":"https://api.github.com/repos/vanilla/vanilla/issues/4160","id":236935738,"user":{"login":"tburry","id":97432,"avatar_url":"https://avatars.githubusercontent.com/u/97432?v=3","gravatar_id":"","url":"https://api.github.com/users/tburry","html_url":"https://github.com/tburry","followers_url":"https://api.github.com/users/tburry/followers","following_url":"https://api.github.com/users/tburry/following{/other_user}","gists_url":"https://api.github.com/users/tburry/gists{/gist_id}","starred_url":"https://api.github.com/users/tburry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tburry/subscriptions","organizations_url":"https://api.github.com/users/tburry/orgs","repos_url":"https://api.github.com/users/tburry/repos","events_url":"https://api.github.com/users/tburry/events{/privacy}","received_events_url":"https://api.github.com/users/tburry/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T15:12:03Z","updated_at":"2016-08-02T15:12:03Z","body":"Good catch; fixed."}}
{"actor":{"display_login":"tburry"}}