{"action":"created","comment":{"url":"https://api.github.com/repos/roundcube/roundcubemail/pulls/comments/23211337","id":23211337,"diff_hunk":"@@ -93,6 +93,10 @@ protected function startup()\n             $this->filename = $basename;\n         }\n \n+        // load all configured plugins\n+        $this->plugins->load_plugins((array)$this->config->get('plugins', array()),","path":"program/include/rcmail.php","position":5,"original_position":5,"commit_id":"7e1a6f05d74c64d082f20aac81a6c879867aa402","original_commit_id":"7e1a6f05d74c64d082f20aac81a6c879867aa402","user":{"login":"corbosman","id":1389007,"avatar_url":"https://avatars.githubusercontent.com/u/1389007?v=3","gravatar_id":"","url":"https://api.github.com/users/corbosman","html_url":"https://github.com/corbosman","followers_url":"https://api.github.com/users/corbosman/followers","following_url":"https://api.github.com/users/corbosman/following{/other_user}","gists_url":"https://api.github.com/users/corbosman/gists{/gist_id}","starred_url":"https://api.github.com/users/corbosman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corbosman/subscriptions","organizations_url":"https://api.github.com/users/corbosman/orgs","repos_url":"https://api.github.com/users/corbosman/repos","events_url":"https://api.github.com/users/corbosman/events{/privacy}","received_events_url":"https://api.github.com/users/corbosman/received_events","type":"User","site_admin":false},"body":"Im not sure what you mean. Isnt that the whole point? \r\n\r\nLoad plugins is called early, but with the understanding that if you use an onload() method it wont have access to $task and other variables.  Then initialisation of the plugins, where task is checked, is defered until a later step. So $plugin->init(); in load_plugin is actually not called during the load_plugins() phase of the plugin system initialisation. \r\n\r\nThen later in rcmail.php $this->plugins->init($this, $this->task); is called where plugins have access to $task. \r\n\r\nI probably just dont understand your comment, so please elaborate which code path is going to fail and i'll be happy to fix it if possible. \r\n","created_at":"2015-01-20T09:42:54Z","updated_at":"2015-01-20T09:42:54Z","html_url":"https://github.com/roundcube/roundcubemail/pull/259#discussion_r23211337","pull_request_url":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259","_links":{"self":{"href":"https://api.github.com/repos/roundcube/roundcubemail/pulls/comments/23211337"},"html":{"href":"https://github.com/roundcube/roundcubemail/pull/259#discussion_r23211337"},"pull_request":{"href":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259"}}},"pull_request":{"url":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259","id":26917966,"html_url":"https://github.com/roundcube/roundcubemail/pull/259","diff_url":"https://github.com/roundcube/roundcubemail/pull/259.diff","patch_url":"https://github.com/roundcube/roundcubemail/pull/259.patch","issue_url":"https://api.github.com/repos/roundcube/roundcubemail/issues/259","number":259,"state":"open","locked":false,"title":"Plugin preload","user":{"login":"corbosman","id":1389007,"avatar_url":"https://avatars.githubusercontent.com/u/1389007?v=3","gravatar_id":"","url":"https://api.github.com/users/corbosman","html_url":"https://github.com/corbosman","followers_url":"https://api.github.com/users/corbosman/followers","following_url":"https://api.github.com/users/corbosman/following{/other_user}","gists_url":"https://api.github.com/users/corbosman/gists{/gist_id}","starred_url":"https://api.github.com/users/corbosman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corbosman/subscriptions","organizations_url":"https://api.github.com/users/corbosman/orgs","repos_url":"https://api.github.com/users/corbosman/repos","events_url":"https://api.github.com/users/corbosman/events{/privacy}","received_events_url":"https://api.github.com/users/corbosman/received_events","type":"User","site_admin":false},"body":"I think this may be a solution for allowing plugins to load before sessions.\r\n\r\nIve introduced an rcube_plugins variable name $preload, which tells the plugin code to load this plugin early. Default is false, and then it gets loaded as it is now. If you set $preload in your plugin, you accept that all kinds of variables are not yet initialised, including $task and $app->output. \r\n\r\nI also had to account for $force, so ive also introduced a variable named $initialised, which tells the second phase of plugin init which plugins were already initialised in round 1. \r\n\r\nI think my logic with regards to noajax/noframe etc is ok, but please check. \r\n\r\nThis PR would replace PR roundcube/roundcubemail#125\r\n\r\nSince I need this code in my PR roundcube/roundcubemail#257 please let me know if you prefer this PR separate or if I should add it there since it's kind of related. \r\n\r\n\r\n","created_at":"2015-01-06T21:07:37Z","updated_at":"2015-01-20T09:42:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1e49865faf5e0bb38d7d051f134f58fa8b7a896","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259/commits","review_comments_url":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259/comments","review_comment_url":"https://api.github.com/repos/roundcube/roundcubemail/pulls/comments/{number}","comments_url":"https://api.github.com/repos/roundcube/roundcubemail/issues/259/comments","statuses_url":"https://api.github.com/repos/roundcube/roundcubemail/statuses/7e1a6f05d74c64d082f20aac81a6c879867aa402","head":{"label":"corbosman:plugin_preload","ref":"plugin_preload","sha":"7e1a6f05d74c64d082f20aac81a6c879867aa402","user":{"login":"corbosman","id":1389007,"avatar_url":"https://avatars.githubusercontent.com/u/1389007?v=3","gravatar_id":"","url":"https://api.github.com/users/corbosman","html_url":"https://github.com/corbosman","followers_url":"https://api.github.com/users/corbosman/followers","following_url":"https://api.github.com/users/corbosman/following{/other_user}","gists_url":"https://api.github.com/users/corbosman/gists{/gist_id}","starred_url":"https://api.github.com/users/corbosman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corbosman/subscriptions","organizations_url":"https://api.github.com/users/corbosman/orgs","repos_url":"https://api.github.com/users/corbosman/repos","events_url":"https://api.github.com/users/corbosman/events{/privacy}","received_events_url":"https://api.github.com/users/corbosman/received_events","type":"User","site_admin":false},"repo":{"id":28812261,"name":"roundcubemail","full_name":"corbosman/roundcubemail","owner":{"login":"corbosman","id":1389007,"avatar_url":"https://avatars.githubusercontent.com/u/1389007?v=3","gravatar_id":"","url":"https://api.github.com/users/corbosman","html_url":"https://github.com/corbosman","followers_url":"https://api.github.com/users/corbosman/followers","following_url":"https://api.github.com/users/corbosman/following{/other_user}","gists_url":"https://api.github.com/users/corbosman/gists{/gist_id}","starred_url":"https://api.github.com/users/corbosman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corbosman/subscriptions","organizations_url":"https://api.github.com/users/corbosman/orgs","repos_url":"https://api.github.com/users/corbosman/repos","events_url":"https://api.github.com/users/corbosman/events{/privacy}","received_events_url":"https://api.github.com/users/corbosman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/corbosman/roundcubemail","description":"The Roundcube Webmail suite","fork":true,"url":"https://api.github.com/repos/corbosman/roundcubemail","forks_url":"https://api.github.com/repos/corbosman/roundcubemail/forks","keys_url":"https://api.github.com/repos/corbosman/roundcubemail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corbosman/roundcubemail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corbosman/roundcubemail/teams","hooks_url":"https://api.github.com/repos/corbosman/roundcubemail/hooks","issue_events_url":"https://api.github.com/repos/corbosman/roundcubemail/issues/events{/number}","events_url":"https://api.github.com/repos/corbosman/roundcubemail/events","assignees_url":"https://api.github.com/repos/corbosman/roundcubemail/assignees{/user}","branches_url":"https://api.github.com/repos/corbosman/roundcubemail/branches{/branch}","tags_url":"https://api.github.com/repos/corbosman/roundcubemail/tags","blobs_url":"https://api.github.com/repos/corbosman/roundcubemail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corbosman/roundcubemail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corbosman/roundcubemail/git/refs{/sha}","trees_url":"https://api.github.com/repos/corbosman/roundcubemail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corbosman/roundcubemail/statuses/{sha}","languages_url":"https://api.github.com/repos/corbosman/roundcubemail/languages","stargazers_url":"https://api.github.com/repos/corbosman/roundcubemail/stargazers","contributors_url":"https://api.github.com/repos/corbosman/roundcubemail/contributors","subscribers_url":"https://api.github.com/repos/corbosman/roundcubemail/subscribers","subscription_url":"https://api.github.com/repos/corbosman/roundcubemail/subscription","commits_url":"https://api.github.com/repos/corbosman/roundcubemail/commits{/sha}","git_commits_url":"https://api.github.com/repos/corbosman/roundcubemail/git/commits{/sha}","comments_url":"https://api.github.com/repos/corbosman/roundcubemail/comments{/number}","issue_comment_url":"https://api.github.com/repos/corbosman/roundcubemail/issues/comments/{number}","contents_url":"https://api.github.com/repos/corbosman/roundcubemail/contents/{+path}","compare_url":"https://api.github.com/repos/corbosman/roundcubemail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corbosman/roundcubemail/merges","archive_url":"https://api.github.com/repos/corbosman/roundcubemail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corbosman/roundcubemail/downloads","issues_url":"https://api.github.com/repos/corbosman/roundcubemail/issues{/number}","pulls_url":"https://api.github.com/repos/corbosman/roundcubemail/pulls{/number}","milestones_url":"https://api.github.com/repos/corbosman/roundcubemail/milestones{/number}","notifications_url":"https://api.github.com/repos/corbosman/roundcubemail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corbosman/roundcubemail/labels{/name}","releases_url":"https://api.github.com/repos/corbosman/roundcubemail/releases{/id}","created_at":"2015-01-05T12:48:10Z","updated_at":"2015-01-05T12:48:16Z","pushed_at":"2015-01-09T11:57:44Z","git_url":"git://github.com/corbosman/roundcubemail.git","ssh_url":"git@github.com:corbosman/roundcubemail.git","clone_url":"https://github.com/corbosman/roundcubemail.git","svn_url":"https://github.com/corbosman/roundcubemail","homepage":"http://roundcube.net","size":35795,"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":"master"}},"base":{"label":"roundcube:master","ref":"master","sha":"fe653e312206f57b0937193d8f7be46518a619d2","user":{"login":"roundcube","id":1432918,"avatar_url":"https://avatars.githubusercontent.com/u/1432918?v=3","gravatar_id":"","url":"https://api.github.com/users/roundcube","html_url":"https://github.com/roundcube","followers_url":"https://api.github.com/users/roundcube/followers","following_url":"https://api.github.com/users/roundcube/following{/other_user}","gists_url":"https://api.github.com/users/roundcube/gists{/gist_id}","starred_url":"https://api.github.com/users/roundcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roundcube/subscriptions","organizations_url":"https://api.github.com/users/roundcube/orgs","repos_url":"https://api.github.com/users/roundcube/repos","events_url":"https://api.github.com/users/roundcube/events{/privacy}","received_events_url":"https://api.github.com/users/roundcube/received_events","type":"Organization","site_admin":false},"repo":{"id":4224042,"name":"roundcubemail","full_name":"roundcube/roundcubemail","owner":{"login":"roundcube","id":1432918,"avatar_url":"https://avatars.githubusercontent.com/u/1432918?v=3","gravatar_id":"","url":"https://api.github.com/users/roundcube","html_url":"https://github.com/roundcube","followers_url":"https://api.github.com/users/roundcube/followers","following_url":"https://api.github.com/users/roundcube/following{/other_user}","gists_url":"https://api.github.com/users/roundcube/gists{/gist_id}","starred_url":"https://api.github.com/users/roundcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roundcube/subscriptions","organizations_url":"https://api.github.com/users/roundcube/orgs","repos_url":"https://api.github.com/users/roundcube/repos","events_url":"https://api.github.com/users/roundcube/events{/privacy}","received_events_url":"https://api.github.com/users/roundcube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/roundcube/roundcubemail","description":"The Roundcube Webmail suite","fork":false,"url":"https://api.github.com/repos/roundcube/roundcubemail","forks_url":"https://api.github.com/repos/roundcube/roundcubemail/forks","keys_url":"https://api.github.com/repos/roundcube/roundcubemail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roundcube/roundcubemail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roundcube/roundcubemail/teams","hooks_url":"https://api.github.com/repos/roundcube/roundcubemail/hooks","issue_events_url":"https://api.github.com/repos/roundcube/roundcubemail/issues/events{/number}","events_url":"https://api.github.com/repos/roundcube/roundcubemail/events","assignees_url":"https://api.github.com/repos/roundcube/roundcubemail/assignees{/user}","branches_url":"https://api.github.com/repos/roundcube/roundcubemail/branches{/branch}","tags_url":"https://api.github.com/repos/roundcube/roundcubemail/tags","blobs_url":"https://api.github.com/repos/roundcube/roundcubemail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roundcube/roundcubemail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roundcube/roundcubemail/git/refs{/sha}","trees_url":"https://api.github.com/repos/roundcube/roundcubemail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roundcube/roundcubemail/statuses/{sha}","languages_url":"https://api.github.com/repos/roundcube/roundcubemail/languages","stargazers_url":"https://api.github.com/repos/roundcube/roundcubemail/stargazers","contributors_url":"https://api.github.com/repos/roundcube/roundcubemail/contributors","subscribers_url":"https://api.github.com/repos/roundcube/roundcubemail/subscribers","subscription_url":"https://api.github.com/repos/roundcube/roundcubemail/subscription","commits_url":"https://api.github.com/repos/roundcube/roundcubemail/commits{/sha}","git_commits_url":"https://api.github.com/repos/roundcube/roundcubemail/git/commits{/sha}","comments_url":"https://api.github.com/repos/roundcube/roundcubemail/comments{/number}","issue_comment_url":"https://api.github.com/repos/roundcube/roundcubemail/issues/comments/{number}","contents_url":"https://api.github.com/repos/roundcube/roundcubemail/contents/{+path}","compare_url":"https://api.github.com/repos/roundcube/roundcubemail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roundcube/roundcubemail/merges","archive_url":"https://api.github.com/repos/roundcube/roundcubemail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roundcube/roundcubemail/downloads","issues_url":"https://api.github.com/repos/roundcube/roundcubemail/issues{/number}","pulls_url":"https://api.github.com/repos/roundcube/roundcubemail/pulls{/number}","milestones_url":"https://api.github.com/repos/roundcube/roundcubemail/milestones{/number}","notifications_url":"https://api.github.com/repos/roundcube/roundcubemail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roundcube/roundcubemail/labels{/name}","releases_url":"https://api.github.com/repos/roundcube/roundcubemail/releases{/id}","created_at":"2012-05-04T11:19:01Z","updated_at":"2015-01-20T09:37:15Z","pushed_at":"2015-01-20T09:37:14Z","git_url":"git://github.com/roundcube/roundcubemail.git","ssh_url":"git@github.com:roundcube/roundcubemail.git","clone_url":"https://github.com/roundcube/roundcubemail.git","svn_url":"https://github.com/roundcube/roundcubemail","homepage":"http://roundcube.net","size":58195,"stargazers_count":1229,"watchers_count":1229,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":497,"mirror_url":null,"open_issues_count":18,"forks":497,"open_issues":18,"watchers":1229,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259"},"html":{"href":"https://github.com/roundcube/roundcubemail/pull/259"},"issue":{"href":"https://api.github.com/repos/roundcube/roundcubemail/issues/259"},"comments":{"href":"https://api.github.com/repos/roundcube/roundcubemail/issues/259/comments"},"review_comments":{"href":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259/comments"},"review_comment":{"href":"https://api.github.com/repos/roundcube/roundcubemail/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/roundcube/roundcubemail/pulls/259/commits"},"statuses":{"href":"https://api.github.com/repos/roundcube/roundcubemail/statuses/7e1a6f05d74c64d082f20aac81a6c879867aa402"}}}}