{"action":"created","comment":{"url":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments/59149893","id":59149893,"diff_hunk":"@@ -0,0 +1,336 @@\n+<?php\n+namespace Neos\\RedirectHandler\\Command;\n+\n+/*\n+ * This file is part of the TYPO3.Flow package.\n+ *\n+ * (c) Contributors of the Neos Project - www.neos.io\n+ *\n+ * This package is Open Source Software. For the full copyright and license\n+ * information, please view the LICENSE file which was distributed with this\n+ * source code.\n+ */\n+\n+use League\\Csv\\Reader;\n+use League\\Csv\\Writer;\n+use Neos\\RedirectHandler\\Exception;\n+use Neos\\RedirectHandler\\RedirectInterface;\n+use Neos\\RedirectHandler\\Storage\\RedirectStorageInterface;\n+use TYPO3\\Flow\\Annotations as Flow;\n+use TYPO3\\Flow\\Cli\\CommandController;\n+use TYPO3\\Flow\\Persistence\\PersistenceManagerInterface;\n+use TYPO3\\Flow\\Utility\\Arrays;\n+\n+/**\n+ * Command controller for tasks related to redirects\n+ *\n+ * @Flow\\Scope(\"singleton\")\n+ */\n+class RedirectionCommandController extends CommandController\n+{\n+    /**\n+     * @Flow\\Inject\n+     * @var RedirectStorageInterface\n+     */\n+    protected $redirectStorage;\n+\n+    /**\n+     * @Flow\\Inject\n+     * @var PersistenceManagerInterface\n+     */\n+    protected $persistenceManager;\n+\n+    /**\n+     * @param string $host Filter redirection by the given hostname","path":"Neos.RedirectHandler/Classes/Command/RedirectionCommandController.php","position":44,"original_position":44,"commit_id":"e01b48f2f41f184d81004e7e1d9da68912fc8da6","original_commit_id":"e01b48f2f41f184d81004e7e1d9da68912fc8da6","user":{"login":"aertmann","id":903567,"avatar_url":"https://avatars.githubusercontent.com/u/903567?v=3","gravatar_id":"","url":"https://api.github.com/users/aertmann","html_url":"https://github.com/aertmann","followers_url":"https://api.github.com/users/aertmann/followers","following_url":"https://api.github.com/users/aertmann/following{/other_user}","gists_url":"https://api.github.com/users/aertmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aertmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aertmann/subscriptions","organizations_url":"https://api.github.com/users/aertmann/orgs","repos_url":"https://api.github.com/users/aertmann/repos","events_url":"https://api.github.com/users/aertmann/events{/privacy}","received_events_url":"https://api.github.com/users/aertmann/received_events","type":"User","site_admin":false},"body":"redirects","created_at":"2016-04-11T02:57:47Z","updated_at":"2016-04-11T02:57:47Z","html_url":"https://github.com/neos/flow-development-collection/pull/195#discussion_r59149893","pull_request_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/195","_links":{"self":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments/59149893"},"html":{"href":"https://github.com/neos/flow-development-collection/pull/195#discussion_r59149893"},"pull_request":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/neos/flow-development-collection/pulls/195","id":54983583,"html_url":"https://github.com/neos/flow-development-collection/pull/195","diff_url":"https://github.com/neos/flow-development-collection/pull/195.diff","patch_url":"https://github.com/neos/flow-development-collection/pull/195.patch","issue_url":"https://api.github.com/repos/neos/flow-development-collection/issues/195","number":195,"state":"open","locked":false,"title":"FEATURE: Configurable Redirects","user":{"login":"dfeyer","id":221173,"avatar_url":"https://avatars.githubusercontent.com/u/221173?v=3","gravatar_id":"","url":"https://api.github.com/users/dfeyer","html_url":"https://github.com/dfeyer","followers_url":"https://api.github.com/users/dfeyer/followers","following_url":"https://api.github.com/users/dfeyer/following{/other_user}","gists_url":"https://api.github.com/users/dfeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dfeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfeyer/subscriptions","organizations_url":"https://api.github.com/users/dfeyer/orgs","repos_url":"https://api.github.com/users/dfeyer/repos","events_url":"https://api.github.com/users/dfeyer/events{/privacy}","received_events_url":"https://api.github.com/users/dfeyer/received_events","type":"User","site_admin":false},"body":"Adds a new entity \"Redirection\" and a RedirectionService that enables\r\nbasic administration of redirects.\r\n\r\nThe RedirectionService will be triggered *before* the Routing Framework\r\nkicks in and redirects to any configured target URI if applicable.\r\nIt however is only invoked when no cached route matches the current\r\nrequest. Thus, if a redirection is added, depending route cache entries\r\nare flushed automatically.\r\n\r\nCurrently redirects can only be managed via new commands::\r\n\r\n    ./flow redirection:list\r\n    ./flow redirection:create source/path target/path\r\n    ./flow redirection:remove source/path\r\n    ./flow redirection:removeall\r\n\r\nThe plan is, however, to create them automatically as soon as related\r\nroutes become obsolete due to changed entities for example.\r\n\r\nNEOS-721 #comment basis for fixing the issue","created_at":"2016-01-04T15:05:13Z","updated_at":"2016-04-11T02:57:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c4df0af0f165e8d0a3a17d4702a0be35de6859f","assignee":{"login":"dfeyer","id":221173,"avatar_url":"https://avatars.githubusercontent.com/u/221173?v=3","gravatar_id":"","url":"https://api.github.com/users/dfeyer","html_url":"https://github.com/dfeyer","followers_url":"https://api.github.com/users/dfeyer/followers","following_url":"https://api.github.com/users/dfeyer/following{/other_user}","gists_url":"https://api.github.com/users/dfeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dfeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfeyer/subscriptions","organizations_url":"https://api.github.com/users/dfeyer/orgs","repos_url":"https://api.github.com/users/dfeyer/repos","events_url":"https://api.github.com/users/dfeyer/events{/privacy}","received_events_url":"https://api.github.com/users/dfeyer/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/195/commits","review_comments_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/195/comments","review_comment_url":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neos/flow-development-collection/issues/195/comments","statuses_url":"https://api.github.com/repos/neos/flow-development-collection/statuses/e01b48f2f41f184d81004e7e1d9da68912fc8da6","head":{"label":"dfeyer:configurable-redirects","ref":"configurable-redirects","sha":"e01b48f2f41f184d81004e7e1d9da68912fc8da6","user":{"login":"dfeyer","id":221173,"avatar_url":"https://avatars.githubusercontent.com/u/221173?v=3","gravatar_id":"","url":"https://api.github.com/users/dfeyer","html_url":"https://github.com/dfeyer","followers_url":"https://api.github.com/users/dfeyer/followers","following_url":"https://api.github.com/users/dfeyer/following{/other_user}","gists_url":"https://api.github.com/users/dfeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dfeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfeyer/subscriptions","organizations_url":"https://api.github.com/users/dfeyer/orgs","repos_url":"https://api.github.com/users/dfeyer/repos","events_url":"https://api.github.com/users/dfeyer/events{/privacy}","received_events_url":"https://api.github.com/users/dfeyer/received_events","type":"User","site_admin":false},"repo":{"id":41052870,"name":"flow-development-collection","full_name":"dfeyer/flow-development-collection","owner":{"login":"dfeyer","id":221173,"avatar_url":"https://avatars.githubusercontent.com/u/221173?v=3","gravatar_id":"","url":"https://api.github.com/users/dfeyer","html_url":"https://github.com/dfeyer","followers_url":"https://api.github.com/users/dfeyer/followers","following_url":"https://api.github.com/users/dfeyer/following{/other_user}","gists_url":"https://api.github.com/users/dfeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dfeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfeyer/subscriptions","organizations_url":"https://api.github.com/users/dfeyer/orgs","repos_url":"https://api.github.com/users/dfeyer/repos","events_url":"https://api.github.com/users/dfeyer/events{/privacy}","received_events_url":"https://api.github.com/users/dfeyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dfeyer/flow-development-collection","description":"The unified repository containing the Flow core packages, used for Flow development.","fork":true,"url":"https://api.github.com/repos/dfeyer/flow-development-collection","forks_url":"https://api.github.com/repos/dfeyer/flow-development-collection/forks","keys_url":"https://api.github.com/repos/dfeyer/flow-development-collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dfeyer/flow-development-collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dfeyer/flow-development-collection/teams","hooks_url":"https://api.github.com/repos/dfeyer/flow-development-collection/hooks","issue_events_url":"https://api.github.com/repos/dfeyer/flow-development-collection/issues/events{/number}","events_url":"https://api.github.com/repos/dfeyer/flow-development-collection/events","assignees_url":"https://api.github.com/repos/dfeyer/flow-development-collection/assignees{/user}","branches_url":"https://api.github.com/repos/dfeyer/flow-development-collection/branches{/branch}","tags_url":"https://api.github.com/repos/dfeyer/flow-development-collection/tags","blobs_url":"https://api.github.com/repos/dfeyer/flow-development-collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dfeyer/flow-development-collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dfeyer/flow-development-collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/dfeyer/flow-development-collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dfeyer/flow-development-collection/statuses/{sha}","languages_url":"https://api.github.com/repos/dfeyer/flow-development-collection/languages","stargazers_url":"https://api.github.com/repos/dfeyer/flow-development-collection/stargazers","contributors_url":"https://api.github.com/repos/dfeyer/flow-development-collection/contributors","subscribers_url":"https://api.github.com/repos/dfeyer/flow-development-collection/subscribers","subscription_url":"https://api.github.com/repos/dfeyer/flow-development-collection/subscription","commits_url":"https://api.github.com/repos/dfeyer/flow-development-collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/dfeyer/flow-development-collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/dfeyer/flow-development-collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/dfeyer/flow-development-collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/dfeyer/flow-development-collection/contents/{+path}","compare_url":"https://api.github.com/repos/dfeyer/flow-development-collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dfeyer/flow-development-collection/merges","archive_url":"https://api.github.com/repos/dfeyer/flow-development-collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dfeyer/flow-development-collection/downloads","issues_url":"https://api.github.com/repos/dfeyer/flow-development-collection/issues{/number}","pulls_url":"https://api.github.com/repos/dfeyer/flow-development-collection/pulls{/number}","milestones_url":"https://api.github.com/repos/dfeyer/flow-development-collection/milestones{/number}","notifications_url":"https://api.github.com/repos/dfeyer/flow-development-collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dfeyer/flow-development-collection/labels{/name}","releases_url":"https://api.github.com/repos/dfeyer/flow-development-collection/releases{/id}","deployments_url":"https://api.github.com/repos/dfeyer/flow-development-collection/deployments","created_at":"2015-08-19T18:37:08Z","updated_at":"2016-01-22T13:35:12Z","pushed_at":"2016-04-08T21:14:40Z","git_url":"git://github.com/dfeyer/flow-development-collection.git","ssh_url":"git@github.com:dfeyer/flow-development-collection.git","clone_url":"https://github.com/dfeyer/flow-development-collection.git","svn_url":"https://github.com/dfeyer/flow-development-collection","homepage":null,"size":35194,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"neos:master","ref":"master","sha":"4aa814e91b9f9ff52b93e7c0f0dd42afcb78d5c6","user":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"repo":{"id":40963991,"name":"flow-development-collection","full_name":"neos/flow-development-collection","owner":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neos/flow-development-collection","description":"The unified repository containing the Flow core packages, used for Flow development.","fork":false,"url":"https://api.github.com/repos/neos/flow-development-collection","forks_url":"https://api.github.com/repos/neos/flow-development-collection/forks","keys_url":"https://api.github.com/repos/neos/flow-development-collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neos/flow-development-collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neos/flow-development-collection/teams","hooks_url":"https://api.github.com/repos/neos/flow-development-collection/hooks","issue_events_url":"https://api.github.com/repos/neos/flow-development-collection/issues/events{/number}","events_url":"https://api.github.com/repos/neos/flow-development-collection/events","assignees_url":"https://api.github.com/repos/neos/flow-development-collection/assignees{/user}","branches_url":"https://api.github.com/repos/neos/flow-development-collection/branches{/branch}","tags_url":"https://api.github.com/repos/neos/flow-development-collection/tags","blobs_url":"https://api.github.com/repos/neos/flow-development-collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neos/flow-development-collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neos/flow-development-collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/neos/flow-development-collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neos/flow-development-collection/statuses/{sha}","languages_url":"https://api.github.com/repos/neos/flow-development-collection/languages","stargazers_url":"https://api.github.com/repos/neos/flow-development-collection/stargazers","contributors_url":"https://api.github.com/repos/neos/flow-development-collection/contributors","subscribers_url":"https://api.github.com/repos/neos/flow-development-collection/subscribers","subscription_url":"https://api.github.com/repos/neos/flow-development-collection/subscription","commits_url":"https://api.github.com/repos/neos/flow-development-collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/neos/flow-development-collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/neos/flow-development-collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/neos/flow-development-collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/neos/flow-development-collection/contents/{+path}","compare_url":"https://api.github.com/repos/neos/flow-development-collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neos/flow-development-collection/merges","archive_url":"https://api.github.com/repos/neos/flow-development-collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neos/flow-development-collection/downloads","issues_url":"https://api.github.com/repos/neos/flow-development-collection/issues{/number}","pulls_url":"https://api.github.com/repos/neos/flow-development-collection/pulls{/number}","milestones_url":"https://api.github.com/repos/neos/flow-development-collection/milestones{/number}","notifications_url":"https://api.github.com/repos/neos/flow-development-collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neos/flow-development-collection/labels{/name}","releases_url":"https://api.github.com/repos/neos/flow-development-collection/releases{/id}","deployments_url":"https://api.github.com/repos/neos/flow-development-collection/deployments","created_at":"2015-08-18T09:48:13Z","updated_at":"2016-03-31T13:10:29Z","pushed_at":"2016-04-10T13:19:10Z","git_url":"git://github.com/neos/flow-development-collection.git","ssh_url":"git@github.com:neos/flow-development-collection.git","clone_url":"https://github.com/neos/flow-development-collection.git","svn_url":"https://github.com/neos/flow-development-collection","homepage":"http://flow.typo3.org/","size":35546,"stargazers_count":33,"watchers_count":33,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":34,"forks":63,"open_issues":34,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/195"},"html":{"href":"https://github.com/neos/flow-development-collection/pull/195"},"issue":{"href":"https://api.github.com/repos/neos/flow-development-collection/issues/195"},"comments":{"href":"https://api.github.com/repos/neos/flow-development-collection/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neos/flow-development-collection/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/neos/flow-development-collection/statuses/e01b48f2f41f184d81004e7e1d9da68912fc8da6"}}}}