{"action":"opened","number":50,"pull_request":{"url":"https://api.github.com/repos/nooku/nooku-platform/pulls/50","id":39300517,"html_url":"https://github.com/nooku/nooku-platform/pull/50","diff_url":"https://github.com/nooku/nooku-platform/pull/50.diff","patch_url":"https://github.com/nooku/nooku-platform/pull/50.patch","issue_url":"https://api.github.com/repos/nooku/nooku-platform/issues/50","number":50,"state":"open","locked":false,"title":"Lazy load class registry & allow config to be changed post instantiation","user":{"login":"oligriffiths","id":1246671,"avatar_url":"https://avatars.githubusercontent.com/u/1246671?v=3","gravatar_id":"","url":"https://api.github.com/users/oligriffiths","html_url":"https://github.com/oligriffiths","followers_url":"https://api.github.com/users/oligriffiths/followers","following_url":"https://api.github.com/users/oligriffiths/following{/other_user}","gists_url":"https://api.github.com/users/oligriffiths/gists{/gist_id}","starred_url":"https://api.github.com/users/oligriffiths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oligriffiths/subscriptions","organizations_url":"https://api.github.com/users/oligriffiths/orgs","repos_url":"https://api.github.com/users/oligriffiths/repos","events_url":"https://api.github.com/users/oligriffiths/events{/privacy}","received_events_url":"https://api.github.com/users/oligriffiths/received_events","type":"User","site_admin":false},"body":"So here's the problem.\r\n\r\n`Nooku\\Library\\ClassLoader::getInstance($config)` must be called with the config before any use of the loader. This produces a race condition with composer packages that need to register a namespace for a loader:\r\n\r\n```php\r\nNooku\\Library\\ClassLoader::getInstance()->getLocator('library')->registerNamespace(\r\n    'Nooku\\\\Library', dirname(__FILE__).'/lib'\r\n);\r\n```\r\n\r\nThis causes the class loader to be initialized with no config. Due to the way that composer includes files in the autoload cycle, autoload files for packages are called as part of the `require vendor/autoload.php`. If the class loader is also a composer package, there is no way to configure the loader prior to be being used by other packages. For example, the include path goes as follows:\r\n\r\n* include vendor/autoload.php\r\n* loop autoload files for packages\r\n* include class loader\r\n* include other package that requires class loader and calls `Nooku\\Library\\ClassLoader::getInstance()->getLocator()->registerNamespace()`\r\n* class locator instantiated\r\n* now can't set caching on loader :(\r\n\r\nThis patch allows caching to be enabled prior to any use of the registry.","created_at":"2015-07-06T19:12:50Z","updated_at":"2015-07-06T19:12:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nooku/nooku-platform/pulls/50/commits","review_comments_url":"https://api.github.com/repos/nooku/nooku-platform/pulls/50/comments","review_comment_url":"https://api.github.com/repos/nooku/nooku-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nooku/nooku-platform/issues/50/comments","statuses_url":"https://api.github.com/repos/nooku/nooku-platform/statuses/918d8504ef3447b8beba8f509d1779e6a6318dd2","head":{"label":"oligriffiths:patch/class-loader-registry","ref":"patch/class-loader-registry","sha":"918d8504ef3447b8beba8f509d1779e6a6318dd2","user":{"login":"oligriffiths","id":1246671,"avatar_url":"https://avatars.githubusercontent.com/u/1246671?v=3","gravatar_id":"","url":"https://api.github.com/users/oligriffiths","html_url":"https://github.com/oligriffiths","followers_url":"https://api.github.com/users/oligriffiths/followers","following_url":"https://api.github.com/users/oligriffiths/following{/other_user}","gists_url":"https://api.github.com/users/oligriffiths/gists{/gist_id}","starred_url":"https://api.github.com/users/oligriffiths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oligriffiths/subscriptions","organizations_url":"https://api.github.com/users/oligriffiths/orgs","repos_url":"https://api.github.com/users/oligriffiths/repos","events_url":"https://api.github.com/users/oligriffiths/events{/privacy}","received_events_url":"https://api.github.com/users/oligriffiths/received_events","type":"User","site_admin":false},"repo":{"id":24038114,"name":"nooku-platform","full_name":"oligriffiths/nooku-platform","owner":{"login":"oligriffiths","id":1246671,"avatar_url":"https://avatars.githubusercontent.com/u/1246671?v=3","gravatar_id":"","url":"https://api.github.com/users/oligriffiths","html_url":"https://github.com/oligriffiths","followers_url":"https://api.github.com/users/oligriffiths/followers","following_url":"https://api.github.com/users/oligriffiths/following{/other_user}","gists_url":"https://api.github.com/users/oligriffiths/gists{/gist_id}","starred_url":"https://api.github.com/users/oligriffiths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oligriffiths/subscriptions","organizations_url":"https://api.github.com/users/oligriffiths/orgs","repos_url":"https://api.github.com/users/oligriffiths/repos","events_url":"https://api.github.com/users/oligriffiths/events{/privacy}","received_events_url":"https://api.github.com/users/oligriffiths/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oligriffiths/nooku-platform","description":"Web Application Platform","fork":true,"url":"https://api.github.com/repos/oligriffiths/nooku-platform","forks_url":"https://api.github.com/repos/oligriffiths/nooku-platform/forks","keys_url":"https://api.github.com/repos/oligriffiths/nooku-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oligriffiths/nooku-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oligriffiths/nooku-platform/teams","hooks_url":"https://api.github.com/repos/oligriffiths/nooku-platform/hooks","issue_events_url":"https://api.github.com/repos/oligriffiths/nooku-platform/issues/events{/number}","events_url":"https://api.github.com/repos/oligriffiths/nooku-platform/events","assignees_url":"https://api.github.com/repos/oligriffiths/nooku-platform/assignees{/user}","branches_url":"https://api.github.com/repos/oligriffiths/nooku-platform/branches{/branch}","tags_url":"https://api.github.com/repos/oligriffiths/nooku-platform/tags","blobs_url":"https://api.github.com/repos/oligriffiths/nooku-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oligriffiths/nooku-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oligriffiths/nooku-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/oligriffiths/nooku-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oligriffiths/nooku-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/oligriffiths/nooku-platform/languages","stargazers_url":"https://api.github.com/repos/oligriffiths/nooku-platform/stargazers","contributors_url":"https://api.github.com/repos/oligriffiths/nooku-platform/contributors","subscribers_url":"https://api.github.com/repos/oligriffiths/nooku-platform/subscribers","subscription_url":"https://api.github.com/repos/oligriffiths/nooku-platform/subscription","commits_url":"https://api.github.com/repos/oligriffiths/nooku-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/oligriffiths/nooku-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/oligriffiths/nooku-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/oligriffiths/nooku-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/oligriffiths/nooku-platform/contents/{+path}","compare_url":"https://api.github.com/repos/oligriffiths/nooku-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oligriffiths/nooku-platform/merges","archive_url":"https://api.github.com/repos/oligriffiths/nooku-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oligriffiths/nooku-platform/downloads","issues_url":"https://api.github.com/repos/oligriffiths/nooku-platform/issues{/number}","pulls_url":"https://api.github.com/repos/oligriffiths/nooku-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/oligriffiths/nooku-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/oligriffiths/nooku-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oligriffiths/nooku-platform/labels{/name}","releases_url":"https://api.github.com/repos/oligriffiths/nooku-platform/releases{/id}","created_at":"2014-09-15T01:14:57Z","updated_at":"2015-03-04T20:45:42Z","pushed_at":"2015-07-06T19:04:16Z","git_url":"git://github.com/oligriffiths/nooku-platform.git","ssh_url":"git@github.com:oligriffiths/nooku-platform.git","clone_url":"https://github.com/oligriffiths/nooku-platform.git","svn_url":"https://github.com/oligriffiths/nooku-platform","homepage":"http://www.nooku.org/platform","size":33374,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"nooku:develop","ref":"develop","sha":"efd7628081cde1d7c54793dda414ae2d864696e8","user":{"login":"nooku","id":266658,"avatar_url":"https://avatars.githubusercontent.com/u/266658?v=3","gravatar_id":"","url":"https://api.github.com/users/nooku","html_url":"https://github.com/nooku","followers_url":"https://api.github.com/users/nooku/followers","following_url":"https://api.github.com/users/nooku/following{/other_user}","gists_url":"https://api.github.com/users/nooku/gists{/gist_id}","starred_url":"https://api.github.com/users/nooku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nooku/subscriptions","organizations_url":"https://api.github.com/users/nooku/orgs","repos_url":"https://api.github.com/users/nooku/repos","events_url":"https://api.github.com/users/nooku/events{/privacy}","received_events_url":"https://api.github.com/users/nooku/received_events","type":"Organization","site_admin":false},"repo":{"id":19697680,"name":"nooku-platform","full_name":"nooku/nooku-platform","owner":{"login":"nooku","id":266658,"avatar_url":"https://avatars.githubusercontent.com/u/266658?v=3","gravatar_id":"","url":"https://api.github.com/users/nooku","html_url":"https://github.com/nooku","followers_url":"https://api.github.com/users/nooku/followers","following_url":"https://api.github.com/users/nooku/following{/other_user}","gists_url":"https://api.github.com/users/nooku/gists{/gist_id}","starred_url":"https://api.github.com/users/nooku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nooku/subscriptions","organizations_url":"https://api.github.com/users/nooku/orgs","repos_url":"https://api.github.com/users/nooku/repos","events_url":"https://api.github.com/users/nooku/events{/privacy}","received_events_url":"https://api.github.com/users/nooku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nooku/nooku-platform","description":"Web Application Platform","fork":false,"url":"https://api.github.com/repos/nooku/nooku-platform","forks_url":"https://api.github.com/repos/nooku/nooku-platform/forks","keys_url":"https://api.github.com/repos/nooku/nooku-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nooku/nooku-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nooku/nooku-platform/teams","hooks_url":"https://api.github.com/repos/nooku/nooku-platform/hooks","issue_events_url":"https://api.github.com/repos/nooku/nooku-platform/issues/events{/number}","events_url":"https://api.github.com/repos/nooku/nooku-platform/events","assignees_url":"https://api.github.com/repos/nooku/nooku-platform/assignees{/user}","branches_url":"https://api.github.com/repos/nooku/nooku-platform/branches{/branch}","tags_url":"https://api.github.com/repos/nooku/nooku-platform/tags","blobs_url":"https://api.github.com/repos/nooku/nooku-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nooku/nooku-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nooku/nooku-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/nooku/nooku-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nooku/nooku-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/nooku/nooku-platform/languages","stargazers_url":"https://api.github.com/repos/nooku/nooku-platform/stargazers","contributors_url":"https://api.github.com/repos/nooku/nooku-platform/contributors","subscribers_url":"https://api.github.com/repos/nooku/nooku-platform/subscribers","subscription_url":"https://api.github.com/repos/nooku/nooku-platform/subscription","commits_url":"https://api.github.com/repos/nooku/nooku-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/nooku/nooku-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/nooku/nooku-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/nooku/nooku-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/nooku/nooku-platform/contents/{+path}","compare_url":"https://api.github.com/repos/nooku/nooku-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nooku/nooku-platform/merges","archive_url":"https://api.github.com/repos/nooku/nooku-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nooku/nooku-platform/downloads","issues_url":"https://api.github.com/repos/nooku/nooku-platform/issues{/number}","pulls_url":"https://api.github.com/repos/nooku/nooku-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/nooku/nooku-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/nooku/nooku-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nooku/nooku-platform/labels{/name}","releases_url":"https://api.github.com/repos/nooku/nooku-platform/releases{/id}","created_at":"2014-05-12T12:24:13Z","updated_at":"2015-06-30T07:46:21Z","pushed_at":"2015-07-06T16:28:04Z","git_url":"git://github.com/nooku/nooku-platform.git","ssh_url":"git@github.com:nooku/nooku-platform.git","clone_url":"https://github.com/nooku/nooku-platform.git","svn_url":"https://github.com/nooku/nooku-platform","homepage":"http://www.nooku.org/platform","size":34636,"stargazers_count":31,"watchers_count":31,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":17,"forks":11,"open_issues":17,"watchers":31,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/nooku/nooku-platform/pulls/50"},"html":{"href":"https://github.com/nooku/nooku-platform/pull/50"},"issue":{"href":"https://api.github.com/repos/nooku/nooku-platform/issues/50"},"comments":{"href":"https://api.github.com/repos/nooku/nooku-platform/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/nooku/nooku-platform/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/nooku/nooku-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nooku/nooku-platform/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/nooku/nooku-platform/statuses/918d8504ef3447b8beba8f509d1779e6a6318dd2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":82,"deletions":6,"changed_files":1}}