{"action":"closed","number":9,"pull_request":{"url":"https://api.github.com/repos/netharbour/netharbour/pulls/9","id":239235670,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5MjM1Njcw","html_url":"https://github.com/netharbour/netharbour/pull/9","diff_url":"https://github.com/netharbour/netharbour/pull/9.diff","patch_url":"https://github.com/netharbour/netharbour/pull/9.patch","issue_url":"https://api.github.com/repos/netharbour/netharbour/issues/9","number":9,"state":"closed","locked":false,"title":"Feat/plugin init function","user":{"login":"ctomkow","id":9662452,"node_id":"MDQ6VXNlcjk2NjI0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9662452?v=4","gravatar_id":"","url":"https://api.github.com/users/ctomkow","html_url":"https://github.com/ctomkow","followers_url":"https://api.github.com/users/ctomkow/followers","following_url":"https://api.github.com/users/ctomkow/following{/other_user}","gists_url":"https://api.github.com/users/ctomkow/gists{/gist_id}","starred_url":"https://api.github.com/users/ctomkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctomkow/subscriptions","organizations_url":"https://api.github.com/users/ctomkow/orgs","repos_url":"https://api.github.com/users/ctomkow/repos","events_url":"https://api.github.com/users/ctomkow/events{/privacy}","received_events_url":"https://api.github.com/users/ctomkow/received_events","type":"User","site_admin":false},"body":"To support further plugin development, an (optional) init function is now supported in a plugins plugin.php. This allows for running any code only when the plugin is first enabled. The `init()` is run only when the plugin is enabled in the gui (box is checked from an unchecked state, and \"enable checked plugins\" button is pressed). An `init()` was chosen instead of using a class `__construct()` because the plugin.php class happens to be instantiated multiple times throughout configurations.php. This avoids the initialization code from being called multiple times, unnecessarily.\r\n\r\nThe main use-case for this functionality is to be able to perform a database `CREATE TABLE IF NOT EXISTS` call to create a DB table that supports the plugin's features. This allows an easy way to create supporting DB tables without having to create an \"upgrade.sql\" and manually apply it to the DB.\r\n\r\nFor example, SNMP_Poller plugin requires the `plugin_SNMPPoller_devices` DB table which tracks what devices are to be SNMP polled. This type of device tracking is required for future plugins (e.g. `plugin_MACAccounting_devices` DB table).","created_at":"2018-12-17T18:05:25Z","updated_at":"2018-12-17T19:32:26Z","closed_at":"2018-12-17T19:32:26Z","merged_at":null,"merge_commit_sha":"cb48cab1f54ffd010c7fa4221523bae45ca96ffa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/netharbour/netharbour/pulls/9/commits","review_comments_url":"https://api.github.com/repos/netharbour/netharbour/pulls/9/comments","review_comment_url":"https://api.github.com/repos/netharbour/netharbour/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netharbour/netharbour/issues/9/comments","statuses_url":"https://api.github.com/repos/netharbour/netharbour/statuses/eef284372e77ede5d9334e8905c0b9841964dca5","head":{"label":"ctomkow:feat/plugin_init_function","ref":"feat/plugin_init_function","sha":"eef284372e77ede5d9334e8905c0b9841964dca5","user":{"login":"ctomkow","id":9662452,"node_id":"MDQ6VXNlcjk2NjI0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9662452?v=4","gravatar_id":"","url":"https://api.github.com/users/ctomkow","html_url":"https://github.com/ctomkow","followers_url":"https://api.github.com/users/ctomkow/followers","following_url":"https://api.github.com/users/ctomkow/following{/other_user}","gists_url":"https://api.github.com/users/ctomkow/gists{/gist_id}","starred_url":"https://api.github.com/users/ctomkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctomkow/subscriptions","organizations_url":"https://api.github.com/users/ctomkow/orgs","repos_url":"https://api.github.com/users/ctomkow/repos","events_url":"https://api.github.com/users/ctomkow/events{/privacy}","received_events_url":"https://api.github.com/users/ctomkow/received_events","type":"User","site_admin":false},"repo":{"id":150614673,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA2MTQ2NzM=","name":"netharbour","full_name":"ctomkow/netharbour","private":false,"owner":{"login":"ctomkow","id":9662452,"node_id":"MDQ6VXNlcjk2NjI0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9662452?v=4","gravatar_id":"","url":"https://api.github.com/users/ctomkow","html_url":"https://github.com/ctomkow","followers_url":"https://api.github.com/users/ctomkow/followers","following_url":"https://api.github.com/users/ctomkow/following{/other_user}","gists_url":"https://api.github.com/users/ctomkow/gists{/gist_id}","starred_url":"https://api.github.com/users/ctomkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctomkow/subscriptions","organizations_url":"https://api.github.com/users/ctomkow/orgs","repos_url":"https://api.github.com/users/ctomkow/repos","events_url":"https://api.github.com/users/ctomkow/events{/privacy}","received_events_url":"https://api.github.com/users/ctomkow/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ctomkow/netharbour","description":"netharbour network management system","fork":true,"url":"https://api.github.com/repos/ctomkow/netharbour","forks_url":"https://api.github.com/repos/ctomkow/netharbour/forks","keys_url":"https://api.github.com/repos/ctomkow/netharbour/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ctomkow/netharbour/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ctomkow/netharbour/teams","hooks_url":"https://api.github.com/repos/ctomkow/netharbour/hooks","issue_events_url":"https://api.github.com/repos/ctomkow/netharbour/issues/events{/number}","events_url":"https://api.github.com/repos/ctomkow/netharbour/events","assignees_url":"https://api.github.com/repos/ctomkow/netharbour/assignees{/user}","branches_url":"https://api.github.com/repos/ctomkow/netharbour/branches{/branch}","tags_url":"https://api.github.com/repos/ctomkow/netharbour/tags","blobs_url":"https://api.github.com/repos/ctomkow/netharbour/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ctomkow/netharbour/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ctomkow/netharbour/git/refs{/sha}","trees_url":"https://api.github.com/repos/ctomkow/netharbour/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ctomkow/netharbour/statuses/{sha}","languages_url":"https://api.github.com/repos/ctomkow/netharbour/languages","stargazers_url":"https://api.github.com/repos/ctomkow/netharbour/stargazers","contributors_url":"https://api.github.com/repos/ctomkow/netharbour/contributors","subscribers_url":"https://api.github.com/repos/ctomkow/netharbour/subscribers","subscription_url":"https://api.github.com/repos/ctomkow/netharbour/subscription","commits_url":"https://api.github.com/repos/ctomkow/netharbour/commits{/sha}","git_commits_url":"https://api.github.com/repos/ctomkow/netharbour/git/commits{/sha}","comments_url":"https://api.github.com/repos/ctomkow/netharbour/comments{/number}","issue_comment_url":"https://api.github.com/repos/ctomkow/netharbour/issues/comments{/number}","contents_url":"https://api.github.com/repos/ctomkow/netharbour/contents/{+path}","compare_url":"https://api.github.com/repos/ctomkow/netharbour/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ctomkow/netharbour/merges","archive_url":"https://api.github.com/repos/ctomkow/netharbour/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ctomkow/netharbour/downloads","issues_url":"https://api.github.com/repos/ctomkow/netharbour/issues{/number}","pulls_url":"https://api.github.com/repos/ctomkow/netharbour/pulls{/number}","milestones_url":"https://api.github.com/repos/ctomkow/netharbour/milestones{/number}","notifications_url":"https://api.github.com/repos/ctomkow/netharbour/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ctomkow/netharbour/labels{/name}","releases_url":"https://api.github.com/repos/ctomkow/netharbour/releases{/id}","deployments_url":"https://api.github.com/repos/ctomkow/netharbour/deployments","created_at":"2018-09-27T16:13:20Z","updated_at":"2018-12-10T21:10:12Z","pushed_at":"2018-12-17T17:41:08Z","git_url":"git://github.com/ctomkow/netharbour.git","ssh_url":"git@github.com:ctomkow/netharbour.git","clone_url":"https://github.com/ctomkow/netharbour.git","svn_url":"https://github.com/ctomkow/netharbour","homepage":null,"size":5778,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"netharbour:master","ref":"master","sha":"aae99b24b15e92aba028d39032f88a2eeb031f79","user":{"login":"netharbour","id":10093090,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDkzMDkw","avatar_url":"https://avatars3.githubusercontent.com/u/10093090?v=4","gravatar_id":"","url":"https://api.github.com/users/netharbour","html_url":"https://github.com/netharbour","followers_url":"https://api.github.com/users/netharbour/followers","following_url":"https://api.github.com/users/netharbour/following{/other_user}","gists_url":"https://api.github.com/users/netharbour/gists{/gist_id}","starred_url":"https://api.github.com/users/netharbour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netharbour/subscriptions","organizations_url":"https://api.github.com/users/netharbour/orgs","repos_url":"https://api.github.com/users/netharbour/repos","events_url":"https://api.github.com/users/netharbour/events{/privacy}","received_events_url":"https://api.github.com/users/netharbour/received_events","type":"Organization","site_admin":false},"repo":{"id":27615625,"node_id":"MDEwOlJlcG9zaXRvcnkyNzYxNTYyNQ==","name":"netharbour","full_name":"netharbour/netharbour","private":false,"owner":{"login":"netharbour","id":10093090,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDkzMDkw","avatar_url":"https://avatars3.githubusercontent.com/u/10093090?v=4","gravatar_id":"","url":"https://api.github.com/users/netharbour","html_url":"https://github.com/netharbour","followers_url":"https://api.github.com/users/netharbour/followers","following_url":"https://api.github.com/users/netharbour/following{/other_user}","gists_url":"https://api.github.com/users/netharbour/gists{/gist_id}","starred_url":"https://api.github.com/users/netharbour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netharbour/subscriptions","organizations_url":"https://api.github.com/users/netharbour/orgs","repos_url":"https://api.github.com/users/netharbour/repos","events_url":"https://api.github.com/users/netharbour/events{/privacy}","received_events_url":"https://api.github.com/users/netharbour/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/netharbour/netharbour","description":"netharbour network management system","fork":false,"url":"https://api.github.com/repos/netharbour/netharbour","forks_url":"https://api.github.com/repos/netharbour/netharbour/forks","keys_url":"https://api.github.com/repos/netharbour/netharbour/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netharbour/netharbour/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netharbour/netharbour/teams","hooks_url":"https://api.github.com/repos/netharbour/netharbour/hooks","issue_events_url":"https://api.github.com/repos/netharbour/netharbour/issues/events{/number}","events_url":"https://api.github.com/repos/netharbour/netharbour/events","assignees_url":"https://api.github.com/repos/netharbour/netharbour/assignees{/user}","branches_url":"https://api.github.com/repos/netharbour/netharbour/branches{/branch}","tags_url":"https://api.github.com/repos/netharbour/netharbour/tags","blobs_url":"https://api.github.com/repos/netharbour/netharbour/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netharbour/netharbour/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netharbour/netharbour/git/refs{/sha}","trees_url":"https://api.github.com/repos/netharbour/netharbour/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netharbour/netharbour/statuses/{sha}","languages_url":"https://api.github.com/repos/netharbour/netharbour/languages","stargazers_url":"https://api.github.com/repos/netharbour/netharbour/stargazers","contributors_url":"https://api.github.com/repos/netharbour/netharbour/contributors","subscribers_url":"https://api.github.com/repos/netharbour/netharbour/subscribers","subscription_url":"https://api.github.com/repos/netharbour/netharbour/subscription","commits_url":"https://api.github.com/repos/netharbour/netharbour/commits{/sha}","git_commits_url":"https://api.github.com/repos/netharbour/netharbour/git/commits{/sha}","comments_url":"https://api.github.com/repos/netharbour/netharbour/comments{/number}","issue_comment_url":"https://api.github.com/repos/netharbour/netharbour/issues/comments{/number}","contents_url":"https://api.github.com/repos/netharbour/netharbour/contents/{+path}","compare_url":"https://api.github.com/repos/netharbour/netharbour/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netharbour/netharbour/merges","archive_url":"https://api.github.com/repos/netharbour/netharbour/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netharbour/netharbour/downloads","issues_url":"https://api.github.com/repos/netharbour/netharbour/issues{/number}","pulls_url":"https://api.github.com/repos/netharbour/netharbour/pulls{/number}","milestones_url":"https://api.github.com/repos/netharbour/netharbour/milestones{/number}","notifications_url":"https://api.github.com/repos/netharbour/netharbour/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netharbour/netharbour/labels{/name}","releases_url":"https://api.github.com/repos/netharbour/netharbour/releases{/id}","deployments_url":"https://api.github.com/repos/netharbour/netharbour/deployments","created_at":"2014-12-06T00:02:49Z","updated_at":"2018-12-08T19:09:56Z","pushed_at":"2018-12-17T18:05:26Z","git_url":"git://github.com/netharbour/netharbour.git","ssh_url":"git@github.com:netharbour/netharbour.git","clone_url":"https://github.com/netharbour/netharbour.git","svn_url":"https://github.com/netharbour/netharbour","homepage":null,"size":5759,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":6,"open_issues":2,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/netharbour/netharbour/pulls/9"},"html":{"href":"https://github.com/netharbour/netharbour/pull/9"},"issue":{"href":"https://api.github.com/repos/netharbour/netharbour/issues/9"},"comments":{"href":"https://api.github.com/repos/netharbour/netharbour/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/netharbour/netharbour/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/netharbour/netharbour/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netharbour/netharbour/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/netharbour/netharbour/statuses/eef284372e77ede5d9334e8905c0b9841964dca5"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":true,"rebaseable":false,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":24,"deletions":7,"changed_files":2}}
{"actor":{"display_login":"ctomkow"}}