diff --git a/apc_cache.c b/apc_cache.c index 480dd001..7e7e7a19 100644 --- a/apc_cache.c +++ b/apc_cache.c @@ -1218,6 +1218,9 @@ PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t *cache, zend_string *key, t PHP_APCU_API void apc_cache_serializer(apc_cache_t* cache, const char* name) { if (cache && !cache->serializer) { cache->serializer = apc_find_serializer(name); + if (strcmp(name, "default") != 0 && !cache->serializer) { + php_error_docref(NULL, E_WARNING, "apc_cache_serializer: serializer \"%s\" is not supported", name); + } } } /* }}} */ diff --git a/tests/serializer_invalid.phpt b/tests/serializer_invalid.phpt new file mode 100644 index 00000000..bd4c662e --- /dev/null +++ b/tests/serializer_invalid.phpt @@ -0,0 +1,12 @@ +--TEST-- +Serializer: invalid pattern. +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.serializer=igbinary +--FILE-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.serializer=php +--FILE-- +