{"action":"created","comment":{"url":"https://api.github.com/repos/friendica/friendica/pulls/comments/84564984","pull_request_review_id":5338856,"id":84564984,"diff_hunk":"@@ -132,15 +132,33 @@ public static function set($family,$key,$value) {\n \t\t$dbvalue = (is_array($value)?serialize($value):$value);\n \t\t$dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);\n \n-\t\t$ret = q(\"INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' )\n-ON DUPLICATE KEY UPDATE `v` = '%s'\",\n+\t\t// The \"INSERT\" command is very cost intense. It saves performance to do it this way.\n+\t\t$ret = q(\"SELECT `v` FROM `config` WHERE `cat` = '%s' AND `k` = '%s' ORDER BY `id` DESC LIMIT 1\",\n \t\t\tdbesc($family),\n-\t\t\tdbesc($key),\n-\t\t\tdbesc($dbvalue),\n-\t\t\tdbesc($dbvalue)\n+\t\t\tdbesc($key)\n \t\t);\n+\n+\t\t// It would be better to use the dbm class.\n+\t\t// But there is an autoloader issue that I don't know how to fix:\n+\t\t// \"Class 'Friendica\\Core\\dbm' not found\"\n+\t\t//if (!dbm::is_result($ret))","path":"include/Core/Config.php","position":null,"original_position":18,"commit_id":"bc324c3ef466c786a1b3e7375fecd505f00b5288","original_commit_id":"e2d35bd8519e34c931fb007be3ec8c16821366b6","user":{"login":"Hypolite","id":925415,"avatar_url":"https://avatars.githubusercontent.com/u/925415?v=3","gravatar_id":"","url":"https://api.github.com/users/Hypolite","html_url":"https://github.com/Hypolite","followers_url":"https://api.github.com/users/Hypolite/followers","following_url":"https://api.github.com/users/Hypolite/following{/other_user}","gists_url":"https://api.github.com/users/Hypolite/gists{/gist_id}","starred_url":"https://api.github.com/users/Hypolite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hypolite/subscriptions","organizations_url":"https://api.github.com/users/Hypolite/orgs","repos_url":"https://api.github.com/users/Hypolite/repos","events_url":"https://api.github.com/users/Hypolite/events{/privacy}","received_events_url":"https://api.github.com/users/Hypolite/received_events","type":"User","site_admin":false},"body":"There currently is a conflict between using the namespace syntax and the `require_once(\"include/dbm.php\")`. Ideally we should get rid of the explicit `require_once`, but this means that we have to make sure that all endpoints are covered by the autoloading mechanism.","created_at":"2016-10-22T00:34:23Z","updated_at":"2016-10-22T00:34:23Z","html_url":"https://github.com/friendica/friendica/pull/2861#discussion_r84564984","pull_request_url":"https://api.github.com/repos/friendica/friendica/pulls/2861","_links":{"self":{"href":"https://api.github.com/repos/friendica/friendica/pulls/comments/84564984"},"html":{"href":"https://github.com/friendica/friendica/pull/2861#discussion_r84564984"},"pull_request":{"href":"https://api.github.com/repos/friendica/friendica/pulls/2861"}}},"pull_request":{"url":"https://api.github.com/repos/friendica/friendica/pulls/2861","id":89695261,"html_url":"https://github.com/friendica/friendica/pull/2861","diff_url":"https://github.com/friendica/friendica/pull/2861.diff","patch_url":"https://github.com/friendica/friendica/pull/2861.patch","issue_url":"https://api.github.com/repos/friendica/friendica/issues/2861","number":2861,"state":"open","locked":false,"title":"Some more performance stuff","user":{"login":"annando","id":844208,"avatar_url":"https://avatars.githubusercontent.com/u/844208?v=3","gravatar_id":"","url":"https://api.github.com/users/annando","html_url":"https://github.com/annando","followers_url":"https://api.github.com/users/annando/followers","following_url":"https://api.github.com/users/annando/following{/other_user}","gists_url":"https://api.github.com/users/annando/gists{/gist_id}","starred_url":"https://api.github.com/users/annando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annando/subscriptions","organizations_url":"https://api.github.com/users/annando/orgs","repos_url":"https://api.github.com/users/annando/repos","events_url":"https://api.github.com/users/annando/events{/privacy}","received_events_url":"https://api.github.com/users/annando/received_events","type":"User","site_admin":false},"body":"There is now a new function to execute queries that can be done on uncommitted data. (Everything that is used for displaying data and not processing data) These database queries shouldn't lock the database and should have no problems with database locks. it won't improve performance on MyISAM systems - but they shouldn't have problems with it either.\r\n\r\nAdditionally some queries are improved and the data for the last user activity is now fetched from a stored value the contact table instead of generating it live.","created_at":"2016-10-17T20:21:53Z","updated_at":"2016-10-22T00:34:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76f046516f842e791b99bade5b3c5e7690eff2d2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/friendica/friendica/pulls/2861/commits","review_comments_url":"https://api.github.com/repos/friendica/friendica/pulls/2861/comments","review_comment_url":"https://api.github.com/repos/friendica/friendica/pulls/comments{/number}","comments_url":"https://api.github.com/repos/friendica/friendica/issues/2861/comments","statuses_url":"https://api.github.com/repos/friendica/friendica/statuses/bc324c3ef466c786a1b3e7375fecd505f00b5288","head":{"label":"annando:1610-performance","ref":"1610-performance","sha":"bc324c3ef466c786a1b3e7375fecd505f00b5288","user":{"login":"annando","id":844208,"avatar_url":"https://avatars.githubusercontent.com/u/844208?v=3","gravatar_id":"","url":"https://api.github.com/users/annando","html_url":"https://github.com/annando","followers_url":"https://api.github.com/users/annando/followers","following_url":"https://api.github.com/users/annando/following{/other_user}","gists_url":"https://api.github.com/users/annando/gists{/gist_id}","starred_url":"https://api.github.com/users/annando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annando/subscriptions","organizations_url":"https://api.github.com/users/annando/orgs","repos_url":"https://api.github.com/users/annando/repos","events_url":"https://api.github.com/users/annando/events{/privacy}","received_events_url":"https://api.github.com/users/annando/received_events","type":"User","site_admin":false},"repo":{"id":3302872,"name":"friendica","full_name":"annando/friendica","owner":{"login":"annando","id":844208,"avatar_url":"https://avatars.githubusercontent.com/u/844208?v=3","gravatar_id":"","url":"https://api.github.com/users/annando","html_url":"https://github.com/annando","followers_url":"https://api.github.com/users/annando/followers","following_url":"https://api.github.com/users/annando/following{/other_user}","gists_url":"https://api.github.com/users/annando/gists{/gist_id}","starred_url":"https://api.github.com/users/annando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annando/subscriptions","organizations_url":"https://api.github.com/users/annando/orgs","repos_url":"https://api.github.com/users/annando/repos","events_url":"https://api.github.com/users/annando/events{/privacy}","received_events_url":"https://api.github.com/users/annando/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/annando/friendica","description":"Friendica Communications Platform - MIT license","fork":true,"url":"https://api.github.com/repos/annando/friendica","forks_url":"https://api.github.com/repos/annando/friendica/forks","keys_url":"https://api.github.com/repos/annando/friendica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/annando/friendica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/annando/friendica/teams","hooks_url":"https://api.github.com/repos/annando/friendica/hooks","issue_events_url":"https://api.github.com/repos/annando/friendica/issues/events{/number}","events_url":"https://api.github.com/repos/annando/friendica/events","assignees_url":"https://api.github.com/repos/annando/friendica/assignees{/user}","branches_url":"https://api.github.com/repos/annando/friendica/branches{/branch}","tags_url":"https://api.github.com/repos/annando/friendica/tags","blobs_url":"https://api.github.com/repos/annando/friendica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/annando/friendica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/annando/friendica/git/refs{/sha}","trees_url":"https://api.github.com/repos/annando/friendica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/annando/friendica/statuses/{sha}","languages_url":"https://api.github.com/repos/annando/friendica/languages","stargazers_url":"https://api.github.com/repos/annando/friendica/stargazers","contributors_url":"https://api.github.com/repos/annando/friendica/contributors","subscribers_url":"https://api.github.com/repos/annando/friendica/subscribers","subscription_url":"https://api.github.com/repos/annando/friendica/subscription","commits_url":"https://api.github.com/repos/annando/friendica/commits{/sha}","git_commits_url":"https://api.github.com/repos/annando/friendica/git/commits{/sha}","comments_url":"https://api.github.com/repos/annando/friendica/comments{/number}","issue_comment_url":"https://api.github.com/repos/annando/friendica/issues/comments{/number}","contents_url":"https://api.github.com/repos/annando/friendica/contents/{+path}","compare_url":"https://api.github.com/repos/annando/friendica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/annando/friendica/merges","archive_url":"https://api.github.com/repos/annando/friendica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/annando/friendica/downloads","issues_url":"https://api.github.com/repos/annando/friendica/issues{/number}","pulls_url":"https://api.github.com/repos/annando/friendica/pulls{/number}","milestones_url":"https://api.github.com/repos/annando/friendica/milestones{/number}","notifications_url":"https://api.github.com/repos/annando/friendica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/annando/friendica/labels{/name}","releases_url":"https://api.github.com/repos/annando/friendica/releases{/id}","deployments_url":"https://api.github.com/repos/annando/friendica/deployments","created_at":"2012-01-30T06:45:26Z","updated_at":"2015-05-04T20:16:37Z","pushed_at":"2016-10-21T23:43:35Z","git_url":"git://github.com/annando/friendica.git","ssh_url":"git@github.com:annando/friendica.git","clone_url":"https://github.com/annando/friendica.git","svn_url":"https://github.com/annando/friendica","homepage":"http://friendica.com","size":67748,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"friendica:develop","ref":"develop","sha":"d8f5f517c948c91e36475ac353b188a8a6a6f016","user":{"login":"friendica","id":1176581,"avatar_url":"https://avatars.githubusercontent.com/u/1176581?v=3","gravatar_id":"","url":"https://api.github.com/users/friendica","html_url":"https://github.com/friendica","followers_url":"https://api.github.com/users/friendica/followers","following_url":"https://api.github.com/users/friendica/following{/other_user}","gists_url":"https://api.github.com/users/friendica/gists{/gist_id}","starred_url":"https://api.github.com/users/friendica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/friendica/subscriptions","organizations_url":"https://api.github.com/users/friendica/orgs","repos_url":"https://api.github.com/users/friendica/repos","events_url":"https://api.github.com/users/friendica/events{/privacy}","received_events_url":"https://api.github.com/users/friendica/received_events","type":"User","site_admin":false},"repo":{"id":2722709,"name":"friendica","full_name":"friendica/friendica","owner":{"login":"friendica","id":1176581,"avatar_url":"https://avatars.githubusercontent.com/u/1176581?v=3","gravatar_id":"","url":"https://api.github.com/users/friendica","html_url":"https://github.com/friendica","followers_url":"https://api.github.com/users/friendica/followers","following_url":"https://api.github.com/users/friendica/following{/other_user}","gists_url":"https://api.github.com/users/friendica/gists{/gist_id}","starred_url":"https://api.github.com/users/friendica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/friendica/subscriptions","organizations_url":"https://api.github.com/users/friendica/orgs","repos_url":"https://api.github.com/users/friendica/repos","events_url":"https://api.github.com/users/friendica/events{/privacy}","received_events_url":"https://api.github.com/users/friendica/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/friendica/friendica","description":"Friendica Communications Platform","fork":true,"url":"https://api.github.com/repos/friendica/friendica","forks_url":"https://api.github.com/repos/friendica/friendica/forks","keys_url":"https://api.github.com/repos/friendica/friendica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/friendica/friendica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/friendica/friendica/teams","hooks_url":"https://api.github.com/repos/friendica/friendica/hooks","issue_events_url":"https://api.github.com/repos/friendica/friendica/issues/events{/number}","events_url":"https://api.github.com/repos/friendica/friendica/events","assignees_url":"https://api.github.com/repos/friendica/friendica/assignees{/user}","branches_url":"https://api.github.com/repos/friendica/friendica/branches{/branch}","tags_url":"https://api.github.com/repos/friendica/friendica/tags","blobs_url":"https://api.github.com/repos/friendica/friendica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/friendica/friendica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/friendica/friendica/git/refs{/sha}","trees_url":"https://api.github.com/repos/friendica/friendica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/friendica/friendica/statuses/{sha}","languages_url":"https://api.github.com/repos/friendica/friendica/languages","stargazers_url":"https://api.github.com/repos/friendica/friendica/stargazers","contributors_url":"https://api.github.com/repos/friendica/friendica/contributors","subscribers_url":"https://api.github.com/repos/friendica/friendica/subscribers","subscription_url":"https://api.github.com/repos/friendica/friendica/subscription","commits_url":"https://api.github.com/repos/friendica/friendica/commits{/sha}","git_commits_url":"https://api.github.com/repos/friendica/friendica/git/commits{/sha}","comments_url":"https://api.github.com/repos/friendica/friendica/comments{/number}","issue_comment_url":"https://api.github.com/repos/friendica/friendica/issues/comments{/number}","contents_url":"https://api.github.com/repos/friendica/friendica/contents/{+path}","compare_url":"https://api.github.com/repos/friendica/friendica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/friendica/friendica/merges","archive_url":"https://api.github.com/repos/friendica/friendica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/friendica/friendica/downloads","issues_url":"https://api.github.com/repos/friendica/friendica/issues{/number}","pulls_url":"https://api.github.com/repos/friendica/friendica/pulls{/number}","milestones_url":"https://api.github.com/repos/friendica/friendica/milestones{/number}","notifications_url":"https://api.github.com/repos/friendica/friendica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/friendica/friendica/labels{/name}","releases_url":"https://api.github.com/repos/friendica/friendica/releases{/id}","deployments_url":"https://api.github.com/repos/friendica/friendica/deployments","created_at":"2011-11-06T22:19:41Z","updated_at":"2016-10-17T23:53:55Z","pushed_at":"2016-10-21T23:43:36Z","git_url":"git://github.com/friendica/friendica.git","ssh_url":"git@github.com:friendica/friendica.git","clone_url":"https://github.com/friendica/friendica.git","svn_url":"https://github.com/friendica/friendica","homepage":"","size":73422,"stargazers_count":428,"watchers_count":428,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":162,"mirror_url":null,"open_issues_count":242,"forks":162,"open_issues":242,"watchers":428,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/friendica/friendica/pulls/2861"},"html":{"href":"https://github.com/friendica/friendica/pull/2861"},"issue":{"href":"https://api.github.com/repos/friendica/friendica/issues/2861"},"comments":{"href":"https://api.github.com/repos/friendica/friendica/issues/2861/comments"},"review_comments":{"href":"https://api.github.com/repos/friendica/friendica/pulls/2861/comments"},"review_comment":{"href":"https://api.github.com/repos/friendica/friendica/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/friendica/friendica/pulls/2861/commits"},"statuses":{"href":"https://api.github.com/repos/friendica/friendica/statuses/bc324c3ef466c786a1b3e7375fecd505f00b5288"}}}}
{"actor":{"display_login":"Hypolite"}}