Skip to content

Commit ae147cf

Browse files
committed
Add missing checks for sessions in igbinary.c
Tentative fix for phpredis#137.
1 parent 32e8d41 commit ae147cf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

igbinary/igbinary.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
#include "hash.h"
3232

3333
/** Session serializer function prototypes. */
34+
#if HAVE_PHP_SESSION
3435
PS_SERIALIZER_FUNCS(igbinary);
36+
#endif
3537

3638
/* {{{ Types */
3739
enum igbinary_type {
@@ -343,6 +345,7 @@ PHP_FUNCTION(igbinary_serialize) {
343345
}
344346
/* }}} */
345347
/* {{{ Serializer encode function */
348+
#if HAVE_PHP_SESSION
346349
PS_SERIALIZER_ENCODE_FUNC(igbinary)
347350
{
348351
struct igbinary_serialize_data igsd;
@@ -367,7 +370,9 @@ PS_SERIALIZER_ENCODE_FUNC(igbinary)
367370

368371
return SUCCESS;
369372
}
373+
#endif
370374
/* }}} */
375+
#if HAVE_PHP_SESSION
371376
/* {{{ Serializer decode function */
372377
PS_SERIALIZER_DECODE_FUNC(igbinary) {
373378
HashPosition tmp_hash_pos;
@@ -426,6 +431,7 @@ PS_SERIALIZER_DECODE_FUNC(igbinary) {
426431

427432
return SUCCESS;
428433
}
434+
#endif
429435
/* }}} */
430436
/* {{{ igbinary_serialize_data_init */
431437
/** Inits igbinary_serialize_data. */

0 commit comments

Comments
 (0)