Commit Graph

1072 Commits

Author SHA1 Message Date
Remi Collet
d226ee7d45 Fix incompatible pointer types 2024-01-30 09:44:48 +01:00
Robert
dfd038f13c Correct whitespace formatting (#553) 2023-12-27 16:55:59 -08:00
dependabot[bot]
eb39e469d0 Bump actions/checkout from 3 to 4 (#548)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-24 10:33:10 -07:00
dependabot[bot]
d2b1172dff Bump actions/checkout from 2 to 3 (#534)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-24 07:57:32 -07:00
Rasmus Lerdorf
7fefcb7924 Make the compression_level at settable option and expand it to zlib (#540)
Make it possible to use setOption to set Memcached::OPT_COMPRESSION_LEVEL which
was missed in the original zstd PR #539

zlib compression was using the default zlib compression level of 6. With this PR
it is now possible to choose other levels for zlib as well. The default remains
at 6 so nothing will change for people upgrading unless they explicitly set a
different level.

Here is some more benchmarking data using php serialized data
https://gist.github.com/rlerdorf/b9bae385446d5a30b65e6e241e34d0a8

fastlz is not really useful at any value size anymore. Anybody looking for
lightning quick compression and decompression should use zstd at level 1.

compression_level is not applied to fastlz because it only has 2 levels and
php-memcached already switches from level 1 to 2 automatically for values larger
than 65535 bytes. Forcing it to one or the other doesn't seem useful.
2023-05-03 16:10:38 -07:00
Robert
e39a2e62f4 Add option to locally enforce payload size limit (#515)
Add a configuration option to enforce an item size limit on the client side. This avoids sending large items
over the wire and getting rejected by the server which can cause delays. The default is 0 for no limit.
The same error code RES_E2BIG is used for the client side limit as for the server side limit.
2023-04-27 08:48:49 -07:00
Pavel Djundik
7348cc11f7 Move working tests up a folder (#503)
Tests in the experimental/ folder were not executed on CI. The ones that work move up, the few
that remain in experimental/ need further investigation to get working or remove.
2023-04-27 08:35:07 -07:00
Rasmus Lerdorf
5833590296 zstd support (#539)
This adds zstd compression support.

The current two options, zlib and fastlz is basically a choice between performance and compression ratio.
You would choose zlib if you are memory-bound and fastlz if you are cpu-bound. With zstd, you get the
performance of fastlz with the compression of zlib. And often it wins on both. See this benchmark I ran
on json files of varying sizes: https://gist.github.com/rlerdorf/788f3d0144f9c5514d8fee9477cbe787

Taking just a 40k json blob, we see that zstd at compression level 3 reduces it to 8862 bytes. Our current
zlib 1 gets worse compression at 10091 bytes and takes longer both to compress and decompress.

      C Size  ratio%     C MB/s     D MB/s   SCORE      Name            File
        8037    19.9       0.58    2130.89       0.08   zstd 22         file-39.54k-json
        8204    20.3      31.85    2381.59       0.01   zstd 10         file-39.54k-json
        8371    20.7      47.52     547.12       0.01   zlib 9          file-39.54k-json
        8477    20.9      74.84     539.83       0.01   zlib 6          file-39.54k-json
        8862    21.9     449.86    2130.89       0.01   zstd 3          file-39.54k-json
        9171    22.7     554.62    2381.59       0.01   zstd 1          file-39.54k-json
       10091    24.9     153.94     481.99       0.01   zlib 1          file-39.54k-json
       10646    26.3      43.39    8097.40       0.01   lz4 16          file-39.54k-json
       10658    26.3      72.30    8097.40       0.01   lz4 10          file-39.54k-json
       13004    32.1    1396.10    6747.83       0.01   lz4 1           file-39.54k-json
       13321    32.9     440.08    1306.03       0.01   fastlz 2        file-39.54k-json
       14807    36.6     444.91    1156.77       0.01   fastlz 1        file-39.54k-json
       15517    38.3    1190.79    4048.70       0.02   zstd -10        file-39.54k-json

The fact that decompression a dramatically faster with zstd is a win for most common memcache uses
since they tend to be read-heavy. The PR also adds a `memcache.compression_level` INI switch which
currently only applies to zstd compression. It could probably be made to also apply to zlib and fastlz.
2023-04-27 08:32:10 -07:00
Aaron Stone
6926c53ac3 README.markdown: PHP 8.2 is supported 2023-04-11 11:15:46 -07:00
Remi Collet
811c8a1422 Fix #522 Signed integer overflow (#526) 2023-02-02 11:42:07 -08:00
LeoLee
1eac9f8b8e PHP 8 compatibility Windows (#528)
Use PHP_VERSION_ID instead of _MSC_VER to select the right headers. win32/php_stdint.h
was removed in PHP 8.0.0 and php_stdint.h file was removed in PHP 8.2.0 entirely:
https://github.com/php/php-src/blob/PHP-8.2/UPGRADING.INTERNALS#L26
2023-01-31 14:45:26 -08:00
Christoph M. Becker
6a58af6abc Add minimal Windows CI (#532)
For now, only building the extension is supported.
2023-01-18 09:50:05 -08:00
Aaron Stone
04a0f72eaa CI: Add libmemcached-awesome to matrix (#530) 2023-01-09 11:07:54 -08:00
Aaron Stone
3b0070aab2 CI: Add PHP 8.2 to the required matrix, add PHP 8.3 to experimental (#529) 2023-01-06 14:32:41 -08:00
Remi Collet
38c38d7b47 changelog 2022-11-16 07:56:04 +01:00
Remi Collet
121473118a Fix #523 Incorrect PHP reflection type for Memcached::cas $cas_token 2022-11-16 07:54:10 +01:00
George Peter Banyard
aa4868d0f1 Put false in union types at the end 2022-10-06 10:46:01 +02:00
LeoLee
3ff7436dd9 Windows msgpack support (#518)
Co-authored-by: lfeng <lfeng@ulucu.com>
2022-08-30 12:41:08 -07:00
Remi Collet
ce2dfa5e64 mark password as a sensitive param for 8.2 (#516)
* mark password as a sensitive param for 8.2
2022-07-28 09:28:33 +02:00
Remi Collet
fc388e65e7 fix ${var} deprecation 2022-06-03 16:56:00 +02:00
Remi Collet
1f22de7437 fix #513 skip test with old and dead libmemcached 2022-03-28 08:09:29 +02:00
Remi Collet
09e094d390 back to dev 2022-03-24 14:02:06 +01:00
Remi Collet
d1cb3ae87b Prepare 3.2.0 v3.2.0 2022-03-24 13:57:18 +01:00
Remi Collet
8f106564e6 Merge pull request #507 from cmb69/cmb/libname
Adhere to standard naming convention of Windows libs for PHP
v3.2.0RC2
2022-03-09 14:54:56 +01:00
Christoph M. Becker
4694a665d2 Adhere to standard naming convention of Windows libs for PHP
The memcached library is usually named libmemcached.lib, so we should
check for this name, too.
2022-03-09 14:49:44 +01:00
Remi Collet
ca0d9392cb Prepare 3.2.0RC2 2022-03-09 14:34:33 +01:00
Remi Collet
1f4b029003 [ci skip] fix windows build in changelog 2022-03-09 14:30:51 +01:00
Remi Collet
7965b8ec40 Merge pull request #497 from lifenglsf/fix_windows_php8
fix windows php8 php_stdint.h path
2022-03-09 14:29:08 +01:00
Remi Collet
de1a9e2da1 Merge pull request #506 from cmb69/cmb/ssize_t
Fix MSVC builds wrt. ssize_t
2022-03-09 14:27:25 +01:00
Christoph M. Becker
c7433c9a53 Fix MSVC builds wrt. ssize_t
The Windows SDK does not define `ssize_t`, so libmemcached does not
define `HAVE_SSIZE_T`.  However, PHP's config.w32.h has
`#define ssize_t SSIZE_T`, so building memcached fails.  We fix this by
defining `HAVE_SSIZE_T` via the extension's `CFLAGS`.
2022-03-09 14:22:40 +01:00
Remi Collet
857b8afab8 8.x is supported + libmemcached-awesome 2022-03-09 11:17:17 +01:00
Pavel Djundik
e45fef8634 Create gh_500.phpt 2022-03-07 15:37:52 +01:00
Remi Collet
5bb007e625 Prepare 3.2.0RC1 v3.2.0RC1 2022-03-07 14:51:48 +01:00
Remi Collet
d8f6f1c899 Merge pull request #488 from remicollet/issue-awesome
Improve phpinfo information
2022-03-07 14:33:04 +01:00
dependabot[bot]
8a5ef9ef34 Bump actions/checkout from 2 to 3 (#505)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 13:57:02 -08:00
lfeng
082615656f format code 2021-12-30 14:04:09 +08:00
lfeng
5a8db865c1 format code 2021-12-30 10:08:48 +08:00
lfeng
7a06230982 fix windows php8 php_stdint.h path 2021-12-29 16:24:57 +08:00
Ruud Kamphuis
d3b8ce13f1 Remove experimental for PHP 8.1 and add PHP 8.2 experimental (#494) 2021-11-29 10:58:58 -08:00
mszabo-wikia
60a8f9f881 Add GitHub Actions build (#492)
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] https://github.com/php-memcached-dev/php-memcached/issues/418#issuecomment-449587972
2021-11-08 09:18:14 -08:00
Aaron Stone
9cd4a01d99 Merge pull request #474 from m6w6/fix-memcachedserver
fix MemcachedServer
2021-08-22 22:05:26 -07:00
hulk
e6df8ab3f6 FIX: store_retry_count shouldn't be set implicitly (#452)
It's wired that store commands would be auto-retry implicitly while the default value of store_retry_count was 2, as well as the timeout, would be 3 times in those store commands which may confuse users. IMHO, the retry should be set explicitly instead of implicitly.
2021-08-22 21:57:11 -07:00
Timo Tijhof
6d457155fb Remove "failed to set key" warning from setMulti (#490)
This was introduced in https://github.com/php-memcached-dev/php-memcached/commit/6837d89494,
pull https://github.com/php-memcached-dev/php-memcached/pull/214. I suspect it
may have been a left-over from debugging something. The test was later
changed in 6837d89494 to expect the warning in question, although other
similar tests don't encounter such warning currently.

It appears no other Memcached methods emit a PHP Warning when they encounter
a write read or failure. Instead, they typically turn their return value
into boolean false, and provide details via getResultMessage().

The introduction of this warning since php-memcached 3.0 has led to a number
of confused consumers (locally #260, #409, #450, and more reports
within downstream issue trackers).

Closes https://github.com/php-memcached-dev/php-memcached/issues/409.
2021-08-22 21:56:19 -07:00
Remi Collet
605a8a63a7 fix zend_dtoa API change in 8.1.0beta1 (#487) 2021-07-28 19:55:08 -07:00
Remi Collet
13ba74317d Improve phpinfo information
- display libmemcached-awesome when used (since 1.1.1)
- display both builtime and runtime versions when different
2021-07-27 08:35:08 +02:00
Remi Collet
10f449752b small sleep to avoid loosing message from subprocess 2021-07-23 14:55:28 +02:00
Remi Collet
2d5d4bf02f add IPv6 test 2021-07-23 14:55:28 +02:00
Michael Wallner
4e7f20cdb0 skip test with libmemcached < 1.1.0 2021-07-23 14:55:28 +02:00
Michael Wallner
4b6c45dd23 implement stats callback suggestions by Remi 2021-07-23 14:55:28 +02:00
Michael Wallner
6dc086e721 add test files to package.xml 2021-07-23 14:55:28 +02:00