GitHub PullRequestReviewCommentEvent at 2014-07-07 21:30:48
Repository: cakephp
Actor: lorenzo
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/14623899","id":14623899,"diff_hunk":"@@ -0,0 +1,257 @@\n+<?php\n+/**\n+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)\n+ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\n+ *\n+ * Licensed under The MIT License\n+ * For full copyright and license information, please see the LICENSE.txt\n+ * Redistributions of files must retain the above copyright notice.\n+ *\n+ * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\n+ * @link          http://cakephp.org CakePHP(tm) Project\n+ * @since         3.0.0\n+ * @license       http://www.opensource.org/licenses/mit-license.php MIT License\n+ */\n+namespace Cake\\Routing;\n+\n+use Cake\\Core\\App;\n+use Cake\\Error;\n+use Cake\\Routing\\Error\\MissingRouteException;\n+use Cake\\Routing\\Router;\n+use Cake\\Routing\\Route\\Route;\n+use Cake\\Utility\\Inflector;\n+\n+/**\n+ * Contains a collection of routes.\n+ *\n+ * Provides an interface for adding/removing routes\n+ * and parsing/generating URLs with the routes it contains.\n+ *\n+ * @internal\n+ */\n+class RouteCollection {\n+\n+/**\n+ * The routes connected to this collection.\n+ *\n+ * @var array\n+ */\n+\tprotected $_routeTable = [];\n+\n+/**\n+ * The routes connected to this collection.\n+ *\n+ * @var array\n+ */\n+\tprotected $_routes = [];\n+\n+/**\n+ * The hash map of named routes that are in this collection.\n+ *\n+ * @var array\n+ */\n+\tprotected $_named = [];\n+\n+/**\n+ * Add a route to the collection.\n+ *\n+ * @param \\Cake\\Routing\\Route\\Route $route The route object to add.\n+ * @param array $options Addtional options for the route. Primarily for the\n+ *   `_name` option, which enables named routes.\n+ */\n+\tpublic function add(Route $route, $options = []) {\n+\t\t$this->_routes[] = $route;\n+\n+\t\t// Explicit names\n+\t\tif (isset($options['_name'])) {\n+\t\t\t$this->_named[$options['_name']] = $route;\n+\t\t}\n+\n+\t\t// Generated names.\n+\t\t$name = $route->getName();\n+\t\tif (!isset($this->_routeTable[$name])) {\n+\t\t\t$this->_routeTable[$name] = [];\n+\t\t}\n+\t\t$this->_routeTable[$name][] = $route;\n+\n+\t\t// Index path prefixes (for parsing)\n+\t\t$path = $route->staticPath();\n+\t\tif (empty($this->_paths[$path])) {\n+\t\t\t$this->_paths[$path] = [];\n+\t\t\tkrsort($this->_paths);\n+\t\t}\n+\t\t$this->_paths[$path][] = $route;\n+\t}\n+\n+/**\n+ * Takes the URL string and iterates the routes until one is able to parse the route.\n+ *\n+ * @param string $url URL to parse.\n+ * @return array An array of request parameters parsed from the URL.\n+ * @throws \\Cake\\Routing\\Error\\MissingRouteException When a URL has no matching route.\n+ */\n+\tpublic function parse($url) {\n+\t\tforeach (array_keys($this->_paths) as $path) {\n+\t\t\tif (strpos($url, $path) === 0) {","path":"src/Routing/RouteCollection.php","position":95,"original_position":95,"commit_id":"f981c7c8ec97daab3d829501f705101c9b66051f","original_commit_id":"f981c7c8ec97daab3d829501f705101c9b66051f","user":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?","gravatar_id":"5b883d5e78e97a9cf371e0c9b458dc72","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"body":"are paths in $this->_paths sorted by string length? Otherwise we could se false positive matches","created_at":"2014-07-07T21:30:48Z","updated_at":"2014-07-07T21:30:48Z","html_url":"https://github.com/cakephp/cakephp/pull/3898#discussion_r14623899","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/3898","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/14623899"},"html":{"href":"https://github.com/cakephp/cakephp/pull/3898#discussion_r14623899"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/3898"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/3898","id":18044930,"html_url":"https://github.com/cakephp/cakephp/pull/3898","diff_url":"https://github.com/cakephp/cakephp/pull/3898.diff","patch_url":"https://github.com/cakephp/cakephp/pull/3898.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/3898","number":3898,"state":"open","title":"3.0 Router cleanup","user":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?","gravatar_id":"669144d1ab0a861af5d54175371bc586","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"body":"The ScopedRouteCollection class felt a bit messy to me, so I decided to split its roles out into a RouteBuilder and RouteCollection. I also found a few vestigial pieces of code that I removed.\r\n\r\nOne notable change I did was to shuffle the inflection to for prefixes. I don't think it is expected that one would have to use `'prefix' => 'Admin'` in their reverse routing. I'm happy to revert this part of the change, but we will need to update the RouteBuilder and docs accordingly.","created_at":"2014-07-07T13:52:20Z","updated_at":"2014-07-07T21:30:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99052cca428cb725d7298c87c1c34c70d7d93f47","assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/7","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/7/labels","id":453043,"number":7,"title":"3.0.0","description":"New major release that breaks compatibility with 2.x\r\n\r\n- PHP5.4.19+\r\n- New ORM & behaviors.\r\n- Improved Routing\r\n- PSR-0 and composer support.\r\n- Simpler configuration and bootstrapping.\r\n- Improved configuration handling.\r\n- Improved bake.\r\n\r\nSee [the roadmap](http://github.com/cakephp/cakephp/wiki/3.0-roadmap) for more details.","creator":{"login":"lh-import","id":5175817,"avatar_url":"https://avatars.githubusercontent.com/u/5175817?","gravatar_id":"4ef95846cf708177ecfcec8a92325b95","url":"https://api.github.com/users/lh-import","html_url":"https://github.com/lh-import","followers_url":"https://api.github.com/users/lh-import/followers","following_url":"https://api.github.com/users/lh-import/following{/other_user}","gists_url":"https://api.github.com/users/lh-import/gists{/gist_id}","starred_url":"https://api.github.com/users/lh-import/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lh-import/subscriptions","organizations_url":"https://api.github.com/users/lh-import/orgs","repos_url":"https://api.github.com/users/lh-import/repos","events_url":"https://api.github.com/users/lh-import/events{/privacy}","received_events_url":"https://api.github.com/users/lh-import/received_events","type":"User","site_admin":false},"open_issues":45,"closed_issues":847,"state":"open","created_at":"2013-10-11T20:56:23Z","updated_at":"2014-07-07T20:35:14Z","due_on":null},"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/3898/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/3898/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/{number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/3898/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/f981c7c8ec97daab3d829501f705101c9b66051f","head":{"label":"markstory:3.0-route-collection","ref":"3.0-route-collection","sha":"f981c7c8ec97daab3d829501f705101c9b66051f","user":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?","gravatar_id":"669144d1ab0a861af5d54175371bc586","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"repo":{"id":680614,"name":"cakephp","full_name":"markstory/cakephp","owner":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?","gravatar_id":"669144d1ab0a861af5d54175371bc586","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markstory/cakephp","description":"My fork of CakePHP contains volatile code that may be rebased or removed without warning.","fork":true,"url":"https://api.github.com/repos/markstory/cakephp","forks_url":"https://api.github.com/repos/markstory/cakephp/forks","keys_url":"https://api.github.com/repos/markstory/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markstory/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markstory/cakephp/teams","hooks_url":"https://api.github.com/repos/markstory/cakephp/hooks","issue_events_url":"https://api.github.com/repos/markstory/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/markstory/cakephp/events","assignees_url":"https://api.github.com/repos/markstory/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/markstory/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/markstory/cakephp/tags","blobs_url":"https://api.github.com/repos/markstory/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markstory/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markstory/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/markstory/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markstory/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/markstory/cakephp/languages","stargazers_url":"https://api.github.com/repos/markstory/cakephp/stargazers","contributors_url":"https://api.github.com/repos/markstory/cakephp/contributors","subscribers_url":"https://api.github.com/repos/markstory/cakephp/subscribers","subscription_url":"https://api.github.com/repos/markstory/cakephp/subscription","commits_url":"https://api.github.com/repos/markstory/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/markstory/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/markstory/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/markstory/cakephp/issues/comments/{number}","contents_url":"https://api.github.com/repos/markstory/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/markstory/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markstory/cakephp/merges","archive_url":"https://api.github.com/repos/markstory/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markstory/cakephp/downloads","issues_url":"https://api.github.com/repos/markstory/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/markstory/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/markstory/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/markstory/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markstory/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/markstory/cakephp/releases{/id}","created_at":"2010-05-22T14:53:37Z","updated_at":"2014-06-25T04:18:10Z","pushed_at":"2014-07-07T13:48:53Z","git_url":"git://github.com/markstory/cakephp.git","ssh_url":"git@github.com:markstory/cakephp.git","clone_url":"https://github.com/markstory/cakephp.git","svn_url":"https://github.com/markstory/cakephp","homepage":"","size":64292,"stargazers_count":20,"watchers_count":20,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":20,"default_branch":"master"}},"base":{"label":"cakephp:3.0","ref":"3.0","sha":"8860e9b8ab0d5456d26fc9d0023e038c00ea29f5","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?","gravatar_id":"12cd092be901674cdbf0d3d964e945d5","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":656494,"name":"cakephp","full_name":"cakephp/cakephp","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?","gravatar_id":"12cd092be901674cdbf0d3d964e945d5","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":false,"url":"https://api.github.com/repos/cakephp/cakephp","forks_url":"https://api.github.com/repos/cakephp/cakephp/forks","keys_url":"https://api.github.com/repos/cakephp/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/cakephp/teams","hooks_url":"https://api.github.com/repos/cakephp/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cakephp/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/cakephp/events","assignees_url":"https://api.github.com/repos/cakephp/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/cakephp/tags","blobs_url":"https://api.github.com/repos/cakephp/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/cakephp/languages","stargazers_url":"https://api.github.com/repos/cakephp/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cakephp/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cakephp/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cakephp/cakephp/subscription","commits_url":"https://api.github.com/repos/cakephp/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/{number}","contents_url":"https://api.github.com/repos/cakephp/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/cakephp/merges","archive_url":"https://api.github.com/repos/cakephp/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/cakephp/downloads","issues_url":"https://api.github.com/repos/cakephp/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/cakephp/releases{/id}","created_at":"2010-05-08T14:38:22Z","updated_at":"2014-07-07T19:42:52Z","pushed_at":"2014-07-07T20:35:14Z","git_url":"git://github.com/cakephp/cakephp.git","ssh_url":"git@github.com:cakephp/cakephp.git","clone_url":"https://github.com/cakephp/cakephp.git","svn_url":"https://github.com/cakephp/cakephp","homepage":"http://cakephp.org","size":141079,"stargazers_count":4899,"watchers_count":4899,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":2065,"mirror_url":null,"open_issues_count":143,"forks":2065,"open_issues":143,"watchers":4899,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/3898"},"html":{"href":"https://github.com/cakephp/cakephp/pull/3898"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/3898"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/3898/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/3898/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/3898/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/f981c7c8ec97daab3d829501f705101c9b66051f"}}}}