{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/comments/138851974","pull_request_review_id":62701910,"id":138851974,"diff_hunk":"@@ -0,0 +1,196 @@\n+<?php\n+\n+/** @var rex_addon $this */\n+\n+/* setup process */\n+\n+if (rex_post('install', 'boolean')) {\n+\n+    $errors = array();\n+\n+    // step 1/5: select missing packages we need to download\n+    $missingPackages = array();\n+    $packages = $this->getProperty('setup')['packages'];\n+    if (count($packages) > 0) {\n+\n+        // fetch list of available packages from to redaxo webservice\n+        try {\n+            $packagesFromInstaller = rex_install_packages::getAddPackages();\n+        } catch (rex_functional_exception $e) {\n+            $errors[] = $e->getMessage();\n+        }\n+\n+        foreach ($packages as $id => $fileId) {\n+\n+            $localPackage = rex_package::get($id);\n+            if ($localPackage->isSystemPackage()) {\n+                continue;\n+            }\n+\n+            $installerPackage = $packagesFromInstaller[$id]['files'][$fileId];\n+            if (!$installerPackage) {\n+                $errors[] = $this->i18n('package_not_available', $id);\n+            }\n+\n+            if ($localPackage->getVersion() !== $installerPackage['version']) {\n+                $missingPackages[$id] = $fileId;\n+            }\n+        }\n+    }\n+\n+    // step 2/5: download required packages\n+    if (count($missingPackages) > 0 && count($errors) == 0) {\n+        foreach ($missingPackages as $id => $fileId) {\n+\n+            $installerPackage = $packagesFromInstaller[$id]['files'][$fileId];\n+            if ($installerPackage) {\n+\n+                // fetch package\n+                try {\n+                    $archivefile = rex_install_webservice::getArchive($installerPackage['path']);\n+                } catch (rex_functional_exception $e) {\n+                    $errors[] = $this->i18n('package_failed_to_download', $id);","path":"pages/install.php","position":null,"original_position":52,"commit_id":"333d8ae8a4d4a433f7d7f7b487d7fa1eee741ef1","original_commit_id":"5b486e2c42026939baa764e4a7c63916592390b6","user":{"login":"schuer","id":1297466,"avatar_url":"https://avatars2.githubusercontent.com/u/1297466?v=4","gravatar_id":"","url":"https://api.github.com/users/schuer","html_url":"https://github.com/schuer","followers_url":"https://api.github.com/users/schuer/followers","following_url":"https://api.github.com/users/schuer/following{/other_user}","gists_url":"https://api.github.com/users/schuer/gists{/gist_id}","starred_url":"https://api.github.com/users/schuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuer/subscriptions","organizations_url":"https://api.github.com/users/schuer/orgs","repos_url":"https://api.github.com/users/schuer/repos","events_url":"https://api.github.com/users/schuer/events{/privacy}","received_events_url":"https://api.github.com/users/schuer/received_events","type":"User","site_admin":false},"body":"Erledigt, danke!","created_at":"2017-09-14T10:14:17Z","updated_at":"2017-09-14T10:14:17Z","html_url":"https://github.com/FriendsOfREDAXO/demo_base/pull/56#discussion_r138851974","pull_request_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/comments/138851974"},"html":{"href":"https://github.com/FriendsOfREDAXO/demo_base/pull/56#discussion_r138851974"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56"}},"in_reply_to_id":138323194},"pull_request":{"url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56","id":139792760,"html_url":"https://github.com/FriendsOfREDAXO/demo_base/pull/56","diff_url":"https://github.com/FriendsOfREDAXO/demo_base/pull/56.diff","patch_url":"https://github.com/FriendsOfREDAXO/demo_base/pull/56.patch","issue_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues/56","number":56,"state":"open","locked":false,"title":"Automatisches Setup","user":{"login":"schuer","id":1297466,"avatar_url":"https://avatars2.githubusercontent.com/u/1297466?v=4","gravatar_id":"","url":"https://api.github.com/users/schuer","html_url":"https://github.com/schuer","followers_url":"https://api.github.com/users/schuer/followers","following_url":"https://api.github.com/users/schuer/following{/other_user}","gists_url":"https://api.github.com/users/schuer/gists{/gist_id}","starred_url":"https://api.github.com/users/schuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuer/subscriptions","organizations_url":"https://api.github.com/users/schuer/orgs","repos_url":"https://api.github.com/users/schuer/repos","events_url":"https://api.github.com/users/schuer/events{/privacy}","received_events_url":"https://api.github.com/users/schuer/received_events","type":"User","site_admin":false},"body":"Lädt benötigte AddOns runter und installiert sie, importiert die Datenbank und die Assets.\r\n\r\nEin paar Anmerkungen:\r\n1. Damit die Demo installiert werden kann, noch bevor alle benötigten AddOns installiert worden sind, ist es notwendig, die Dependencies auszuschalten. Deshalb wurden die Dependencies in eine **separate Config** ausgelagert und werden erst bei der Installation der Demo in deren `package.yml` gemerged.\r\n2. In der neuen Config befinden sich Angaben zu **konkreten Versionen** (`fileId`) der benötigten AddOns. Das deshalb, weil die Prüfung der Versionsbedingungen (matchVersionConstraints) aktuell nur mit bereits vorhandenen AddOns funktioniert, nicht aber mit solchen, die erst noch heruntergeladen werden müssen. Man kann also die vorhandenen Versionen im Installer nicht so einfach aus der Ferne prüfen. Ein weiterer Grund für die Verwendung der fileIds ist, dass die Demo einen kompletten Datenbankstand importiert und damit schnell in Gefahr läuft, mit aktuellen Versionen eines AddOns nicht richtig zu funktionieren. Das hatten wir neulich beim Redactor, der neue Datenbankfelder eingeführt hatte. Ich finde es deshalb robuster — und nebenbei auch viel einfacher —, spezifische Versionen in der Config zu hinterlegen.\r\n3. In der Config muss außerdem die **Installationsreihenfolge** der AddOns angegeben werden, um Konflikte zu vermeiden. Diese muss manuell geprüft werden. Macht es wiederum deutlich einfacher und robuster, als wenn wir einen Auto-Konfliktlöser hätten implementieren müssen.\r\n\r\nIch hoffe, es funktioniert alles wie geplant. Wäre prima, wenn ein paar von euch mal draufschauen und testen könnten.\r\n\r\n![setup](https://user-images.githubusercontent.com/1297466/30163644-f395a19c-93d9-11e7-9d96-e0ff037ab288.jpg)","created_at":"2017-09-07T12:31:26Z","updated_at":"2017-09-14T10:14:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35fbc2048ac494827d34ed22634912c3a8574fba","assignee":null,"assignees":[],"requested_reviewers":[{"login":"polarpixel","id":330160,"avatar_url":"https://avatars0.githubusercontent.com/u/330160?v=4","gravatar_id":"","url":"https://api.github.com/users/polarpixel","html_url":"https://github.com/polarpixel","followers_url":"https://api.github.com/users/polarpixel/followers","following_url":"https://api.github.com/users/polarpixel/following{/other_user}","gists_url":"https://api.github.com/users/polarpixel/gists{/gist_id}","starred_url":"https://api.github.com/users/polarpixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polarpixel/subscriptions","organizations_url":"https://api.github.com/users/polarpixel/orgs","repos_url":"https://api.github.com/users/polarpixel/repos","events_url":"https://api.github.com/users/polarpixel/events{/privacy}","received_events_url":"https://api.github.com/users/polarpixel/received_events","type":"User","site_admin":false},{"login":"gharlan","id":330436,"avatar_url":"https://avatars0.githubusercontent.com/u/330436?v=4","gravatar_id":"","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},{"login":"tbaddade","id":338267,"avatar_url":"https://avatars0.githubusercontent.com/u/338267?v=4","gravatar_id":"","url":"https://api.github.com/users/tbaddade","html_url":"https://github.com/tbaddade","followers_url":"https://api.github.com/users/tbaddade/followers","following_url":"https://api.github.com/users/tbaddade/following{/other_user}","gists_url":"https://api.github.com/users/tbaddade/gists{/gist_id}","starred_url":"https://api.github.com/users/tbaddade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbaddade/subscriptions","organizations_url":"https://api.github.com/users/tbaddade/orgs","repos_url":"https://api.github.com/users/tbaddade/repos","events_url":"https://api.github.com/users/tbaddade/events{/privacy}","received_events_url":"https://api.github.com/users/tbaddade/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56/commits","review_comments_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56/comments","review_comment_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues/56/comments","statuses_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/statuses/333d8ae8a4d4a433f7d7f7b487d7fa1eee741ef1","head":{"label":"schuer:schuer-pr-2","ref":"schuer-pr-2","sha":"333d8ae8a4d4a433f7d7f7b487d7fa1eee741ef1","user":{"login":"schuer","id":1297466,"avatar_url":"https://avatars2.githubusercontent.com/u/1297466?v=4","gravatar_id":"","url":"https://api.github.com/users/schuer","html_url":"https://github.com/schuer","followers_url":"https://api.github.com/users/schuer/followers","following_url":"https://api.github.com/users/schuer/following{/other_user}","gists_url":"https://api.github.com/users/schuer/gists{/gist_id}","starred_url":"https://api.github.com/users/schuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuer/subscriptions","organizations_url":"https://api.github.com/users/schuer/orgs","repos_url":"https://api.github.com/users/schuer/repos","events_url":"https://api.github.com/users/schuer/events{/privacy}","received_events_url":"https://api.github.com/users/schuer/received_events","type":"User","site_admin":false},"repo":{"id":100612713,"name":"demo_base","full_name":"schuer/demo_base","owner":{"login":"schuer","id":1297466,"avatar_url":"https://avatars2.githubusercontent.com/u/1297466?v=4","gravatar_id":"","url":"https://api.github.com/users/schuer","html_url":"https://github.com/schuer","followers_url":"https://api.github.com/users/schuer/followers","following_url":"https://api.github.com/users/schuer/following{/other_user}","gists_url":"https://api.github.com/users/schuer/gists{/gist_id}","starred_url":"https://api.github.com/users/schuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuer/subscriptions","organizations_url":"https://api.github.com/users/schuer/orgs","repos_url":"https://api.github.com/users/schuer/repos","events_url":"https://api.github.com/users/schuer/events{/privacy}","received_events_url":"https://api.github.com/users/schuer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schuer/demo_base","description":"Demonstriert eine umfangreiche Website auf Basis von REDAXO 5.","fork":true,"url":"https://api.github.com/repos/schuer/demo_base","forks_url":"https://api.github.com/repos/schuer/demo_base/forks","keys_url":"https://api.github.com/repos/schuer/demo_base/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schuer/demo_base/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schuer/demo_base/teams","hooks_url":"https://api.github.com/repos/schuer/demo_base/hooks","issue_events_url":"https://api.github.com/repos/schuer/demo_base/issues/events{/number}","events_url":"https://api.github.com/repos/schuer/demo_base/events","assignees_url":"https://api.github.com/repos/schuer/demo_base/assignees{/user}","branches_url":"https://api.github.com/repos/schuer/demo_base/branches{/branch}","tags_url":"https://api.github.com/repos/schuer/demo_base/tags","blobs_url":"https://api.github.com/repos/schuer/demo_base/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schuer/demo_base/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schuer/demo_base/git/refs{/sha}","trees_url":"https://api.github.com/repos/schuer/demo_base/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schuer/demo_base/statuses/{sha}","languages_url":"https://api.github.com/repos/schuer/demo_base/languages","stargazers_url":"https://api.github.com/repos/schuer/demo_base/stargazers","contributors_url":"https://api.github.com/repos/schuer/demo_base/contributors","subscribers_url":"https://api.github.com/repos/schuer/demo_base/subscribers","subscription_url":"https://api.github.com/repos/schuer/demo_base/subscription","commits_url":"https://api.github.com/repos/schuer/demo_base/commits{/sha}","git_commits_url":"https://api.github.com/repos/schuer/demo_base/git/commits{/sha}","comments_url":"https://api.github.com/repos/schuer/demo_base/comments{/number}","issue_comment_url":"https://api.github.com/repos/schuer/demo_base/issues/comments{/number}","contents_url":"https://api.github.com/repos/schuer/demo_base/contents/{+path}","compare_url":"https://api.github.com/repos/schuer/demo_base/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schuer/demo_base/merges","archive_url":"https://api.github.com/repos/schuer/demo_base/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schuer/demo_base/downloads","issues_url":"https://api.github.com/repos/schuer/demo_base/issues{/number}","pulls_url":"https://api.github.com/repos/schuer/demo_base/pulls{/number}","milestones_url":"https://api.github.com/repos/schuer/demo_base/milestones{/number}","notifications_url":"https://api.github.com/repos/schuer/demo_base/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schuer/demo_base/labels{/name}","releases_url":"https://api.github.com/repos/schuer/demo_base/releases{/id}","deployments_url":"https://api.github.com/repos/schuer/demo_base/deployments","created_at":"2017-08-17T14:32:22Z","updated_at":"2017-08-17T14:32:24Z","pushed_at":"2017-09-14T10:10:51Z","git_url":"git://github.com/schuer/demo_base.git","ssh_url":"git@github.com:schuer/demo_base.git","clone_url":"https://github.com/schuer/demo_base.git","svn_url":"https://github.com/schuer/demo_base","homepage":"","size":54804,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FriendsOfREDAXO:master","ref":"master","sha":"882a669978fe5c192eacff77e62b7f6f632e37d8","user":{"login":"FriendsOfREDAXO","id":19146931,"avatar_url":"https://avatars2.githubusercontent.com/u/19146931?v=4","gravatar_id":"","url":"https://api.github.com/users/FriendsOfREDAXO","html_url":"https://github.com/FriendsOfREDAXO","followers_url":"https://api.github.com/users/FriendsOfREDAXO/followers","following_url":"https://api.github.com/users/FriendsOfREDAXO/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfREDAXO/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfREDAXO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfREDAXO/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfREDAXO/orgs","repos_url":"https://api.github.com/users/FriendsOfREDAXO/repos","events_url":"https://api.github.com/users/FriendsOfREDAXO/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfREDAXO/received_events","type":"Organization","site_admin":false},"repo":{"id":48368469,"name":"demo_base","full_name":"FriendsOfREDAXO/demo_base","owner":{"login":"FriendsOfREDAXO","id":19146931,"avatar_url":"https://avatars2.githubusercontent.com/u/19146931?v=4","gravatar_id":"","url":"https://api.github.com/users/FriendsOfREDAXO","html_url":"https://github.com/FriendsOfREDAXO","followers_url":"https://api.github.com/users/FriendsOfREDAXO/followers","following_url":"https://api.github.com/users/FriendsOfREDAXO/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfREDAXO/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfREDAXO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfREDAXO/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfREDAXO/orgs","repos_url":"https://api.github.com/users/FriendsOfREDAXO/repos","events_url":"https://api.github.com/users/FriendsOfREDAXO/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfREDAXO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FriendsOfREDAXO/demo_base","description":"Demonstriert eine umfangreiche Website auf Basis von REDAXO 5.","fork":false,"url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base","forks_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/forks","keys_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/teams","hooks_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/hooks","issue_events_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues/events{/number}","events_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/events","assignees_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/assignees{/user}","branches_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/branches{/branch}","tags_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/tags","blobs_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/git/refs{/sha}","trees_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/statuses/{sha}","languages_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/languages","stargazers_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/stargazers","contributors_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/contributors","subscribers_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/subscribers","subscription_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/subscription","commits_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/commits{/sha}","git_commits_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/git/commits{/sha}","comments_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/comments{/number}","issue_comment_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues/comments{/number}","contents_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/contents/{+path}","compare_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/merges","archive_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/downloads","issues_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues{/number}","pulls_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls{/number}","milestones_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/milestones{/number}","notifications_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/labels{/name}","releases_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/releases{/id}","deployments_url":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/deployments","created_at":"2015-12-21T11:35:29Z","updated_at":"2017-07-25T00:55:08Z","pushed_at":"2017-09-14T10:10:53Z","git_url":"git://github.com/FriendsOfREDAXO/demo_base.git","ssh_url":"git@github.com:FriendsOfREDAXO/demo_base.git","clone_url":"https://github.com/FriendsOfREDAXO/demo_base.git","svn_url":"https://github.com/FriendsOfREDAXO/demo_base","homepage":"","size":54796,"stargazers_count":25,"watchers_count":25,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56"},"html":{"href":"https://github.com/FriendsOfREDAXO/demo_base/pull/56"},"issue":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues/56"},"comments":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfREDAXO/demo_base/statuses/333d8ae8a4d4a433f7d7f7b487d7fa1eee741ef1"}},"author_association":"OWNER"}}
{"actor":{"display_login":"schuer"}}