GitHub PullRequestReviewCommentEvent at 2014-11-26 14:19:57
Repository: islandora_usage_stats
Actor: nigelgbanks
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/comments/20936857","id":20936857,"diff_hunk":"@@ -103,6 +103,194 @@ function islandora_usage_stats_update_object_label($pid, $label) {\n }\n \n /**\n+ * Select top downloads, ordered by most downloaded.\n+ *\n+ * @param int $count\n+ *   The number of max results to return.\n+ *\n+ * @return array\n+ *   A list of PIDS.\n+ */\n+function islandora_usage_stats_get_top_downloads($count) {\n+  $query = db_select('islandora_usage_stats_top_downloads', 'dl');\n+  $query->join('islandora_usage_stats_objects', 'objects', 'dl.pid_id = objects.id');\n+  $query->join('islandora_usage_stats_datastreams', 'ds', 'dl.pid_id = ds.pid_id');\n+  $results = $query->fields('objects', array('pid'))\n+    ->fields('dl', array('ds_id'))\n+    ->orderBy('dl.downloads', 'DESC')\n+    ->range(0, $count)\n+    ->execute();\n+  $records = $results->fetchAllAssoc('pid');\n+  return array_keys($records);\n+}\n+\n+/**\n+ * Increment the ds download counter for top downloads.\n+ *\n+ * @param int $time\n+ *   Using REQUEST_TIME, constant available time as int.\n+ * @param int $pid_id\n+ *   The pid_id, or id key in islandora_usage_stats_objects.\n+ * @param int $dsid\n+ *   The ds_id, or id key in islandora_usage_stats_datastreams.\n+ *\n+ * @return array\n+ *   The query result.\n+ */\n+function islandora_usage_stats_increment_top_object_ds_download_counter($time, $pid_id, $dsid) {","path":"includes/db.inc","position":38,"original_position":38,"commit_id":"e927a14f70fd919798c0ad3b55fd089afebc6b6f","original_commit_id":"e927a14f70fd919798c0ad3b55fd089afebc6b6f","user":{"login":"nigelgbanks","id":487373,"avatar_url":"https://avatars.githubusercontent.com/u/487373?v=3","gravatar_id":"","url":"https://api.github.com/users/nigelgbanks","html_url":"https://github.com/nigelgbanks","followers_url":"https://api.github.com/users/nigelgbanks/followers","following_url":"https://api.github.com/users/nigelgbanks/following{/other_user}","gists_url":"https://api.github.com/users/nigelgbanks/gists{/gist_id}","starred_url":"https://api.github.com/users/nigelgbanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigelgbanks/subscriptions","organizations_url":"https://api.github.com/users/nigelgbanks/orgs","repos_url":"https://api.github.com/users/nigelgbanks/repos","events_url":"https://api.github.com/users/nigelgbanks/events{/privacy}","received_events_url":"https://api.github.com/users/nigelgbanks/received_events","type":"User","site_admin":false},"body":"Unused parameter ```$time```.","created_at":"2014-11-26T14:19:57Z","updated_at":"2014-11-26T14:19:57Z","html_url":"https://github.com/discoverygarden/islandora_usage_stats/pull/10#discussion_r20936857","pull_request_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/comments/20936857"},"html":{"href":"https://github.com/discoverygarden/islandora_usage_stats/pull/10#discussion_r20936857"},"pull_request":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10","id":24953605,"html_url":"https://github.com/discoverygarden/islandora_usage_stats/pull/10","diff_url":"https://github.com/discoverygarden/islandora_usage_stats/pull/10.diff","patch_url":"https://github.com/discoverygarden/islandora_usage_stats/pull/10.patch","issue_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues/10","number":10,"state":"open","locked":false,"title":"7.x wrlc 66","user":{"login":"MorganDawe","id":3580299,"avatar_url":"https://avatars.githubusercontent.com/u/3580299?v=3","gravatar_id":"","url":"https://api.github.com/users/MorganDawe","html_url":"https://github.com/MorganDawe","followers_url":"https://api.github.com/users/MorganDawe/followers","following_url":"https://api.github.com/users/MorganDawe/following{/other_user}","gists_url":"https://api.github.com/users/MorganDawe/gists{/gist_id}","starred_url":"https://api.github.com/users/MorganDawe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorganDawe/subscriptions","organizations_url":"https://api.github.com/users/MorganDawe/orgs","repos_url":"https://api.github.com/users/MorganDawe/repos","events_url":"https://api.github.com/users/MorganDawe/events{/privacy}","received_events_url":"https://api.github.com/users/MorganDawe/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-24T18:41:12Z","updated_at":"2014-11-26T14:19:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b35e609fc06505442d921db1e3994d4a750aaf8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10/commits","review_comments_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10/comments","review_comment_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/comments/{number}","comments_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues/10/comments","statuses_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/statuses/e927a14f70fd919798c0ad3b55fd089afebc6b6f","head":{"label":"MorganDawe:7.x-WRLC-66","ref":"7.x-WRLC-66","sha":"e927a14f70fd919798c0ad3b55fd089afebc6b6f","user":{"login":"MorganDawe","id":3580299,"avatar_url":"https://avatars.githubusercontent.com/u/3580299?v=3","gravatar_id":"","url":"https://api.github.com/users/MorganDawe","html_url":"https://github.com/MorganDawe","followers_url":"https://api.github.com/users/MorganDawe/followers","following_url":"https://api.github.com/users/MorganDawe/following{/other_user}","gists_url":"https://api.github.com/users/MorganDawe/gists{/gist_id}","starred_url":"https://api.github.com/users/MorganDawe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorganDawe/subscriptions","organizations_url":"https://api.github.com/users/MorganDawe/orgs","repos_url":"https://api.github.com/users/MorganDawe/repos","events_url":"https://api.github.com/users/MorganDawe/events{/privacy}","received_events_url":"https://api.github.com/users/MorganDawe/received_events","type":"User","site_admin":false},"repo":{"id":26971098,"name":"islandora_usage_stats","full_name":"MorganDawe/islandora_usage_stats","owner":{"login":"MorganDawe","id":3580299,"avatar_url":"https://avatars.githubusercontent.com/u/3580299?v=3","gravatar_id":"","url":"https://api.github.com/users/MorganDawe","html_url":"https://github.com/MorganDawe","followers_url":"https://api.github.com/users/MorganDawe/followers","following_url":"https://api.github.com/users/MorganDawe/following{/other_user}","gists_url":"https://api.github.com/users/MorganDawe/gists{/gist_id}","starred_url":"https://api.github.com/users/MorganDawe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorganDawe/subscriptions","organizations_url":"https://api.github.com/users/MorganDawe/orgs","repos_url":"https://api.github.com/users/MorganDawe/repos","events_url":"https://api.github.com/users/MorganDawe/events{/privacy}","received_events_url":"https://api.github.com/users/MorganDawe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MorganDawe/islandora_usage_stats","description":"Track views of islandora items","fork":true,"url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats","forks_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/forks","keys_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/teams","hooks_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/hooks","issue_events_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/issues/events{/number}","events_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/events","assignees_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/assignees{/user}","branches_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/branches{/branch}","tags_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/tags","blobs_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/git/refs{/sha}","trees_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/statuses/{sha}","languages_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/languages","stargazers_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/stargazers","contributors_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/contributors","subscribers_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/subscribers","subscription_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/subscription","commits_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/commits{/sha}","git_commits_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/git/commits{/sha}","comments_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/comments{/number}","issue_comment_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/issues/comments/{number}","contents_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/contents/{+path}","compare_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/merges","archive_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/downloads","issues_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/issues{/number}","pulls_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/pulls{/number}","milestones_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/milestones{/number}","notifications_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/labels{/name}","releases_url":"https://api.github.com/repos/MorganDawe/islandora_usage_stats/releases{/id}","created_at":"2014-11-21T17:51:27Z","updated_at":"2014-11-21T17:51:27Z","pushed_at":"2014-11-25T20:49:12Z","git_url":"git://github.com/MorganDawe/islandora_usage_stats.git","ssh_url":"git@github.com:MorganDawe/islandora_usage_stats.git","clone_url":"https://github.com/MorganDawe/islandora_usage_stats.git","svn_url":"https://github.com/MorganDawe/islandora_usage_stats","homepage":null,"size":923,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"7.x"}},"base":{"label":"discoverygarden:7.x","ref":"7.x","sha":"3cc8b02810565b4e9d5cad16e7201f20b6e80f72","user":{"login":"discoverygarden","id":598560,"avatar_url":"https://avatars.githubusercontent.com/u/598560?v=3","gravatar_id":"","url":"https://api.github.com/users/discoverygarden","html_url":"https://github.com/discoverygarden","followers_url":"https://api.github.com/users/discoverygarden/followers","following_url":"https://api.github.com/users/discoverygarden/following{/other_user}","gists_url":"https://api.github.com/users/discoverygarden/gists{/gist_id}","starred_url":"https://api.github.com/users/discoverygarden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discoverygarden/subscriptions","organizations_url":"https://api.github.com/users/discoverygarden/orgs","repos_url":"https://api.github.com/users/discoverygarden/repos","events_url":"https://api.github.com/users/discoverygarden/events{/privacy}","received_events_url":"https://api.github.com/users/discoverygarden/received_events","type":"Organization","site_admin":false},"repo":{"id":25922288,"name":"islandora_usage_stats","full_name":"discoverygarden/islandora_usage_stats","owner":{"login":"discoverygarden","id":598560,"avatar_url":"https://avatars.githubusercontent.com/u/598560?v=3","gravatar_id":"","url":"https://api.github.com/users/discoverygarden","html_url":"https://github.com/discoverygarden","followers_url":"https://api.github.com/users/discoverygarden/followers","following_url":"https://api.github.com/users/discoverygarden/following{/other_user}","gists_url":"https://api.github.com/users/discoverygarden/gists{/gist_id}","starred_url":"https://api.github.com/users/discoverygarden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discoverygarden/subscriptions","organizations_url":"https://api.github.com/users/discoverygarden/orgs","repos_url":"https://api.github.com/users/discoverygarden/repos","events_url":"https://api.github.com/users/discoverygarden/events{/privacy}","received_events_url":"https://api.github.com/users/discoverygarden/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/discoverygarden/islandora_usage_stats","description":"Track views of islandora items","fork":true,"url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats","forks_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/forks","keys_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/teams","hooks_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/hooks","issue_events_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues/events{/number}","events_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/events","assignees_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/assignees{/user}","branches_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/branches{/branch}","tags_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/tags","blobs_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/git/refs{/sha}","trees_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/statuses/{sha}","languages_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/languages","stargazers_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/stargazers","contributors_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/contributors","subscribers_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/subscribers","subscription_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/subscription","commits_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/commits{/sha}","git_commits_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/git/commits{/sha}","comments_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/comments{/number}","issue_comment_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues/comments/{number}","contents_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/contents/{+path}","compare_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/merges","archive_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/downloads","issues_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues{/number}","pulls_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls{/number}","milestones_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/milestones{/number}","notifications_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/labels{/name}","releases_url":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/releases{/id}","created_at":"2014-10-29T13:32:47Z","updated_at":"2014-11-24T20:32:18Z","pushed_at":"2014-11-24T20:32:17Z","git_url":"git://github.com/discoverygarden/islandora_usage_stats.git","ssh_url":"git@github.com:discoverygarden/islandora_usage_stats.git","clone_url":"https://github.com/discoverygarden/islandora_usage_stats.git","svn_url":"https://github.com/discoverygarden/islandora_usage_stats","homepage":null,"size":923,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"7.x"}},"_links":{"self":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10"},"html":{"href":"https://github.com/discoverygarden/islandora_usage_stats/pull/10"},"issue":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues/10"},"comments":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/discoverygarden/islandora_usage_stats/statuses/e927a14f70fd919798c0ad3b55fd089afebc6b6f"}}}}