Skip to content

Commit 9e6cf01

Browse files
committed
Define ServerDescription::TYPE_LOAD_BALANCER
1 parent fb7d316 commit 9e6cf01

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/MongoDB/ServerDescription.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
zend_class_entry* php_phongo_serverdescription_ce;
3030

31+
/* Note: these constants are derived from _mongoc_topology_description_type,
32+
* since mongoc_server_description_type_t is private. */
3133
#define PHONGO_SERVER_UNKNOWN "Unknown"
3234
#define PHONGO_SERVER_STANDALONE "Standalone"
3335
#define PHONGO_SERVER_MONGOS "Mongos"
@@ -37,6 +39,7 @@ zend_class_entry* php_phongo_serverdescription_ce;
3739
#define PHONGO_SERVER_RS_ARBITER "RSArbiter"
3840
#define PHONGO_SERVER_RS_OTHER "RSOther"
3941
#define PHONGO_SERVER_RS_GHOST "RSGhost"
42+
#define PHONGO_SERVER_LOAD_BALANCER "LoadBalancer"
4043

4144
/* {{{ proto array MongoDB\Driver\ServerDescription::getHelloResponse()
4245
Returns the most recent "hello" response */
@@ -269,6 +272,7 @@ void php_phongo_serverdescription_init_ce(INIT_FUNC_ARGS) /* {{{ */
269272
zend_declare_class_constant_string(php_phongo_serverdescription_ce, ZEND_STRL("TYPE_RS_ARBITER"), PHONGO_SERVER_RS_ARBITER);
270273
zend_declare_class_constant_string(php_phongo_serverdescription_ce, ZEND_STRL("TYPE_RS_OTHER"), PHONGO_SERVER_RS_OTHER);
271274
zend_declare_class_constant_string(php_phongo_serverdescription_ce, ZEND_STRL("TYPE_RS_GHOST"), PHONGO_SERVER_RS_GHOST);
275+
zend_declare_class_constant_string(php_phongo_serverdescription_ce, ZEND_STRL("TYPE_LOAD_BALANCER"), PHONGO_SERVER_LOAD_BALANCER);
272276
} /* }}} */
273277

274278
/*

tests/serverDescription/serverDescription-constants.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_SECONDARY);
1212
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_ARBITER);
1313
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_OTHER);
1414
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_GHOST);
15+
var_dump(MongoDB\Driver\ServerDescription::TYPE_LOAD_BALANCER);
1516

1617
?>
1718
===DONE===
@@ -26,4 +27,5 @@ string(11) "RSSecondary"
2627
string(9) "RSArbiter"
2728
string(7) "RSOther"
2829
string(7) "RSGhost"
30+
string(12) "LoadBalancer"
2931
===DONE===

0 commit comments

Comments
 (0)