GitHub PullRequestReviewCommentEvent at 2014-07-03 07:47:47
Repository: php-zmq
Actor: mkoppanen
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/comments/14500744","id":14500744,"diff_hunk":"@@ -1578,6 +1590,413 @@ PHP_METHOD(zmqdevice, __clone) { }\n \n /* -- END ZMQPoll */\n \n+#ifdef HAVE_ZYRE_1\n+\n+/* --- START ZMQZyre --- */\n+\n+static void php_zmq_zyre_free_storage(void *object TSRMLS_DC)\n+{\n+\tphp_zmq_zyre *zmq_zyre = (php_zmq_zyre *) object;\n+\n+    if (zmq_zyre->internalSocket != NULL) {\n+\t    zend_objects_store_del_ref(zmq_zyre->internalSocket TSRMLS_CC);\n+\t    zval_ptr_dtor (&zmq_zyre->internalSocket);\n+\t}\n+\t\t\n+    zyre_destroy(&zmq_zyre->zyre);\n+    zctx_destroy(&zmq_zyre->shadow_context);\n+\n+\tzend_object_std_dtor(&zmq_zyre->zend_object TSRMLS_CC);\n+\tefree(zmq_zyre);\n+}\n+\n+static zend_object_value php_zmq_zyre_object_new(zend_class_entry *class_type TSRMLS_DC)\n+{\n+\tzend_object_value result;\n+\tphp_zmq_zyre *zmq_zyre;\n+\n+\tzmq_zyre = (php_zmq_zyre *) emalloc(sizeof(php_zmq_zyre));\n+\tmemset(&zmq_zyre->zend_object, 0, sizeof(zend_object));\n+\n+\t/* zbeacon is initialised in ZMQZyre#__construct. */\n+\tzmq_zyre->zyre = NULL;\n+    zmq_zyre->internalSocket = NULL;\n+\tzend_object_std_init(&zmq_zyre->zend_object, class_type TSRMLS_CC);\n+\tobject_properties_init(&zmq_zyre->zend_object, class_type);\n+\n+\tresult.handle = zend_objects_store_put(\n+\t\tzmq_zyre,\n+\t\tNULL,\n+\t\t(zend_objects_free_object_storage_t) php_zmq_zyre_free_storage,\n+\t\tNULL TSRMLS_CC\n+\t);\n+\tresult.handlers = &zmq_zyre_object_handlers;\n+\treturn result;\n+}\n+\n+/* {{{ proto void ZMQZyre::__construct(ZMQContext context)\n+\tConstruct a ZMQZyre\n+*/\n+PHP_METHOD(zmqzyre, __construct)\n+{\n+\tphp_zmq_zyre *this;\n+\tzval *object;\n+\tphp_zmq_context_object *context_object;\n+\n+\tthis = (php_zmq_zyre *) zend_object_store_get_object(getThis() TSRMLS_CC);\n+\n+\tif (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, \"O\", &object, php_zmq_context_sc_entry) != SUCCESS) {\n+\t\treturn;\n+\t}\n+\n+\tcontext_object = (php_zmq_context_object *) zend_object_store_get_object(object TSRMLS_CC);\n+\n+\tthis->shadow_context = zctx_shadow_zmq_ctx(context_object->context->z_ctx);\n+\tif (this->shadow_context == NULL) {\n+\t\tzend_throw_exception_ex(php_zmq_zyre_exception_sc_entry, errno TSRMLS_CC, \"Failed to create the underlying shadow context object.\");\n+\t}\n+\n+\tthis->zyre = zyre_new(this->shadow_context);\n+\tif (this->zyre == NULL) {\n+\t\tzend_throw_exception_ex(php_zmq_zyre_exception_sc_entry, errno TSRMLS_CC, \"Failed to create the underlying zbeacon object.\");\n+\t}\n+\n+\treturn;\n+}\n+/* }}} */\n+\n+ZEND_BEGIN_ARG_INFO_EX(zmqzyre___construct_args, 0, 0, 1)\n+\tZEND_ARG_OBJ_INFO(0, ZMQContext, ZMQContext, 0)\n+ZEND_END_ARG_INFO();\n+\n+/* {{{ proto void ZMQZyre::setHeader(string name, string value)\n+\tSet node header; these are provided to other nodes during discovery and come in each ENTER message.\n+*/\n+PHP_METHOD(zmqzyre, setHeader)\n+{\n+\tPHP_ZMQ_ZYRE_OBJECT;\n+\tchar *name, *value;\n+\tint name_len, value_len;\n+\n+\tif (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, \"ss\", &name, &name_len, &value, &value_len) == FAILURE) {\n+\t\treturn;\n+\t}\n+\n+    zyre_set_header(this->zyre, name, value);\n+\n+\tZMQ_RETURN_THIS;\n+}\n+/* }}} */\n+\n+ZEND_BEGIN_ARG_INFO_EX(zmqzyre_setHeader_args, 0, 0, 1)\n+\tZEND_ARG_INFO(0, name)\n+\tZEND_ARG_INFO(0, value)\n+ZEND_END_ARG_INFO();\n+\n+/* {{{ proto void ZMQZyre::start()\n+\tStart node, after setting header values. When you start a node it begins discovery and connection.\n+\tThere is no stop method; to stop a node, destroy it.\n+*/\n+PHP_METHOD(zmqzyre, start)\n+{\n+\tPHP_ZMQ_ZYRE_OBJECT;\n+\n+    zyre_start(this->zyre);\n+\n+\tZMQ_RETURN_THIS;\n+}\n+/* }}} */\n+\n+ZEND_BEGIN_ARG_INFO_EX(zmqzyre_start_args, 0, 0, 1)\n+ZEND_END_ARG_INFO();\n+\n+/* {{{ proto void ZMQZyre::stop()\n+\tStop node, this signals to other peers that this node will go away.\n+\tThis is polite; however you can also just destroy the node without stopping it.\n+*/\n+PHP_METHOD(zmqzyre, stop)\n+{\n+\tPHP_ZMQ_ZYRE_OBJECT;\n+\n+    zyre_stop(this->zyre);\n+\n+\tZMQ_RETURN_THIS;\n+}\n+/* }}} */\n+\n+ZEND_BEGIN_ARG_INFO_EX(zmqzyre_stop_args, 0, 0, 1)\n+ZEND_END_ARG_INFO();\n+\n+/* {{{ proto void ZMQZyre::join(string group)\n+\tJoin a named group; after joining a group you can send messages \n+\tto the group and all Zyre nodes in that group will receive them.\n+*/\n+PHP_METHOD(zmqzyre, join)\n+{\n+\tPHP_ZMQ_ZYRE_OBJECT;\n+\tchar *group;\n+\tint group_len;\n+\n+\tif (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, \"s\", &group, &group_len) == FAILURE) {\n+\t\treturn;\n+\t}\n+\n+    zyre_join(this->zyre, group);","path":"zmq.c","position":186,"original_position":186,"commit_id":"b35155c6146a82adb906b114a92033aa477ba758","original_commit_id":"b35155c6146a82adb906b114a92033aa477ba758","user":{"login":"mkoppanen","id":90124,"avatar_url":"https://avatars.githubusercontent.com/u/90124?","gravatar_id":"25fe4d1d083bbe7e6935fb5c82fc110d","url":"https://api.github.com/users/mkoppanen","html_url":"https://github.com/mkoppanen","followers_url":"https://api.github.com/users/mkoppanen/followers","following_url":"https://api.github.com/users/mkoppanen/following{/other_user}","gists_url":"https://api.github.com/users/mkoppanen/gists{/gist_id}","starred_url":"https://api.github.com/users/mkoppanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkoppanen/subscriptions","organizations_url":"https://api.github.com/users/mkoppanen/orgs","repos_url":"https://api.github.com/users/mkoppanen/repos","events_url":"https://api.github.com/users/mkoppanen/events{/privacy}","received_events_url":"https://api.github.com/users/mkoppanen/received_events","type":"User","site_admin":false},"body":"Indentation?","created_at":"2014-07-03T07:47:47Z","updated_at":"2014-07-03T07:47:47Z","html_url":"https://github.com/mkoppanen/php-zmq/pull/133#discussion_r14500744","pull_request_url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/comments/14500744"},"html":{"href":"https://github.com/mkoppanen/php-zmq/pull/133#discussion_r14500744"},"pull_request":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133","id":17929365,"html_url":"https://github.com/mkoppanen/php-zmq/pull/133","diff_url":"https://github.com/mkoppanen/php-zmq/pull/133.diff","patch_url":"https://github.com/mkoppanen/php-zmq/pull/133.patch","issue_url":"https://api.github.com/repos/mkoppanen/php-zmq/issues/133","number":133,"state":"open","title":"Zyre binding","user":{"login":"wysman","id":1042272,"avatar_url":"https://avatars.githubusercontent.com/u/1042272?","gravatar_id":"63fd2d0c22f6135a861ccef9e472949a","url":"https://api.github.com/users/wysman","html_url":"https://github.com/wysman","followers_url":"https://api.github.com/users/wysman/followers","following_url":"https://api.github.com/users/wysman/following{/other_user}","gists_url":"https://api.github.com/users/wysman/gists{/gist_id}","starred_url":"https://api.github.com/users/wysman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wysman/subscriptions","organizations_url":"https://api.github.com/users/wysman/orgs","repos_url":"https://api.github.com/users/wysman/repos","events_url":"https://api.github.com/users/wysman/events{/privacy}","received_events_url":"https://api.github.com/users/wysman/received_events","type":"User","site_admin":false},"body":"Add the class ZMQZyre which is a binding of the libzyre. Zyre is an open-source framework for proximity-based peer-to-peer applications. Zyre is based on ZMQ and supported by iMatix.\r\n\r\nThe ZMQZyre class is add to the php extension if all library dependency are validate, if not this part of the code is disable automatically to avoid build error.\r\n- libzyre == 1.x.x\r\n- czmq >= 2.2.0\r\n","created_at":"2014-07-03T07:27:11Z","updated_at":"2014-07-03T07:47:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11c252303eedf77a770fdf0d716f0d5b08bf119c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133/commits","review_comments_url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133/comments","review_comment_url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mkoppanen/php-zmq/issues/133/comments","statuses_url":"https://api.github.com/repos/mkoppanen/php-zmq/statuses/b35155c6146a82adb906b114a92033aa477ba758","head":{"label":"wysman:zyre","ref":"zyre","sha":"b35155c6146a82adb906b114a92033aa477ba758","user":{"login":"wysman","id":1042272,"avatar_url":"https://avatars.githubusercontent.com/u/1042272?","gravatar_id":"63fd2d0c22f6135a861ccef9e472949a","url":"https://api.github.com/users/wysman","html_url":"https://github.com/wysman","followers_url":"https://api.github.com/users/wysman/followers","following_url":"https://api.github.com/users/wysman/following{/other_user}","gists_url":"https://api.github.com/users/wysman/gists{/gist_id}","starred_url":"https://api.github.com/users/wysman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wysman/subscriptions","organizations_url":"https://api.github.com/users/wysman/orgs","repos_url":"https://api.github.com/users/wysman/repos","events_url":"https://api.github.com/users/wysman/events{/privacy}","received_events_url":"https://api.github.com/users/wysman/received_events","type":"User","site_admin":false},"repo":{"id":21390328,"name":"php-zmq","full_name":"wysman/php-zmq","owner":{"login":"wysman","id":1042272,"avatar_url":"https://avatars.githubusercontent.com/u/1042272?","gravatar_id":"63fd2d0c22f6135a861ccef9e472949a","url":"https://api.github.com/users/wysman","html_url":"https://github.com/wysman","followers_url":"https://api.github.com/users/wysman/followers","following_url":"https://api.github.com/users/wysman/following{/other_user}","gists_url":"https://api.github.com/users/wysman/gists{/gist_id}","starred_url":"https://api.github.com/users/wysman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wysman/subscriptions","organizations_url":"https://api.github.com/users/wysman/orgs","repos_url":"https://api.github.com/users/wysman/repos","events_url":"https://api.github.com/users/wysman/events{/privacy}","received_events_url":"https://api.github.com/users/wysman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wysman/php-zmq","description":"ZeroMQ for PHP","fork":true,"url":"https://api.github.com/repos/wysman/php-zmq","forks_url":"https://api.github.com/repos/wysman/php-zmq/forks","keys_url":"https://api.github.com/repos/wysman/php-zmq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wysman/php-zmq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wysman/php-zmq/teams","hooks_url":"https://api.github.com/repos/wysman/php-zmq/hooks","issue_events_url":"https://api.github.com/repos/wysman/php-zmq/issues/events{/number}","events_url":"https://api.github.com/repos/wysman/php-zmq/events","assignees_url":"https://api.github.com/repos/wysman/php-zmq/assignees{/user}","branches_url":"https://api.github.com/repos/wysman/php-zmq/branches{/branch}","tags_url":"https://api.github.com/repos/wysman/php-zmq/tags","blobs_url":"https://api.github.com/repos/wysman/php-zmq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wysman/php-zmq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wysman/php-zmq/git/refs{/sha}","trees_url":"https://api.github.com/repos/wysman/php-zmq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wysman/php-zmq/statuses/{sha}","languages_url":"https://api.github.com/repos/wysman/php-zmq/languages","stargazers_url":"https://api.github.com/repos/wysman/php-zmq/stargazers","contributors_url":"https://api.github.com/repos/wysman/php-zmq/contributors","subscribers_url":"https://api.github.com/repos/wysman/php-zmq/subscribers","subscription_url":"https://api.github.com/repos/wysman/php-zmq/subscription","commits_url":"https://api.github.com/repos/wysman/php-zmq/commits{/sha}","git_commits_url":"https://api.github.com/repos/wysman/php-zmq/git/commits{/sha}","comments_url":"https://api.github.com/repos/wysman/php-zmq/comments{/number}","issue_comment_url":"https://api.github.com/repos/wysman/php-zmq/issues/comments/{number}","contents_url":"https://api.github.com/repos/wysman/php-zmq/contents/{+path}","compare_url":"https://api.github.com/repos/wysman/php-zmq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wysman/php-zmq/merges","archive_url":"https://api.github.com/repos/wysman/php-zmq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wysman/php-zmq/downloads","issues_url":"https://api.github.com/repos/wysman/php-zmq/issues{/number}","pulls_url":"https://api.github.com/repos/wysman/php-zmq/pulls{/number}","milestones_url":"https://api.github.com/repos/wysman/php-zmq/milestones{/number}","notifications_url":"https://api.github.com/repos/wysman/php-zmq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wysman/php-zmq/labels{/name}","releases_url":"https://api.github.com/repos/wysman/php-zmq/releases{/id}","created_at":"2014-07-01T14:17:52Z","updated_at":"2014-07-01T14:18:35Z","pushed_at":"2014-07-03T07:17:19Z","git_url":"git://github.com/wysman/php-zmq.git","ssh_url":"git@github.com:wysman/php-zmq.git","clone_url":"https://github.com/wysman/php-zmq.git","svn_url":"https://github.com/wysman/php-zmq","homepage":"http://pecl.php.net/zmq","size":2143,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mkoppanen:master","ref":"master","sha":"f8cfde30ad9ff65068a664fc5a768e0a1ec8abaf","user":{"login":"mkoppanen","id":90124,"avatar_url":"https://avatars.githubusercontent.com/u/90124?","gravatar_id":"25fe4d1d083bbe7e6935fb5c82fc110d","url":"https://api.github.com/users/mkoppanen","html_url":"https://github.com/mkoppanen","followers_url":"https://api.github.com/users/mkoppanen/followers","following_url":"https://api.github.com/users/mkoppanen/following{/other_user}","gists_url":"https://api.github.com/users/mkoppanen/gists{/gist_id}","starred_url":"https://api.github.com/users/mkoppanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkoppanen/subscriptions","organizations_url":"https://api.github.com/users/mkoppanen/orgs","repos_url":"https://api.github.com/users/mkoppanen/repos","events_url":"https://api.github.com/users/mkoppanen/events{/privacy}","received_events_url":"https://api.github.com/users/mkoppanen/received_events","type":"User","site_admin":false},"repo":{"id":588896,"name":"php-zmq","full_name":"mkoppanen/php-zmq","owner":{"login":"mkoppanen","id":90124,"avatar_url":"https://avatars.githubusercontent.com/u/90124?","gravatar_id":"25fe4d1d083bbe7e6935fb5c82fc110d","url":"https://api.github.com/users/mkoppanen","html_url":"https://github.com/mkoppanen","followers_url":"https://api.github.com/users/mkoppanen/followers","following_url":"https://api.github.com/users/mkoppanen/following{/other_user}","gists_url":"https://api.github.com/users/mkoppanen/gists{/gist_id}","starred_url":"https://api.github.com/users/mkoppanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkoppanen/subscriptions","organizations_url":"https://api.github.com/users/mkoppanen/orgs","repos_url":"https://api.github.com/users/mkoppanen/repos","events_url":"https://api.github.com/users/mkoppanen/events{/privacy}","received_events_url":"https://api.github.com/users/mkoppanen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mkoppanen/php-zmq","description":"ZeroMQ for PHP","fork":false,"url":"https://api.github.com/repos/mkoppanen/php-zmq","forks_url":"https://api.github.com/repos/mkoppanen/php-zmq/forks","keys_url":"https://api.github.com/repos/mkoppanen/php-zmq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkoppanen/php-zmq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkoppanen/php-zmq/teams","hooks_url":"https://api.github.com/repos/mkoppanen/php-zmq/hooks","issue_events_url":"https://api.github.com/repos/mkoppanen/php-zmq/issues/events{/number}","events_url":"https://api.github.com/repos/mkoppanen/php-zmq/events","assignees_url":"https://api.github.com/repos/mkoppanen/php-zmq/assignees{/user}","branches_url":"https://api.github.com/repos/mkoppanen/php-zmq/branches{/branch}","tags_url":"https://api.github.com/repos/mkoppanen/php-zmq/tags","blobs_url":"https://api.github.com/repos/mkoppanen/php-zmq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkoppanen/php-zmq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkoppanen/php-zmq/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkoppanen/php-zmq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkoppanen/php-zmq/statuses/{sha}","languages_url":"https://api.github.com/repos/mkoppanen/php-zmq/languages","stargazers_url":"https://api.github.com/repos/mkoppanen/php-zmq/stargazers","contributors_url":"https://api.github.com/repos/mkoppanen/php-zmq/contributors","subscribers_url":"https://api.github.com/repos/mkoppanen/php-zmq/subscribers","subscription_url":"https://api.github.com/repos/mkoppanen/php-zmq/subscription","commits_url":"https://api.github.com/repos/mkoppanen/php-zmq/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkoppanen/php-zmq/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkoppanen/php-zmq/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkoppanen/php-zmq/issues/comments/{number}","contents_url":"https://api.github.com/repos/mkoppanen/php-zmq/contents/{+path}","compare_url":"https://api.github.com/repos/mkoppanen/php-zmq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkoppanen/php-zmq/merges","archive_url":"https://api.github.com/repos/mkoppanen/php-zmq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkoppanen/php-zmq/downloads","issues_url":"https://api.github.com/repos/mkoppanen/php-zmq/issues{/number}","pulls_url":"https://api.github.com/repos/mkoppanen/php-zmq/pulls{/number}","milestones_url":"https://api.github.com/repos/mkoppanen/php-zmq/milestones{/number}","notifications_url":"https://api.github.com/repos/mkoppanen/php-zmq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkoppanen/php-zmq/labels{/name}","releases_url":"https://api.github.com/repos/mkoppanen/php-zmq/releases{/id}","created_at":"2010-03-31T19:28:01Z","updated_at":"2014-07-02T06:12:23Z","pushed_at":"2014-05-26T19:27:28Z","git_url":"git://github.com/mkoppanen/php-zmq.git","ssh_url":"git@github.com:mkoppanen/php-zmq.git","clone_url":"https://github.com/mkoppanen/php-zmq.git","svn_url":"https://github.com/mkoppanen/php-zmq","homepage":"http://pecl.php.net/zmq","size":2143,"stargazers_count":245,"watchers_count":245,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":59,"mirror_url":null,"open_issues_count":12,"forks":59,"open_issues":12,"watchers":245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133"},"html":{"href":"https://github.com/mkoppanen/php-zmq/pull/133"},"issue":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/issues/133"},"comments":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/mkoppanen/php-zmq/statuses/b35155c6146a82adb906b114a92033aa477ba758"}}}}