{"action":"created","comment":{"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments/35111279","id":35111279,"diff_hunk":"@@ -0,0 +1,248 @@\n+<?php\n+\n+/**\n+ * This file implements functions to read and write to a group of database\n+ * servers.\n+ *\n+ * This database class supports a single database, or a master/slave\n+ * configuration with as many defined slaves as a user would like.\n+ * \n+ * The goal of this class is to provide a single mechanism to connect to a database\n+ * that can be reused by any component within SimpleSAMLphp including modules.\n+ * When using this class, the global configuration should be passed here, but\n+ * in the case of a module that has a good reason to use a different database,\n+ * such as sqlauth, an alternative config file can be provided.\n+ *\n+ * @author Tyler Antonio, University of Alberta. <tantonio@ualberta.ca>\n+ * @package simpleSAMLphp\n+ */\n+\n+class SimpleSAML_Database {\n+\n+\t/**\n+\t * This variable holds the instance of the session - Singleton approach.\n+\t */\n+\tprivate static $instance = array();\n+\n+\t/**\n+\t * PDO Object for the Master database server\n+\t */\n+\tprivate $dbMaster;\n+\n+\t/**\n+\t * Array of PDO Objects for configured database\n+\t * slaves\n+\t */\n+\tprivate $dbSlaves = array();\n+\n+\t/**\n+\t * Prefix to apply to the tables\n+\t */\n+\tprivate $tablePrefix;\n+\n+    /**\n+\t * Retrieves the current database instance. Will create a new one if there isn't an existing connection.\n+\t *\n+\t * @param object $altConfig Optional: Instance of a SimpleSAML_Configruation class","path":"lib/SimpleSAML/Database.php","position":46,"original_position":46,"commit_id":"79a6be10c26db2d1deeb2550b39f1c8e0059b922","original_commit_id":"79a6be10c26db2d1deeb2550b39f1c8e0059b922","user":{"login":"jaimeperez","id":1942728,"avatar_url":"https://avatars.githubusercontent.com/u/1942728?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimeperez","html_url":"https://github.com/jaimeperez","followers_url":"https://api.github.com/users/jaimeperez/followers","following_url":"https://api.github.com/users/jaimeperez/following{/other_user}","gists_url":"https://api.github.com/users/jaimeperez/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimeperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimeperez/subscriptions","organizations_url":"https://api.github.com/users/jaimeperez/orgs","repos_url":"https://api.github.com/users/jaimeperez/repos","events_url":"https://api.github.com/users/jaimeperez/events{/privacy}","received_events_url":"https://api.github.com/users/jaimeperez/received_events","type":"User","site_admin":false},"body":"s/Configruation/Configuration/","created_at":"2015-07-21T14:54:22Z","updated_at":"2015-07-21T14:54:22Z","html_url":"https://github.com/simplesamlphp/simplesamlphp/pull/189#discussion_r35111279","pull_request_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments/35111279"},"html":{"href":"https://github.com/simplesamlphp/simplesamlphp/pull/189#discussion_r35111279"},"pull_request":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189","id":32881608,"html_url":"https://github.com/simplesamlphp/simplesamlphp/pull/189","diff_url":"https://github.com/simplesamlphp/simplesamlphp/pull/189.diff","patch_url":"https://github.com/simplesamlphp/simplesamlphp/pull/189.patch","issue_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/189","number":189,"state":"open","locked":false,"title":"Add PDO Metadata Storage Handler","user":{"login":"tdiscuit","id":6775911,"avatar_url":"https://avatars.githubusercontent.com/u/6775911?v=3","gravatar_id":"","url":"https://api.github.com/users/tdiscuit","html_url":"https://github.com/tdiscuit","followers_url":"https://api.github.com/users/tdiscuit/followers","following_url":"https://api.github.com/users/tdiscuit/following{/other_user}","gists_url":"https://api.github.com/users/tdiscuit/gists{/gist_id}","starred_url":"https://api.github.com/users/tdiscuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdiscuit/subscriptions","organizations_url":"https://api.github.com/users/tdiscuit/orgs","repos_url":"https://api.github.com/users/tdiscuit/repos","events_url":"https://api.github.com/users/tdiscuit/events{/privacy}","received_events_url":"https://api.github.com/users/tdiscuit/received_events","type":"User","site_admin":false},"body":"This is to add support for storing of metadata in a SQL database.\r\n\r\nThe original code was taken from [issue #44](https://github.com/simplesamlphp/simplesamlphp/issues/44) and has been updated to work with the latest version of simpleSAMLphp and additional databases.\r\n\r\nI have also included documentation and updated the config template to show usage.","created_at":"2015-04-08T17:13:28Z","updated_at":"2015-07-21T14:54:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06c1ff54c113e0b9247c64a4ec7bcc818c99c416","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189/commits","review_comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189/comments","review_comment_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/189/comments","statuses_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/statuses/79a6be10c26db2d1deeb2550b39f1c8e0059b922","head":{"label":"tdiscuit:feature/pdometadata","ref":"feature/pdometadata","sha":"79a6be10c26db2d1deeb2550b39f1c8e0059b922","user":{"login":"tdiscuit","id":6775911,"avatar_url":"https://avatars.githubusercontent.com/u/6775911?v=3","gravatar_id":"","url":"https://api.github.com/users/tdiscuit","html_url":"https://github.com/tdiscuit","followers_url":"https://api.github.com/users/tdiscuit/followers","following_url":"https://api.github.com/users/tdiscuit/following{/other_user}","gists_url":"https://api.github.com/users/tdiscuit/gists{/gist_id}","starred_url":"https://api.github.com/users/tdiscuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdiscuit/subscriptions","organizations_url":"https://api.github.com/users/tdiscuit/orgs","repos_url":"https://api.github.com/users/tdiscuit/repos","events_url":"https://api.github.com/users/tdiscuit/events{/privacy}","received_events_url":"https://api.github.com/users/tdiscuit/received_events","type":"User","site_admin":false},"repo":{"id":33327522,"name":"simplesamlphp","full_name":"tdiscuit/simplesamlphp","owner":{"login":"tdiscuit","id":6775911,"avatar_url":"https://avatars.githubusercontent.com/u/6775911?v=3","gravatar_id":"","url":"https://api.github.com/users/tdiscuit","html_url":"https://github.com/tdiscuit","followers_url":"https://api.github.com/users/tdiscuit/followers","following_url":"https://api.github.com/users/tdiscuit/following{/other_user}","gists_url":"https://api.github.com/users/tdiscuit/gists{/gist_id}","starred_url":"https://api.github.com/users/tdiscuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdiscuit/subscriptions","organizations_url":"https://api.github.com/users/tdiscuit/orgs","repos_url":"https://api.github.com/users/tdiscuit/repos","events_url":"https://api.github.com/users/tdiscuit/events{/privacy}","received_events_url":"https://api.github.com/users/tdiscuit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tdiscuit/simplesamlphp","description":"SimpleSAMLphp is an award-winning application written in native PHP that deals with authentication.","fork":true,"url":"https://api.github.com/repos/tdiscuit/simplesamlphp","forks_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/forks","keys_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/teams","hooks_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/hooks","issue_events_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/issues/events{/number}","events_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/events","assignees_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/assignees{/user}","branches_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/branches{/branch}","tags_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/tags","blobs_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/statuses/{sha}","languages_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/languages","stargazers_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/stargazers","contributors_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/contributors","subscribers_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/subscribers","subscription_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/subscription","commits_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/contents/{+path}","compare_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/merges","archive_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/downloads","issues_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/issues{/number}","pulls_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/pulls{/number}","milestones_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/milestones{/number}","notifications_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/labels{/name}","releases_url":"https://api.github.com/repos/tdiscuit/simplesamlphp/releases{/id}","created_at":"2015-04-02T19:24:11Z","updated_at":"2015-04-02T19:24:13Z","pushed_at":"2015-07-20T19:51:43Z","git_url":"git://github.com/tdiscuit/simplesamlphp.git","ssh_url":"git@github.com:tdiscuit/simplesamlphp.git","clone_url":"https://github.com/tdiscuit/simplesamlphp.git","svn_url":"https://github.com/tdiscuit/simplesamlphp","homepage":null,"size":9378,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"simplesamlphp:master","ref":"master","sha":"ba351d40987e84cf3d2c7e646b9144fc8b84e5e5","user":{"login":"simplesamlphp","id":5774640,"avatar_url":"https://avatars.githubusercontent.com/u/5774640?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesamlphp","html_url":"https://github.com/simplesamlphp","followers_url":"https://api.github.com/users/simplesamlphp/followers","following_url":"https://api.github.com/users/simplesamlphp/following{/other_user}","gists_url":"https://api.github.com/users/simplesamlphp/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesamlphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesamlphp/subscriptions","organizations_url":"https://api.github.com/users/simplesamlphp/orgs","repos_url":"https://api.github.com/users/simplesamlphp/repos","events_url":"https://api.github.com/users/simplesamlphp/events{/privacy}","received_events_url":"https://api.github.com/users/simplesamlphp/received_events","type":"Organization","site_admin":false},"repo":{"id":17167136,"name":"simplesamlphp","full_name":"simplesamlphp/simplesamlphp","owner":{"login":"simplesamlphp","id":5774640,"avatar_url":"https://avatars.githubusercontent.com/u/5774640?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesamlphp","html_url":"https://github.com/simplesamlphp","followers_url":"https://api.github.com/users/simplesamlphp/followers","following_url":"https://api.github.com/users/simplesamlphp/following{/other_user}","gists_url":"https://api.github.com/users/simplesamlphp/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesamlphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesamlphp/subscriptions","organizations_url":"https://api.github.com/users/simplesamlphp/orgs","repos_url":"https://api.github.com/users/simplesamlphp/repos","events_url":"https://api.github.com/users/simplesamlphp/events{/privacy}","received_events_url":"https://api.github.com/users/simplesamlphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplesamlphp/simplesamlphp","description":"SimpleSAMLphp is an award-winning application written in native PHP that deals with authentication.","fork":false,"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp","forks_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/forks","keys_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/teams","hooks_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/hooks","issue_events_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/events{/number}","events_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/events","assignees_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/assignees{/user}","branches_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/branches{/branch}","tags_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/tags","blobs_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/statuses/{sha}","languages_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/languages","stargazers_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/stargazers","contributors_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/contributors","subscribers_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/subscribers","subscription_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/subscription","commits_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/contents/{+path}","compare_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/merges","archive_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/downloads","issues_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues{/number}","pulls_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls{/number}","milestones_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/milestones{/number}","notifications_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/labels{/name}","releases_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/releases{/id}","created_at":"2014-02-25T09:01:45Z","updated_at":"2015-07-20T20:35:29Z","pushed_at":"2015-07-21T14:00:28Z","git_url":"git://github.com/simplesamlphp/simplesamlphp.git","ssh_url":"git@github.com:simplesamlphp/simplesamlphp.git","clone_url":"https://github.com/simplesamlphp/simplesamlphp.git","svn_url":"https://github.com/simplesamlphp/simplesamlphp","homepage":null,"size":64993,"stargazers_count":139,"watchers_count":139,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":91,"forks":112,"open_issues":91,"watchers":139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189"},"html":{"href":"https://github.com/simplesamlphp/simplesamlphp/pull/189"},"issue":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/189"},"comments":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/statuses/79a6be10c26db2d1deeb2550b39f1c8e0059b922"}}}}