Skip to content

Commit e7a15f5

Browse files
committed
Remove levelToString() function, which is not needed by PHPLIB
1 parent 2f66bcf commit e7a15f5

File tree

4 files changed

+2
-59
lines changed

4 files changed

+2
-59
lines changed

src/MongoDB/Logging/functions.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PHP_FUNCTION(MongoDB_Driver_Logging_addLogger)
3737
phongo_log_add_logger(logger);
3838
}
3939

40-
/* Log a message */
40+
/* Log a message through libmongoc */
4141
PHP_FUNCTION(MongoDB_Driver_Logging_log)
4242
{
4343
zend_long level;
@@ -69,19 +69,6 @@ PHP_FUNCTION(MongoDB_Driver_Logging_log)
6969
mongoc_log(level, PHONGO_LOG_DOMAIN, "%s", message);
7070
}
7171

72-
/* Log a message */
73-
PHP_FUNCTION(MongoDB_Driver_Logging_levelToString)
74-
{
75-
zend_long level;
76-
77-
PHONGO_PARSE_PARAMETERS_START(1, 1)
78-
Z_PARAM_LONG(level)
79-
PHONGO_PARSE_PARAMETERS_END();
80-
81-
/* TODO: throw if level is invalid, instead of returning "UNKNOWN" */
82-
RETURN_STRING(mongoc_log_level_str(level));
83-
}
84-
8572
/* Unregisters a global logger */
8673
PHP_FUNCTION(MongoDB_Driver_Logging_removeLogger)
8774
{

src/functions.stub.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ function toRelaxedExtendedJSON(string $bson): string {}
2929
namespace MongoDB\Driver\Logging {
3030
function addLogger(Logger $logger): void {}
3131

32-
function levelToString(int $level): string {}
33-
3432
function log(int $level, string $message): void {}
3533

3634
function removeLogger(Logger $logger): void {}

src/functions_arginfo.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 1be598a54b01187349f9e8cd5174f85678d9d8e1 */
2+
* Stub hash: 4c002ef176f5f68012575fc9cbe1a3919f12a353 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_MongoDB_BSON_fromJSON, 0, 1, IS_STRING, 0)
55
ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0)
@@ -43,10 +43,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_MongoDB_Driver_Logging_addLogger
4343
ZEND_ARG_OBJ_INFO(0, logger, MongoDB\\Driver\\Logging\\Logger, 0)
4444
ZEND_END_ARG_INFO()
4545

46-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_MongoDB_Driver_Logging_levelToString, 0, 1, IS_STRING, 0)
47-
ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0)
48-
ZEND_END_ARG_INFO()
49-
5046
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_MongoDB_Driver_Logging_log, 0, 2, IS_VOID, 0)
5147
ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0)
5248
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
@@ -78,7 +74,6 @@ ZEND_FUNCTION(MongoDB_BSON_toPHP);
7874
#endif
7975
ZEND_FUNCTION(MongoDB_BSON_toRelaxedExtendedJSON);
8076
ZEND_FUNCTION(MongoDB_Driver_Logging_addLogger);
81-
ZEND_FUNCTION(MongoDB_Driver_Logging_levelToString);
8277
ZEND_FUNCTION(MongoDB_Driver_Logging_log);
8378
ZEND_FUNCTION(MongoDB_Driver_Logging_removeLogger);
8479
ZEND_FUNCTION(MongoDB_Driver_Monitoring_addSubscriber);
@@ -103,7 +98,6 @@ static const zend_function_entry ext_functions[] = {
10398
#endif
10499
ZEND_NS_FALIAS("MongoDB\\BSON", toRelaxedExtendedJSON, MongoDB_BSON_toRelaxedExtendedJSON, arginfo_MongoDB_BSON_toRelaxedExtendedJSON)
105100
ZEND_NS_FALIAS("MongoDB\\Driver\\Logging", addLogger, MongoDB_Driver_Logging_addLogger, arginfo_MongoDB_Driver_Logging_addLogger)
106-
ZEND_NS_FALIAS("MongoDB\\Driver\\Logging", levelToString, MongoDB_Driver_Logging_levelToString, arginfo_MongoDB_Driver_Logging_levelToString)
107101
ZEND_NS_FALIAS("MongoDB\\Driver\\Logging", log, MongoDB_Driver_Logging_log, arginfo_MongoDB_Driver_Logging_log)
108102
ZEND_NS_FALIAS("MongoDB\\Driver\\Logging", removeLogger, MongoDB_Driver_Logging_removeLogger, arginfo_MongoDB_Driver_Logging_removeLogger)
109103
ZEND_NS_FALIAS("MongoDB\\Driver\\Monitoring", addSubscriber, MongoDB_Driver_Monitoring_addSubscriber, arginfo_MongoDB_Driver_Monitoring_addSubscriber)

tests/logging/levelToString-001.phpt

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)