{"action":"created","comment":{"url":"https://api.github.com/repos/bolt/bolt/pulls/comments/93646963","pull_request_review_id":14178706,"id":93646963,"diff_hunk":"@@ -124,9 +124,13 @@ public function add(ExtensionInterface $extension, DirectoryInterface $baseDir =\n         // Set paths in the extension\n         if ($baseDir !== null) {\n             $extension->setBaseDirectory($baseDir);\n+        } else {\n+            $extension->setBaseDirectory($this->extFs->getDir($extension->getId()));","path":"src/Extension/Manager.php","position":5,"original_position":5,"commit_id":"1a9ed02fc45cf17b53ae8131346d85cfea2d47fe","original_commit_id":"1a9ed02fc45cf17b53ae8131346d85cfea2d47fe","user":{"login":"CarsonF","id":932566,"avatar_url":"https://avatars.githubusercontent.com/u/932566?v=3","gravatar_id":"","url":"https://api.github.com/users/CarsonF","html_url":"https://github.com/CarsonF","followers_url":"https://api.github.com/users/CarsonF/followers","following_url":"https://api.github.com/users/CarsonF/following{/other_user}","gists_url":"https://api.github.com/users/CarsonF/gists{/gist_id}","starred_url":"https://api.github.com/users/CarsonF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarsonF/subscriptions","organizations_url":"https://api.github.com/users/CarsonF/orgs","repos_url":"https://api.github.com/users/CarsonF/repos","events_url":"https://api.github.com/users/CarsonF/events{/privacy}","received_events_url":"https://api.github.com/users/CarsonF/received_events","type":"User","site_admin":false},"body":"I think it would make more sense to flip the condition here and skip the else block. \r\n```php\r\nif ($baseDir === null) {\r\n    $baseDir = $this->extFs->getDir($extension->getId());\r\n}\r\n$extension->setBaseDirectory($baseDir);\r\n```","created_at":"2016-12-22T15:53:22Z","updated_at":"2016-12-22T16:02:04Z","html_url":"https://github.com/bolt/bolt/pull/6170#discussion_r93646963","pull_request_url":"https://api.github.com/repos/bolt/bolt/pulls/6170","_links":{"self":{"href":"https://api.github.com/repos/bolt/bolt/pulls/comments/93646963"},"html":{"href":"https://github.com/bolt/bolt/pull/6170#discussion_r93646963"},"pull_request":{"href":"https://api.github.com/repos/bolt/bolt/pulls/6170"}}},"pull_request":{"url":"https://api.github.com/repos/bolt/bolt/pulls/6170","id":97937929,"html_url":"https://github.com/bolt/bolt/pull/6170","diff_url":"https://github.com/bolt/bolt/pull/6170.diff","patch_url":"https://github.com/bolt/bolt/pull/6170.patch","issue_url":"https://api.github.com/repos/bolt/bolt/issues/6170","number":6170,"state":"open","locked":false,"title":"Local Extension Replacement","user":{"login":"rossriley","id":5082,"avatar_url":"https://avatars.githubusercontent.com/u/5082?v=3","gravatar_id":"","url":"https://api.github.com/users/rossriley","html_url":"https://github.com/rossriley","followers_url":"https://api.github.com/users/rossriley/followers","following_url":"https://api.github.com/users/rossriley/following{/other_user}","gists_url":"https://api.github.com/users/rossriley/gists{/gist_id}","starred_url":"https://api.github.com/users/rossriley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossriley/subscriptions","organizations_url":"https://api.github.com/users/rossriley/orgs","repos_url":"https://api.github.com/users/rossriley/repos","events_url":"https://api.github.com/users/rossriley/events{/privacy}","received_events_url":"https://api.github.com/users/rossriley/received_events","type":"User","site_admin":false},"body":"OK, sorry this took longer than I wanted, had to do some rejigging after the recent extension boot changes.\r\n\r\nThis adds two new ways to use extensions. Firstly you can register extensions at an application level, that is ones that can be autoloaded via your root composer.json. To do this in your bootstrap, or anywhere else prior to the `$app->initialize()` call:\r\n\r\n```\r\n$app['extension']->register(new MyApp\\Extensions\\CleverExtension());\r\n```\r\n\r\nWe also add a new root namespace for extensions that are found at `extensions/local`, these can't be instantiated until the extension boot process so these must be registered by class name. If you use a php bootstrap this works like:\r\n\r\n```\r\n#bolt.php\r\n...\r\n// This will load a class that is found at extensions/local/MyLocalExtension/ImageProcessExtension.php\r\n$app['extension']->register('MyLocalExtension\\ImageProcessExtension');\r\n...\r\n```\r\n\r\nMore normally for those using the `yml` bootstrap config we add support for an extensions array\r\n\r\n```\r\n#bolt.yml\r\n\r\npaths:\r\n    web: public\r\n    themebase: public/theme\r\n    files: public/files\r\n    view: public/bolt-public/view\r\nextensions:\r\n    - MyextOne\\LocalExtensionOne\r\n    - MyextTwo\\LocalExtensionTwo\r\n    - MyextThree\\LocalExtensionThree\r\n```\r\n\r\nThe above example will load classes found at `extensions/local/MyextOne/LocalExtensionOne.php`, `extensions/local/MyextTwo/LocalExtensionTwo.php` and `extensions/local/MyextThree/LocalExtensionThree.php` respectively.\r\n\r\nAfter this happens then the extensions will load normally and can have identical functionality to traditionally loaded extensions with two important distinctions.\r\n\r\n1. They do not appear in the extensions UI\r\n2. There's no magic for asset copying, local extensions are responsible for putting their assets in the right place, by default this will be at `public/extensions/<response of ->getId()>`\r\n\r\n## Edited With Updated Syntax\r\n\r\nInternally everything now uses the extension add method so the above bolt.php code is replaced with this:\r\n\r\n```\r\n#bolt.php\r\n...\r\n// This will load a class that is found at extensions/local/MyLocalExtension/ImageProcessExtension.php\r\n$app['extensions']->add(new MyLocalExtension\\ImageProcessExtension());\r\n...\r\n```\r\n\r\nThe extension will also be instantiable since the autoload for extensions is now included in the constructor.\r\n","created_at":"2016-12-14T11:54:11Z","updated_at":"2016-12-22T16:02:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd509429ada780d2cd23aacb12861079edfe9171","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bolt/bolt/pulls/6170/commits","review_comments_url":"https://api.github.com/repos/bolt/bolt/pulls/6170/comments","review_comment_url":"https://api.github.com/repos/bolt/bolt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bolt/bolt/issues/6170/comments","statuses_url":"https://api.github.com/repos/bolt/bolt/statuses/1a9ed02fc45cf17b53ae8131346d85cfea2d47fe","head":{"label":"rossriley:feature/extension-queue","ref":"feature/extension-queue","sha":"1a9ed02fc45cf17b53ae8131346d85cfea2d47fe","user":{"login":"rossriley","id":5082,"avatar_url":"https://avatars.githubusercontent.com/u/5082?v=3","gravatar_id":"","url":"https://api.github.com/users/rossriley","html_url":"https://github.com/rossriley","followers_url":"https://api.github.com/users/rossriley/followers","following_url":"https://api.github.com/users/rossriley/following{/other_user}","gists_url":"https://api.github.com/users/rossriley/gists{/gist_id}","starred_url":"https://api.github.com/users/rossriley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossriley/subscriptions","organizations_url":"https://api.github.com/users/rossriley/orgs","repos_url":"https://api.github.com/users/rossriley/repos","events_url":"https://api.github.com/users/rossriley/events{/privacy}","received_events_url":"https://api.github.com/users/rossriley/received_events","type":"User","site_admin":false},"repo":{"id":19492823,"name":"bolt","full_name":"rossriley/bolt","owner":{"login":"rossriley","id":5082,"avatar_url":"https://avatars.githubusercontent.com/u/5082?v=3","gravatar_id":"","url":"https://api.github.com/users/rossriley","html_url":"https://github.com/rossriley","followers_url":"https://api.github.com/users/rossriley/followers","following_url":"https://api.github.com/users/rossriley/following{/other_user}","gists_url":"https://api.github.com/users/rossriley/gists{/gist_id}","starred_url":"https://api.github.com/users/rossriley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossriley/subscriptions","organizations_url":"https://api.github.com/users/rossriley/orgs","repos_url":"https://api.github.com/users/rossriley/repos","events_url":"https://api.github.com/users/rossriley/events{/privacy}","received_events_url":"https://api.github.com/users/rossriley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rossriley/bolt","description":"Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.","fork":true,"url":"https://api.github.com/repos/rossriley/bolt","forks_url":"https://api.github.com/repos/rossriley/bolt/forks","keys_url":"https://api.github.com/repos/rossriley/bolt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rossriley/bolt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rossriley/bolt/teams","hooks_url":"https://api.github.com/repos/rossriley/bolt/hooks","issue_events_url":"https://api.github.com/repos/rossriley/bolt/issues/events{/number}","events_url":"https://api.github.com/repos/rossriley/bolt/events","assignees_url":"https://api.github.com/repos/rossriley/bolt/assignees{/user}","branches_url":"https://api.github.com/repos/rossriley/bolt/branches{/branch}","tags_url":"https://api.github.com/repos/rossriley/bolt/tags","blobs_url":"https://api.github.com/repos/rossriley/bolt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rossriley/bolt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rossriley/bolt/git/refs{/sha}","trees_url":"https://api.github.com/repos/rossriley/bolt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rossriley/bolt/statuses/{sha}","languages_url":"https://api.github.com/repos/rossriley/bolt/languages","stargazers_url":"https://api.github.com/repos/rossriley/bolt/stargazers","contributors_url":"https://api.github.com/repos/rossriley/bolt/contributors","subscribers_url":"https://api.github.com/repos/rossriley/bolt/subscribers","subscription_url":"https://api.github.com/repos/rossriley/bolt/subscription","commits_url":"https://api.github.com/repos/rossriley/bolt/commits{/sha}","git_commits_url":"https://api.github.com/repos/rossriley/bolt/git/commits{/sha}","comments_url":"https://api.github.com/repos/rossriley/bolt/comments{/number}","issue_comment_url":"https://api.github.com/repos/rossriley/bolt/issues/comments{/number}","contents_url":"https://api.github.com/repos/rossriley/bolt/contents/{+path}","compare_url":"https://api.github.com/repos/rossriley/bolt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rossriley/bolt/merges","archive_url":"https://api.github.com/repos/rossriley/bolt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rossriley/bolt/downloads","issues_url":"https://api.github.com/repos/rossriley/bolt/issues{/number}","pulls_url":"https://api.github.com/repos/rossriley/bolt/pulls{/number}","milestones_url":"https://api.github.com/repos/rossriley/bolt/milestones{/number}","notifications_url":"https://api.github.com/repos/rossriley/bolt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rossriley/bolt/labels{/name}","releases_url":"https://api.github.com/repos/rossriley/bolt/releases{/id}","deployments_url":"https://api.github.com/repos/rossriley/bolt/deployments","created_at":"2014-05-06T12:12:06Z","updated_at":"2016-01-28T09:32:21Z","pushed_at":"2016-12-22T13:21:22Z","git_url":"git://github.com/rossriley/bolt.git","ssh_url":"git@github.com:rossriley/bolt.git","clone_url":"https://github.com/rossriley/bolt.git","svn_url":"https://github.com/rossriley/bolt","homepage":"","size":66361,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"bolt:release/3.3","ref":"release/3.3","sha":"380ef9947b82fe0d0b981846b6c02d666ec4a501","user":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"repo":{"id":4665416,"name":"bolt","full_name":"bolt/bolt","owner":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bolt/bolt","description":"Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.","fork":false,"url":"https://api.github.com/repos/bolt/bolt","forks_url":"https://api.github.com/repos/bolt/bolt/forks","keys_url":"https://api.github.com/repos/bolt/bolt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bolt/bolt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bolt/bolt/teams","hooks_url":"https://api.github.com/repos/bolt/bolt/hooks","issue_events_url":"https://api.github.com/repos/bolt/bolt/issues/events{/number}","events_url":"https://api.github.com/repos/bolt/bolt/events","assignees_url":"https://api.github.com/repos/bolt/bolt/assignees{/user}","branches_url":"https://api.github.com/repos/bolt/bolt/branches{/branch}","tags_url":"https://api.github.com/repos/bolt/bolt/tags","blobs_url":"https://api.github.com/repos/bolt/bolt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bolt/bolt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bolt/bolt/git/refs{/sha}","trees_url":"https://api.github.com/repos/bolt/bolt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bolt/bolt/statuses/{sha}","languages_url":"https://api.github.com/repos/bolt/bolt/languages","stargazers_url":"https://api.github.com/repos/bolt/bolt/stargazers","contributors_url":"https://api.github.com/repos/bolt/bolt/contributors","subscribers_url":"https://api.github.com/repos/bolt/bolt/subscribers","subscription_url":"https://api.github.com/repos/bolt/bolt/subscription","commits_url":"https://api.github.com/repos/bolt/bolt/commits{/sha}","git_commits_url":"https://api.github.com/repos/bolt/bolt/git/commits{/sha}","comments_url":"https://api.github.com/repos/bolt/bolt/comments{/number}","issue_comment_url":"https://api.github.com/repos/bolt/bolt/issues/comments{/number}","contents_url":"https://api.github.com/repos/bolt/bolt/contents/{+path}","compare_url":"https://api.github.com/repos/bolt/bolt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bolt/bolt/merges","archive_url":"https://api.github.com/repos/bolt/bolt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bolt/bolt/downloads","issues_url":"https://api.github.com/repos/bolt/bolt/issues{/number}","pulls_url":"https://api.github.com/repos/bolt/bolt/pulls{/number}","milestones_url":"https://api.github.com/repos/bolt/bolt/milestones{/number}","notifications_url":"https://api.github.com/repos/bolt/bolt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bolt/bolt/labels{/name}","releases_url":"https://api.github.com/repos/bolt/bolt/releases{/id}","deployments_url":"https://api.github.com/repos/bolt/bolt/deployments","created_at":"2012-06-14T16:07:54Z","updated_at":"2016-12-21T21:27:24Z","pushed_at":"2016-12-22T13:21:24Z","git_url":"git://github.com/bolt/bolt.git","ssh_url":"git@github.com:bolt/bolt.git","clone_url":"https://github.com/bolt/bolt.git","svn_url":"https://github.com/bolt/bolt","homepage":"","size":66951,"stargazers_count":3064,"watchers_count":3064,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":703,"mirror_url":null,"open_issues_count":158,"forks":703,"open_issues":158,"watchers":3064,"default_branch":"release/3.2"}},"_links":{"self":{"href":"https://api.github.com/repos/bolt/bolt/pulls/6170"},"html":{"href":"https://github.com/bolt/bolt/pull/6170"},"issue":{"href":"https://api.github.com/repos/bolt/bolt/issues/6170"},"comments":{"href":"https://api.github.com/repos/bolt/bolt/issues/6170/comments"},"review_comments":{"href":"https://api.github.com/repos/bolt/bolt/pulls/6170/comments"},"review_comment":{"href":"https://api.github.com/repos/bolt/bolt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bolt/bolt/pulls/6170/commits"},"statuses":{"href":"https://api.github.com/repos/bolt/bolt/statuses/1a9ed02fc45cf17b53ae8131346d85cfea2d47fe"}}}}
{"actor":{"display_login":"CarsonF"}}