Skip to content

Travis CI matrix: PHP 5.5, 5.6. 7.0 but fewer revisions of libmemcached #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 133 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
949195d
PHP7 Support
rlerdorf Feb 3, 2015
f425bac
Merge pull request #162 from rlerdorf/php7
mkoppanen Feb 3, 2015
399b86b
More tests pass now
rlerdorf Feb 3, 2015
479b6e2
Fix 4 more tests
rlerdorf Feb 3, 2015
3a93af3
minor cleanup
rlerdorf Feb 3, 2015
a3279a8
Various bug fixes
laruence Feb 4, 2015
35a543f
Fixed memory leak
laruence Feb 4, 2015
cbcbece
Fixed getStat
laruence Feb 4, 2015
6851bdd
Fixed memory leak
laruence Feb 4, 2015
229c684
Better implementation
laruence Feb 4, 2015
1b2c225
Fixed memleak, and use the recently added object_size api
laruence Feb 4, 2015
e4f8f39
Down to 18 failed tests now
rlerdorf Feb 4, 2015
1bb38ab
Oops, need this for the inline stuff
rlerdorf Feb 4, 2015
fe3090e
Merge pull request #163 from rlerdorf/php7
mkoppanen Feb 4, 2015
a9f703c
Use strpprintf
laruence Feb 5, 2015
0021b5c
Use new session save handler
Feb 12, 2015
aa3bc57
Fixed mem issue (double free)
laruence Feb 12, 2015
4187e22
No more ZEND_CTOR_MAKE_NULL
rlerdorf Apr 23, 2015
650b67c
Update php_memcached.c
remicollet Jun 27, 2015
3c79a97
Merge pull request #2 from remicollet/patch-3
laruence Jun 28, 2015
2af8314
moar tests passing
krakjoe Aug 31, 2015
20636b2
down to four failures ...
krakjoe Aug 31, 2015
a335533
another test expecting the wrong thing, it seems
krakjoe Aug 31, 2015
c843be0
Merge pull request #169 from rlerdorf/php7
mkoppanen Sep 1, 2015
08cb8ff
bring travis up
krakjoe Sep 1, 2015
16cca32
Merge branch 'php7' of https://github.com/krakjoe/php-memcached into …
krakjoe Sep 1, 2015
545e34b
Merge branch 'php7' of https://github.com/php-memcached-dev/php-memca…
krakjoe Sep 1, 2015
3a8c8fd
disable stuff not available for 7 yet
krakjoe Sep 1, 2015
aaed353
some stabbing in the dark, why not
krakjoe Sep 1, 2015
5d2dd03
Merge pull request #180 from krakjoe/moar-tests-passing
krakjoe Sep 1, 2015
d354bf6
update test to skip in appropriate versions (make travis more useful)
krakjoe Sep 1, 2015
6cecbbd
Merge branch 'php7' of https://github.com/php-memcached-dev/php-memca…
krakjoe Sep 1, 2015
53bdf65
omg, I'm a fumbling idiot
krakjoe Sep 1, 2015
ba37051
fix json support
krakjoe Sep 1, 2015
b04d020
minor woops
krakjoe Sep 1, 2015
2f5a5b0
woops
krakjoe Sep 1, 2015
a24e439
tidy configure stuff for json
krakjoe Sep 2, 2015
23db27a
check if session was allocated on PS_OPEN_FUNC
samm-git Nov 12, 2015
ad6a16e
Merge pull request #198 from samm-git/php7
mkoppanen Nov 12, 2015
fb8ce9e
removing unused var, fixing smart_str use w/ igbinary
wcgallego Nov 17, 2015
b5a58cd
remove duplicate class constant registration
krakjoe Dec 16, 2015
e573a6e
Merge pull request #201 from wcgallego/php7
krakjoe Dec 17, 2015
bd32183
Fixed session read return value
Jan 15, 2016
9e11ffa
Revert the user flags and move into Memcached::getLastUserFlags
mkoppanen Jan 16, 2016
0b57cd0
Merge branch 'php7' of github.com:php-memcached-dev/php-memcached int…
mkoppanen Jan 16, 2016
9d5f3b9
Use cache with travis
mkoppanen Jan 16, 2016
852d60c
More travis updates
mkoppanen Jan 16, 2016
f3bfce3
Run our own memcached
mkoppanen Jan 16, 2016
dcdd3b8
Allow specifying memcached version
mkoppanen Jan 16, 2016
5eb3bfd
Fixes to keys and tests
mkoppanen Jan 18, 2016
029784c
Show diff
mkoppanen Jan 18, 2016
00d99de
Should fix sasl
mkoppanen Jan 18, 2016
238a403
Should fix sasl
mkoppanen Jan 18, 2016
5a1d092
Run right memcached
mkoppanen Jan 18, 2016
37f2618
Memcached log
mkoppanen Jan 18, 2016
7e5f092
SASL is tricky
mkoppanen Jan 18, 2016
1aab3f7
Remove debug logging
mkoppanen Jan 18, 2016
e6946ee
Remove debug logging
mkoppanen Jan 18, 2016
fd8fead
Remove really old libmemcached versions. If anyone is using this old …
mkoppanen Jan 18, 2016
4422e83
Merge pull request #209 from mkoppanen/php7
mkoppanen Jan 20, 2016
0dae7f2
Merge pull request #164 from yohgaki/php7
mkoppanen Jan 20, 2016
582f4a0
Fix tests
mkoppanen Jan 21, 2016
7ac4e83
Add to package.xml
mkoppanen Jan 21, 2016
7cb0c48
Fixes to session
mkoppanen Jan 21, 2016
dc5b22a
Cleaning up driver for php7. WIP
mkoppanen Jan 29, 2016
c15d792
Clean up session code, start on the whole i_obj/m_obj confusion
mkoppanen Jan 30, 2016
bdd0911
Update to a simpler object structure, make session config match old s…
mkoppanen Jan 31, 2016
ecc7d81
Add tests, fix compilation error for non-sasl
mkoppanen Jan 31, 2016
9ce59ef
Add to package.xml
mkoppanen Jan 31, 2016
782077c
Fix json serializer
mkoppanen Jan 31, 2016
27ad33b
Fix serializers
mkoppanen Feb 1, 2016
2146630
Merge pull request #211 from mkoppanen/php7
mkoppanen Feb 1, 2016
cf4d0ea
Update package.xml for release along with memcached.ini
mkoppanen Feb 1, 2016
0bce76f
Merge branch 'php7' of github.com:php-memcached-dev/php-memcached int…
mkoppanen Feb 1, 2016
a93ff86
More package.xml / version updates
mkoppanen Feb 1, 2016
938f6bc
Update right place in package.xml
mkoppanen Feb 1, 2016
a930b41
Fixes memory errors, broken code, bugs etc
mkoppanen Feb 6, 2016
27a22f3
fix expiration
crhg Feb 8, 2016
4d44086
Merge pull request #216 from crhg/fix_expiration
mkoppanen Feb 8, 2016
a2305d2
Merge pull request #214 from mkoppanen/php7
mkoppanen Feb 9, 2016
27fa80f
Adds a missed SASL presence constraint
Feb 12, 2016
4ff3859
Update package.xml for release
mkoppanen Feb 17, 2016
d914128
Merge pull request #219 from Werelds/php7
mkoppanen Feb 17, 2016
794dc33
Merge pull request #220 from mkoppanen/php7
mkoppanen Feb 17, 2016
6ace07d
Tests for default behavior
mkoppanen Feb 17, 2016
3537b50
Update for release
mkoppanen Feb 22, 2016
9b8126c
fix arginfo_get*
xjewer Mar 3, 2016
4ee3819
Fixes crash
mkoppanen Mar 5, 2016
52c644b
Merge pull request #226 from mkoppanen/issue-224
mkoppanen Mar 7, 2016
4bb264e
Document ini settings for the default memcached connection configurat…
TysonAndre Mar 20, 2016
e755d9d
Document miscellaneous ini settings and new defaults for PHP7 release
TysonAndre Mar 20, 2016
fec1759
Merge pull request #236 from TysonAndre/update-misc-memcached.ini-docs
mkoppanen Mar 22, 2016
eb54525
Merge pull request #235 from TysonAndre/update-default-memcached.ini-…
mkoppanen Mar 22, 2016
7f4951f
Merge pull request #223 from xjewer/fix_arginfo
mkoppanen Mar 22, 2016
b86282c
add missing releases (and dates for all) to changelog
dzuelke Mar 18, 2016
ffd1c64
remove duplicate 2.2.0b1 from package.xml
dzuelke Mar 18, 2016
4c13c47
fix travis build, msgpack changed structure
krakjoe Apr 2, 2016
b79eebc
fix ci img in readme [ci skip]
krakjoe Apr 2, 2016
6ee96ca
Fix #238 (memory errors in s_stat_execute_cb)
krakjoe Apr 4, 2016
f31ad20
Check the existence of an error, and only then if it is the maximum v…
realmfoo May 10, 2016
d9b2c9f
fix: null-terminated zend_string in s_decompress_value
dictcp Jun 8, 2016
0986493
Merge pull request #252 from dictcp/fix-null-string-decompress
krakjoe Jun 9, 2016
a8ed240
Merge pull request #247 from realmfoo/incrdecr_fix
andreiz Jun 12, 2016
0e51790
Improved the tests
laruence Jul 21, 2016
e82d3d3
Merge pull request #267 from laruence/php7
laruence Jul 23, 2016
ec4f3c6
Added skipif.inc
laruence Jul 23, 2016
8b27e5a
Merge branch 'master' into php7
laruence Jul 23, 2016
399c95c
Cleanup
laruence Jul 23, 2016
09e29e6
Fixed possible crash with opcache (We should never edit a zval in place)
laruence Jul 23, 2016
010d8e4
Fixed possbile memleak
laruence Jul 23, 2016
95f26c4
Fixed warning in run-test.php and also fixed test
laruence Jul 23, 2016
a1aab4e
Avoid str duplication
laruence Jul 23, 2016
6405d96
Msgpack master is php7 branch now
laruence Jul 23, 2016
d67517b
Fixed tests/keys.phpt
laruence Jul 23, 2016
0acaa06
call_function always initialized retval
laruence Jul 23, 2016
a0ed436
According to memcached wiki, touch is added since 1.4.8
laruence Jul 23, 2016
5949598
Remove unused arg
laruence Jul 23, 2016
09e1304
cleanup
laruence Jul 23, 2016
513c091
Fixed locale_float.phpt test
laruence Jul 23, 2016
de9494f
Fixed OOM (tests/experimental/locale_float.phpt)
laruence Jul 23, 2016
6837d89
Fixed test (tests/experimental/setmulti_badserialize.phpt)
laruence Jul 23, 2016
f73befd
Use zend_string_equals_literal
laruence Jul 23, 2016
441168b
avoided memory duplication
laruence Jul 24, 2016
5e42fa9
Remove old version staff
laruence Jul 24, 2016
bb4556a
Partial fix build for memcached-protocl
laruence Jul 25, 2016
4d9fda9
use zval_copy
laruence Jul 26, 2016
56171da
Fixed bug fetch only fetched one result
laruence Jul 26, 2016
41b005f
Fixed test
laruence Jul 26, 2016
155a864
Merge branch 'php7' of github.com:php-memcached-dev/php-memcached int…
laruence Jul 26, 2016
4fa2111
Value pass to callback behavior consistently with get
laruence Jul 26, 2016
35ef911
Igbinary php7 development is in igbinary/igbinary master branch now
TysonAndre Aug 8, 2016
cc06f85
Merge pull request #270 from TysonAndre/patch-1
sodabrew Aug 8, 2016
a9eb874
Adjust the Travis CI matrix: PHP 5.5, 5.6, 7.0, fewer revisions of li…
sodabrew Aug 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed possible crash with opcache (We should never edit a zval in place)
  • Loading branch information
