Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52bae8a

Browse files
michael-grunderyatsukhnenko
authored andcommitted
Hook msgpack into available serializers output
1 parent 545250f commit 52bae8a

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

redis.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,22 @@ PHP_MSHUTDOWN_FUNCTION(redis)
795795
return SUCCESS;
796796
}
797797

798+
static const char *get_available_serializers(void) {
799+
#ifdef HAVE_REDIS_IGBINARY
800+
#ifdef HAVE_REDIS_MSGPACK
801+
return "php, igbinary, msgpack";
802+
#else
803+
return "php, igbinary";
804+
#endif
805+
#else
806+
#ifdef HAVE_REDIS_MSGPACK
807+
return "php, msgpack";
808+
#else
809+
return "php";
810+
#endif
811+
#endif
812+
}
813+
798814
/**
799815
* PHP_MINFO_FUNCTION
800816
*/
@@ -806,11 +822,7 @@ PHP_MINFO_FUNCTION(redis)
806822
#ifdef GIT_REVISION
807823
php_info_print_table_row(2, "Git revision", "$Id: " GIT_REVISION " $");
808824
#endif
809-
#ifdef HAVE_REDIS_IGBINARY
810-
php_info_print_table_row(2, "Available serializers", "php, igbinary");
811-
#else
812-
php_info_print_table_row(2, "Available serializers", "php");
813-
#endif
825+
php_info_print_table_row(2, "Available serializers", get_available_serializers());
814826
#ifdef HAVE_REDIS_LZF
815827
php_info_print_table_row(2, "Available compression", "lzf");
816828
#endif

0 commit comments

Comments
 (0)