{"action":"created","comment":{"url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/comments/25122403","id":25122403,"diff_hunk":"@@ -0,0 +1,189 @@\n+<?php\n+\n+/**\n+ * Network Management Command\n+ *\n+ */\n+class WPMultiNetwork_Command extends WP_CLI_Command {\n+\n+\t/**\n+\t * @var array $obj_fields Default fields to display for each object.\n+\t */\n+\tprotected $obj_fields = array(\n+\t\t\"id\",\n+\t\t\"domain\",\n+\t\t\"path\"\n+\t);\n+\n+\t/**\n+\t * Add a Network\n+\t *\n+\t * <domain>\n+\t * : Domain for network\n+\t *\n+\t * <path>\n+\t * : Path for network\n+\t *\n+\t * [--site_name=<site_name>]\n+\t * : Name of new network\n+\t *\n+\t * [--clone_network=<clone_network>]\n+\t * : ID of network to clone\n+\t *\n+\t * [--options_to_clone=<options_to_clone>]\n+\t * : Options to clone to new network\n+\t *\n+\t */\n+\tpublic function create( $args, $assoc_args ) {\n+\n+\t\tlist ( $domain, $path ) = $args;\n+\n+\t\t$defaults   = array( 'site_name' => false, 'clone_network' => false, 'options_to_clone' => false );\n+\t\t$assoc_args = wp_parse_args( $assoc_args, $defaults );\n+\n+\t\t$clone_network = $assoc_args['clone_network'];\n+\t\t$options_to_clone = false;\n+\n+\t\tif ( ! empty( $clone_network ) && !network_exists( $clone_network ) ) {\n+\t\t\tWP_CLI::error( sprintf( 'Clone network %s doesn\\'t exist.', $clone_network ) );\n+\n+\t\t\tif ( ! empty( $assoc_args['options_to_clone'] ) ) {\n+\t\t\t\t$options_to_clone = explode( \",\", $assoc_args['options_to_clone'] );\n+\t\t\t}\n+\t\t}\n+\n+\t\t$network_id = add_network( $domain, $path, $assoc_args['site_name'], $clone_network, $options_to_clone );\n+\n+\t\tif ( is_wp_error( $network_id ) ) {\n+\t\t\tWP_CLI::error( $network_id );\n+\t\t}\n+\n+\t\tWP_CLI::success( sprintf( 'Created network %d.', $network_id ) );\n+\n+\t}\n+\n+\t/**\n+\t * Update a Network\n+\t *\n+\t * <id>\n+\t * : ID for network\n+\t *\n+\t * <domain>\n+\t * : Domain for network\n+\t *\n+\t * [--path=<path>]\n+\t * : Path for network\n+\t *\n+\t */\n+\tpublic function update( $args, $assoc_args ) {\n+\n+\t\tlist ( $id, $domain ) = $args;","path":"src/includes/class-wp-cli.php","position":80,"original_position":80,"commit_id":"06f6e7dbdece39dc7fdf3cba1a6c4f3c66cfaa6c","original_commit_id":"06f6e7dbdece39dc7fdf3cba1a6c4f3c66cfaa6c","user":{"login":"rmccue","id":21655,"avatar_url":"https://avatars.githubusercontent.com/u/21655?v=3","gravatar_id":"","url":"https://api.github.com/users/rmccue","html_url":"https://github.com/rmccue","followers_url":"https://api.github.com/users/rmccue/followers","following_url":"https://api.github.com/users/rmccue/following{/other_user}","gists_url":"https://api.github.com/users/rmccue/gists{/gist_id}","starred_url":"https://api.github.com/users/rmccue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmccue/subscriptions","organizations_url":"https://api.github.com/users/rmccue/orgs","repos_url":"https://api.github.com/users/rmccue/repos","events_url":"https://api.github.com/users/rmccue/events{/privacy}","received_events_url":"https://api.github.com/users/rmccue/received_events","type":"User","site_admin":false},"body":"See pedantic note above :)","created_at":"2015-02-21T14:15:57Z","updated_at":"2015-02-21T14:15:57Z","html_url":"https://github.com/johnjamesjacoby/wp-multi-network/pull/33#discussion_r25122403","pull_request_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/comments/25122403"},"html":{"href":"https://github.com/johnjamesjacoby/wp-multi-network/pull/33#discussion_r25122403"},"pull_request":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33","id":29707468,"html_url":"https://github.com/johnjamesjacoby/wp-multi-network/pull/33","diff_url":"https://github.com/johnjamesjacoby/wp-multi-network/pull/33.diff","patch_url":"https://github.com/johnjamesjacoby/wp-multi-network/pull/33.patch","issue_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues/33","number":33,"state":"open","locked":false,"title":"Added WP-CLI","user":{"login":"spacedmonkey","id":237508,"avatar_url":"https://avatars.githubusercontent.com/u/237508?v=3","gravatar_id":"","url":"https://api.github.com/users/spacedmonkey","html_url":"https://github.com/spacedmonkey","followers_url":"https://api.github.com/users/spacedmonkey/followers","following_url":"https://api.github.com/users/spacedmonkey/following{/other_user}","gists_url":"https://api.github.com/users/spacedmonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/spacedmonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacedmonkey/subscriptions","organizations_url":"https://api.github.com/users/spacedmonkey/orgs","repos_url":"https://api.github.com/users/spacedmonkey/repos","events_url":"https://api.github.com/users/spacedmonkey/events{/privacy}","received_events_url":"https://api.github.com/users/spacedmonkey/received_events","type":"User","site_admin":false},"body":"Added WP CLI interface for wp multi network","created_at":"2015-02-20T16:08:00Z","updated_at":"2015-02-21T14:15:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"859c2b92ac08168a2193f0722d8fac3c23141eea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33/commits","review_comments_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33/comments","review_comment_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/comments/{number}","comments_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues/33/comments","statuses_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/statuses/06f6e7dbdece39dc7fdf3cba1a6c4f3c66cfaa6c","head":{"label":"spacedmonkey:WP_CLI","ref":"WP_CLI","sha":"06f6e7dbdece39dc7fdf3cba1a6c4f3c66cfaa6c","user":{"login":"spacedmonkey","id":237508,"avatar_url":"https://avatars.githubusercontent.com/u/237508?v=3","gravatar_id":"","url":"https://api.github.com/users/spacedmonkey","html_url":"https://github.com/spacedmonkey","followers_url":"https://api.github.com/users/spacedmonkey/followers","following_url":"https://api.github.com/users/spacedmonkey/following{/other_user}","gists_url":"https://api.github.com/users/spacedmonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/spacedmonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacedmonkey/subscriptions","organizations_url":"https://api.github.com/users/spacedmonkey/orgs","repos_url":"https://api.github.com/users/spacedmonkey/repos","events_url":"https://api.github.com/users/spacedmonkey/events{/privacy}","received_events_url":"https://api.github.com/users/spacedmonkey/received_events","type":"User","site_admin":false},"repo":{"id":31070621,"name":"wp-multi-network","full_name":"spacedmonkey/wp-multi-network","owner":{"login":"spacedmonkey","id":237508,"avatar_url":"https://avatars.githubusercontent.com/u/237508?v=3","gravatar_id":"","url":"https://api.github.com/users/spacedmonkey","html_url":"https://github.com/spacedmonkey","followers_url":"https://api.github.com/users/spacedmonkey/followers","following_url":"https://api.github.com/users/spacedmonkey/following{/other_user}","gists_url":"https://api.github.com/users/spacedmonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/spacedmonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacedmonkey/subscriptions","organizations_url":"https://api.github.com/users/spacedmonkey/orgs","repos_url":"https://api.github.com/users/spacedmonkey/repos","events_url":"https://api.github.com/users/spacedmonkey/events{/privacy}","received_events_url":"https://api.github.com/users/spacedmonkey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spacedmonkey/wp-multi-network","description":"A Network Management UI for global admins in a WordPress Multisite environment","fork":true,"url":"https://api.github.com/repos/spacedmonkey/wp-multi-network","forks_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/forks","keys_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/teams","hooks_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/hooks","issue_events_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/issues/events{/number}","events_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/events","assignees_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/assignees{/user}","branches_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/branches{/branch}","tags_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/tags","blobs_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/git/refs{/sha}","trees_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/statuses/{sha}","languages_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/languages","stargazers_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/stargazers","contributors_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/contributors","subscribers_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/subscribers","subscription_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/subscription","commits_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/commits{/sha}","git_commits_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/git/commits{/sha}","comments_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/comments{/number}","issue_comment_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/issues/comments/{number}","contents_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/contents/{+path}","compare_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/merges","archive_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/downloads","issues_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/issues{/number}","pulls_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/pulls{/number}","milestones_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/milestones{/number}","notifications_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/labels{/name}","releases_url":"https://api.github.com/repos/spacedmonkey/wp-multi-network/releases{/id}","created_at":"2015-02-20T15:25:34Z","updated_at":"2015-02-20T15:25:35Z","pushed_at":"2015-02-20T16:07:00Z","git_url":"git://github.com/spacedmonkey/wp-multi-network.git","ssh_url":"git@github.com:spacedmonkey/wp-multi-network.git","clone_url":"https://github.com/spacedmonkey/wp-multi-network.git","svn_url":"https://github.com/spacedmonkey/wp-multi-network","homepage":null,"size":135,"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":"johnjamesjacoby:master","ref":"master","sha":"8d66cbc132bfda27cd766ad49dfa25f6d3a7c44e","user":{"login":"johnjamesjacoby","id":88951,"avatar_url":"https://avatars.githubusercontent.com/u/88951?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjamesjacoby","html_url":"https://github.com/johnjamesjacoby","followers_url":"https://api.github.com/users/johnjamesjacoby/followers","following_url":"https://api.github.com/users/johnjamesjacoby/following{/other_user}","gists_url":"https://api.github.com/users/johnjamesjacoby/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjamesjacoby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjamesjacoby/subscriptions","organizations_url":"https://api.github.com/users/johnjamesjacoby/orgs","repos_url":"https://api.github.com/users/johnjamesjacoby/repos","events_url":"https://api.github.com/users/johnjamesjacoby/events{/privacy}","received_events_url":"https://api.github.com/users/johnjamesjacoby/received_events","type":"User","site_admin":false},"repo":{"id":23466993,"name":"wp-multi-network","full_name":"johnjamesjacoby/wp-multi-network","owner":{"login":"johnjamesjacoby","id":88951,"avatar_url":"https://avatars.githubusercontent.com/u/88951?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjamesjacoby","html_url":"https://github.com/johnjamesjacoby","followers_url":"https://api.github.com/users/johnjamesjacoby/followers","following_url":"https://api.github.com/users/johnjamesjacoby/following{/other_user}","gists_url":"https://api.github.com/users/johnjamesjacoby/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjamesjacoby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjamesjacoby/subscriptions","organizations_url":"https://api.github.com/users/johnjamesjacoby/orgs","repos_url":"https://api.github.com/users/johnjamesjacoby/repos","events_url":"https://api.github.com/users/johnjamesjacoby/events{/privacy}","received_events_url":"https://api.github.com/users/johnjamesjacoby/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/johnjamesjacoby/wp-multi-network","description":"A Network Management UI for global admins in a WordPress Multisite environment","fork":false,"url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network","forks_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/forks","keys_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/teams","hooks_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/hooks","issue_events_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues/events{/number}","events_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/events","assignees_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/assignees{/user}","branches_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/branches{/branch}","tags_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/tags","blobs_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/git/refs{/sha}","trees_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/statuses/{sha}","languages_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/languages","stargazers_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/stargazers","contributors_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/contributors","subscribers_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/subscribers","subscription_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/subscription","commits_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/commits{/sha}","git_commits_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/git/commits{/sha}","comments_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/comments{/number}","issue_comment_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues/comments/{number}","contents_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/contents/{+path}","compare_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/merges","archive_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/downloads","issues_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues{/number}","pulls_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls{/number}","milestones_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/milestones{/number}","notifications_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/labels{/name}","releases_url":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/releases{/id}","created_at":"2014-08-29T14:42:55Z","updated_at":"2015-02-13T05:40:09Z","pushed_at":"2015-02-13T05:40:08Z","git_url":"git://github.com/johnjamesjacoby/wp-multi-network.git","ssh_url":"git@github.com:johnjamesjacoby/wp-multi-network.git","clone_url":"https://github.com/johnjamesjacoby/wp-multi-network.git","svn_url":"https://github.com/johnjamesjacoby/wp-multi-network","homepage":null,"size":451,"stargazers_count":28,"watchers_count":28,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":13,"forks":9,"open_issues":13,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33"},"html":{"href":"https://github.com/johnjamesjacoby/wp-multi-network/pull/33"},"issue":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues/33"},"comments":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/johnjamesjacoby/wp-multi-network/statuses/06f6e7dbdece39dc7fdf3cba1a6c4f3c66cfaa6c"}}}}