laruence committed Jul 23, 2016
commit 09e29e65deabae5b23fdf5db1928992d6107d9c9
94 changes: 44 additions & 50 deletions php_memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,8 +1819,7 @@ static void php_memc_setMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_ke
s_memc_set_status(intern, MEMCACHED_SUCCESS, 0);

ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P(entries), num_key, skey, value) {

zend_string *str_key;
zend_string *str_key = NULL;

if (skey) {
str_key = skey;
Expand Down Expand Up @@ -2337,7 +2336,6 @@ PHP_METHOD(Memcached, addServers)
zval *servers;
zval *entry;
zval *z_host, *z_port, *z_weight = NULL;
uint32_t weight = 0;
HashPosition pos;
int entry_size, i = 0;
memcached_server_st *list = NULL;
Expand All @@ -2361,6 +2359,10 @@ PHP_METHOD(Memcached, addServers)
entry_size = zend_hash_num_elements(Z_ARRVAL_P(entry));

if (entry_size > 1) {
zend_string *host;
zend_long port;
uint32_t weight;

zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(entry), &pos);

/* Check that we have a host */
Expand All @@ -2378,8 +2380,8 @@ PHP_METHOD(Memcached, addServers)
continue;
}

convert_to_string_ex(z_host);
convert_to_long_ex(z_port);
host = zval_get_string(z_host);
port = zval_get_long(z_port);

weight = 0;
if (entry_size > 2) {
Expand All @@ -2389,12 +2391,12 @@ PHP_METHOD(Memcached, addServers)
php_error_docref(NULL, E_WARNING, "could not get server weight for entry #%d", i+1);
}

convert_to_long_ex(z_weight);
weight = Z_LVAL_P(z_weight);
weight = zval_get_long(z_weight);
}

list = memcached_server_list_append_with_weight(list, Z_STRVAL_P(z_host),
Z_LVAL_P(z_port), weight, &status);
list = memcached_server_list_append_with_weight(list, ZSTR_VAL(host), port, weight, &status);

zend_string_release(host);

if (s_memc_status_handle_result_code(intern, status) == SUCCESS) {
i++;
Expand Down Expand Up @@ -2839,21 +2841,21 @@ static PHP_METHOD(Memcached, getOption)
static
int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)
{
zend_long lval;
memcached_return rc = MEMCACHED_FAILURE;
memcached_behavior flag;
php_memc_user_data_t *memc_user_data = memcached_get_user_data(intern->memc);

switch (option) {
case MEMC_OPT_COMPRESSION:
convert_to_long(value);
memc_user_data->compression_enabled = Z_LVAL_P(value) ? 1 : 0;
memc_user_data->compression_enabled = zval_get_long(value) ? 1 : 0;
break;

case MEMC_OPT_COMPRESSION_TYPE:
convert_to_long(value);
if (Z_LVAL_P(value) == COMPRESSION_TYPE_FASTLZ ||
Z_LVAL_P(value) == COMPRESSION_TYPE_ZLIB) {
memc_user_data->compression_type = Z_LVAL_P(value);
lval = zval_get_long(value);
if (lval == COMPRESSION_TYPE_FASTLZ ||
lval == COMPRESSION_TYPE_ZLIB) {
memc_user_data->compression_type = lval;
} else {
/* invalid compression type */
intern->rescode = MEMCACHED_INVALID_ARGUMENTS;
Expand All @@ -2863,38 +2865,41 @@ int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)

case MEMC_OPT_PREFIX_KEY:
{
zend_string *str;
char *key;
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX == 0x00049000
char tmp[MEMCACHED_PREFIX_KEY_MAX_SIZE - 1];
#endif
convert_to_string(value);
if (Z_STRLEN_P(value) == 0) {
str = zval_get_string(value);
if (ZSTR_VAL(str) == 0) {
key = NULL;
} else {
/*
work-around a bug in libmemcached in version 0.49 that truncates the trailing
character of the key prefix, to avoid the issue we pad it with a '0'
*/
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX == 0x00049000
snprintf(tmp, sizeof(tmp), "%s0", Z_STRVAL_P(value));
snprintf(tmp, sizeof(tmp), "%s0", ZSTR_VAL(str));
key = tmp;
#else
key = Z_STRVAL_P(value);
key = ZSTR_VAL(str);
#endif
}
if (memcached_callback_set(intern->memc, MEMCACHED_CALLBACK_PREFIX_KEY, key) == MEMCACHED_BAD_KEY_PROVIDED) {
zend_string_release(str);
intern->rescode = MEMCACHED_INVALID_ARGUMENTS;
php_error_docref(NULL, E_WARNING, "bad key provided");
return 0;
}
zend_string_release(str);
}
break;

case MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED:
flag = (memcached_behavior) option;

convert_to_long(value);
rc = memcached_behavior_set(intern->memc, flag, (uint64_t) Z_LVAL_P(value));
lval = zval_get_long(value);
rc = memcached_behavior_set(intern->memc, flag, (uint64_t)lval);

if (s_memc_status_handle_result_code(intern, rc) == FAILURE) {
php_error_docref(NULL, E_WARNING, "error setting memcached option: %s", memcached_strerror (intern->memc, rc));
Expand All @@ -2906,7 +2911,7 @@ int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)
* options on false case, like it does for MEMCACHED_BEHAVIOR_KETAMA
* (non-weighted) case. We have to clean up ourselves.
*/
if (!Z_LVAL_P(value)) {
if (!lval) {
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX > 0x00037000
(void)memcached_behavior_set_key_hash(intern->memc, MEMCACHED_HASH_DEFAULT);
(void)memcached_behavior_set_distribution_hash(intern->memc, MEMCACHED_HASH_DEFAULT);
Expand All @@ -2920,28 +2925,28 @@ int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)

case MEMC_OPT_SERIALIZER:
{
convert_to_long(value);
lval = zval_get_long(value);
/* igbinary serializer */
#ifdef HAVE_MEMCACHED_IGBINARY
if (Z_LVAL_P(value) == SERIALIZER_IGBINARY) {
if (lval == SERIALIZER_IGBINARY) {
memc_user_data->serializer = SERIALIZER_IGBINARY;
} else
#endif
#ifdef HAVE_JSON_API
if (Z_LVAL_P(value) == SERIALIZER_JSON) {
if (lval == SERIALIZER_JSON) {
memc_user_data->serializer = SERIALIZER_JSON;
} else if (Z_LVAL_P(value) == SERIALIZER_JSON_ARRAY) {
} else if (lval == SERIALIZER_JSON_ARRAY) {
memc_user_data->serializer = SERIALIZER_JSON_ARRAY;
} else
#endif
/* msgpack serializer */
#ifdef HAVE_MEMCACHED_MSGPACK
if (Z_LVAL_P(value) == SERIALIZER_MSGPACK) {
if (lval == SERIALIZER_MSGPACK) {
memc_user_data->serializer = SERIALIZER_MSGPACK;
} else
#endif
/* php serializer */
if (Z_LVAL_P(value) == SERIALIZER_PHP) {
if (lval == SERIALIZER_PHP) {
memc_user_data->serializer = SERIALIZER_PHP;
} else {
memc_user_data->serializer = SERIALIZER_PHP;
Expand All @@ -2953,23 +2958,23 @@ int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)
}

case MEMC_OPT_USER_FLAGS:
convert_to_long(value);
lval = zval_get_long(value);

if (Z_LVAL_P(value) < 0) {
if (lval < 0) {
memc_user_data->set_udf_flags = -1;
return 1;
}

if (Z_LVAL_P(value) > MEMC_VAL_USER_FLAGS_MAX) {
if (lval > MEMC_VAL_USER_FLAGS_MAX) {
php_error_docref(NULL, E_WARNING, "MEMC_OPT_USER_FLAGS must be < %u", MEMC_VAL_USER_FLAGS_MAX);
return 0;
}
memc_user_data->set_udf_flags = Z_LVAL_P(value);
memc_user_data->set_udf_flags = lval;
break;

case MEMC_OPT_STORE_RETRY_COUNT:
convert_to_long(value);
memc_user_data->store_retry_count = Z_LVAL_P(value);
lval = zval_get_long(value);
memc_user_data->store_retry_count = lval;
break;

default:
Expand All @@ -2981,10 +2986,10 @@ int php_memc_set_option(php_memc_object_t *intern, long option, zval *value)
}
else {
flag = (memcached_behavior) option;
convert_to_long(value);
lval = zval_get_long(value);

if (flag < MEMCACHED_BEHAVIOR_MAX) {
rc = memcached_behavior_set(intern->memc, flag, (uint64_t) Z_LVAL_P(value));
rc = memcached_behavior_set(intern->memc, flag, (uint64_t)lval);
}
else {
rc = MEMCACHED_INVALID_ARGUMENTS;
Expand Down Expand Up @@ -3016,15 +3021,9 @@ uint32_t *s_zval_to_uint32_array (zval *input, size_t *num_elements)
retval = ecalloc(*num_elements, sizeof(uint32_t));

ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(input), pzval) {
long value = 0;

if (Z_TYPE_P(pzval) == IS_LONG) {
value = Z_LVAL_P(pzval);
} else {
value = zval_get_long(pzval);
value = value > 0? value : 0;
}
zend_long value = 0;

value = zval_get_long(pzval);
if (value < 0) {
php_error_docref(NULL, E_WARNING, "the map must contain positive integers");
efree (retval);
Expand Down Expand Up @@ -3126,14 +3125,9 @@ static PHP_METHOD(Memcached, setOptions)
php_error_docref(NULL, E_WARNING, "invalid configuration option");
ok = 0;
} else {
zval copy;
ZVAL_DUP(&copy, value);

if (!php_memc_set_option(intern, (long) key_index, &copy)) {
if (!php_memc_set_option(intern, (long) key_index, value)) {
ok = 0;
}

zval_dtor(&copy);
}
} ZEND_HASH_FOREACH_END();

Expand Down