Commit Graph

3135 Commits

Author SHA1 Message Date
Pavlo Yatsukhnenko
e403d25a99 pool entry wrapper 2024-10-13 17:53:07 +03:00
Pavlo Yatsukhnenko
a53bf38b83 Merge pull request #2557 from cmb69/cmb/win-ci
Windows CI: update setup-php-sdk to v0.10 and enable caching
2024-10-08 12:57:37 +03:00
michael-grunder
5419cc9c60 Prepare for 6.1.0 GA 6.1.0 2024-10-04 11:28:33 -07:00
Remi Collet
52e69edefd improve package summary and description (#2558)
* improve package summary and description

* improve package summary and description
2024-10-03 11:06:56 -07:00
Christoph M. Becker
f89d4d8f6e Windows CI: update setup-php-sdk to v0.10 and enable caching 2024-09-30 15:39:25 +02:00
Remi Collet
5f241d8913 Merge pull request #2555 from phpredis/issue-redis62
fix 2 tests with redis 6.2
2024-09-24 16:15:31 +02:00
Remi Collet
cc1be32294 fix 2 tests with redis 6.2 2024-09-24 14:47:04 +02:00
Vincent Langlet
0bae4bb044 Fix urls 2024-09-23 15:58:45 -07:00
Michael Grunder
909c5cc13c Finalize 6.1.0RC2 changelog for completeness. (#2554)
* Finalize 6.1.0RC2 changelog for completeness.

* Fix CHANGELOG.md formatting + link to contributor users
6.1.0RC2
2024-09-23 13:56:48 -07:00
Remi Collet
bff3a22e9d fix implicit nullable (8.4) 2024-09-23 11:08:56 -07:00
Remi Collet
30c8f90cd9 bump version 2024-09-23 11:08:56 -07:00
michael-grunder
9bd2aaace4 Prepare for 6.1.0RC2 2024-09-23 11:08:56 -07:00
James Titcumb
b59e35a64f Added a composer.json to enable support for PIE 2024-09-20 09:03:11 -07:00
michael-grunder
a75a7e5a36 Fix SIGABRT in PHP 8.4
PHP switched from `ZEND_ASSUME` to `ZEND_ASSERT` when making sure
`Z_PTR_P(zv)` was nonnull in `zend_hash_str_update_ptr`.

This commit just switches to `zend_hash_str_add_empty_element` which
is semantically more correct anyway.

Fixes #2539
2024-09-19 22:41:28 -07:00
michael-grunder
9d38050093 Upload artifact v2 is deprecated 2024-09-19 14:51:09 -07:00
michael-grunder
40c897364f Remove erroneously duplicated changelog entries.
When constructing the 6.1.0RC1 CHANGELOG.md and package.xml a few
commits from older releases were accidentally included.

See #2474
2024-08-06 17:57:10 -07:00
Remi Collet
37cebdd70b cleanup code for unsupported versions 2024-08-05 08:58:58 -07:00
michael-grunder
8b51942357 Raise minimum supported PHP version to 7.4
See #2531
2024-08-05 01:08:51 -07:00
Remi Collet
e9474b80cb add missing SessionHelpers.php in pecl package 2024-08-05 00:30:28 -07:00
michael-grunder
ff3d5e3e06 Prepare to tag 6.1.0RC1 2024-08-04 13:56:47 -07:00
Viktor Djupsjöbacka
6ea5b3e08b Fix argument count issue in HSET with associative array, update method signature for HSET and add documentation 2024-07-17 12:47:49 -07:00
michael-grunder
6673b5b2be SRANDMEMBER can return any type because of serialization. 2024-07-13 23:12:25 -07:00
Michael Grunder
99f9fd8353 Fix HRANDFIELD command when WITHVALUES is used. (#2524)
Redis requires the user to send a count if `WITHVALUES` is specified,
otherwise it sees the `WITHVALUES` argument as the count and will error
out that it's not a number.

We can also return false if the key doesn't exist.
2024-07-13 22:42:25 -07:00
Michael Dwyer
eeb5109967 Update documentation (#2523)
* Remove/update mentions of removed methods

These methods were deprecated in a previous release

* Correct documentation for zInter/zinterstore

* Correct documentation for zUnion/zunionstore

* Add documentation for zDiff/zdiffstore

* Add documentation for zMscore
2024-07-11 21:49:29 -07:00
michael-grunder
50529f56e4 Context array should be nullable
Fixes #2521
2024-07-10 12:33:37 -07:00
michael-grunder
7de29d57d9 Fix a macOS (M1) compiler warning. 2024-07-08 20:50:06 -07:00
michael-grunder
981c69314d Add GETEX to README docs + minor change to command.
* Adds `GETEX` to the README.md documentation.
* Allow the user to send `PERSIST` either as an array key or just in the
  array, to conform with similar methods.
* Implement getEx for `RedisCluster`

Fixes #2512
2024-06-20 13:56:17 -07:00
Pavlo Yatsukhnenko
74f9e80516 Merge pull request #2513 from phpredis/script-command
Refactor redis_script_cmd
2024-06-20 21:45:17 +03:00
Pavlo Yatsukhnenko
7c551424b6 Refactor redis_script_cmd
- Update redis_script_cmd to use redis_build_script_cmd.
- Fix condition for parsing sync/async arguments of flush sub-command.
2024-06-20 21:05:20 +03:00
Michael Grunder
57304970cd PHP might throw a fatal error if we send no args to exists (#2510) 2024-06-18 16:05:21 -07:00
Michael Grunder
b1771defdc More unit test utility functions/usage. (#2509)
* More unit  test utility functions/usage.

* Add `assertKeyEquals` and `assertKeyEqualsWeak` as we test key values
  hundreds of places in `RedisTest.php`

* We are almost always using `$this->redis` when we want to run an
  assertion that needs access to the client, so make this argument
  optional and default to `$this->redis`.

* Update a few more assertions to use our new methods.

* Various minor fixes/tweaks.

* Update RedisTest.php

typo
2024-06-18 14:53:22 -07:00
michael-grunder
b808cc60ed Update tests so they can run in php-cgi.
This probably isn't a very common scenerio since we've never had someone
ask it in a decade, but it was very simple to get them working.

Primarily we just needed to test for `STDTOUT`/`STDERR` and use
`__DIR__` instead of `$_SERVER['PHP_SELF']`.

Fixes #2507
2024-06-17 11:46:44 -07:00
Michael Grunder
7050c98909 Play around with more ZEND_STRL usage (#2505)
* Play around with more ZEND_STRL usage

* strncasecmp is a macro on Windows
2024-06-15 14:48:30 -07:00
michael-grunder
d3b2d87b10 Don't use $k1 as a variable name.
There is a very strange edge case whn you try to run PHP under valgrind
and use certain specific strings like "$k1".

PHP interns these values in such a way that valgrind can't handle it and
hard aborts on sigsegv.  I don't know what the actual cause is but
simply renaming the variables is a workaround.
2024-06-01 17:35:58 -07:00
michael-grunder
f8c762e70b Use ZEND_STRL where appropriate.
Use the `ZEND_STRL` macro in several places rather than manually sending
a static string and its length as a constant.
2024-06-01 13:41:26 -07:00
michael-grunder
c139de3aba We don't need to use a ranom value for our ECHO liveness challenge.
A microsecond resolution timestamp combined with a monotonically
incremented counter should be sufficient.

This also fixes PHP 8.4 compilation as PHP 8.4 doesn't seem to have
`php_rand()`.
2024-06-01 13:41:26 -07:00
michael-grunder
dab6a62d34 Code formatting 2024-05-31 12:15:54 -07:00
michael-grunder
c6cd665bde Code formatting 2024-05-30 12:10:46 -07:00
michael-grunder
78b70ca8f4 More test refactoring.
* Switch remaining old-style PHP 5.4 `Array(...)` declarations to `[...]`
* Update variable names getting rid hungarian notation prefixes (e.g.
  `str_`, `i_`, etc).
* Allow cluster seeds to be passed on the command-line instead of soley
  relying on either a node environment variable or our
  tests/nodes/nodemap file.  This should make it easier to run ad-hoc
  cluster tests by specifying just a single seed.
* Add some diagnostics for when we can't find a suitable cluster to run
  our tests against indicating exactly where we looked for the env var
  and node file.
* Refactor RedisArray tests to use our newer TestSuite assertions.
* Allow `RedisArray` ports to be specified on the command-line as well.
* Various formatting fixes.
* More robust KeyDB detection.
2024-05-29 23:02:29 -07:00
michael-grunder
0d89e92889 Spelling fixes 2024-05-28 21:05:08 -07:00
michael-grunder
e18f6c6d9e Minor refactor 2024-05-28 20:32:50 -07:00
michael-grunder
3c125b09f4 More unit test cleanup.
* Tighten up `assertTrue` and `assertFalse` such that they test that
  passed arguments `===` `true` and `===` `false` respectively, instead
  of testing for truth-like or false-like.

* Start modernizing our unit tests to use explicit types for arguments,
  return types, member variables, etc.

* Multiple assertion fixes that were exposed when making `assertTrue`
  and `assertFalse` more explicit.

* Some formatting cleanup to style for incorrect indentation, etc, that
  had crept in over many years.

* Add some more assertion helpers like `assertNull`, `assertGT`,
  `assertGTE`, `assertLT`, and `assertLTE`.
2024-05-28 20:13:12 -07:00
michael-grunder
18b0da727b Update unit test assertions.
Our tests have a ton of instances where we do something like:

```php
$this->assert(TRUE === $this->redis->command1());
$this->assert($this->redis->command2() === 42);
```

Which should be written like this:

```php
$this->assertTrue($this->command1());
$this->assertEquals(42, $this->command2());
```

Additionally it changes some assertions to use more relevant assertions
like `assertInArray` rather than `assertTrue(in_array())`.

* Add `assertEqualsCanonicalizing` assertion similar to what PHPUnit
  has.

* Add `assertStringContains` helper assertion.
2024-05-27 20:49:46 -07:00
Michael Grunder
b88e72b1e6 Refactor session tests (#2492)
* Refactor session tests

* Update these external scripts to take formal arguments with `getopt` to
  make it more straightforward what each of the currently positional
  arguments are actually for.

* Create small helper classes for invoking these external scripts.
  Instead of `startSessionProcess` that takes a dozen argument all but
  three of which have defaults, we can use a construct like this:

  ```php
  $runner = $this->sessionRunner()
      ->maxExecutionTime(300)
      ->lockingEnabled(true)
      ->lockWaitTime(-1)
      ->lockExpires(0)
      ->data($data)
      ->compression($name);

  // Invokes startSession.php with above args.
  $result = $runner->execFg();

  // Invokes regenerateSessionId.php with above args
  $new_id = $runner->regenerateId();

  // Invokes getSessionData.php for this session ID.
  $data = $runner->getData();
  ```

* Add a bit of logic to TestSuite to dump more information about the
  source of an assertion to make it easier to track down problems when
  we assert outside of a top level public `test_*` method.

* Create a few new assertions like `assertKeyExists` and
  `assertKeyMissing` which will generate much nicer assertions as
  opposed to

```php
$this->assertTrue($this->redis->exists($some_key));
```

* If our externally spawned session scripts fail output the exact call
  that was made along with all arguments as well as the output that we
  received to make it easier to narrow down.

* snake_case -> camelCase
2024-05-23 09:43:36 -07:00
michael-grunder
d68c30f87d Remove Windows PHP 7.x jobs 2024-05-16 11:44:52 -07:00
michael-grunder
34b5bd81ef Rework how we declare ZSTD min/max constants.
Fixes #2487
2024-05-16 11:44:52 -07:00
divinity76
f865d5b95d fix missing <code> tags 2024-05-13 09:20:10 -07:00
michael-grunder
0f94d9c1c6 Relax timing test slightly 2024-05-09 21:30:17 -07:00
michael-grunder
c0d6f04298 Minor improvements to some session tests. 2024-05-09 20:45:07 -07:00
michael-grunder
f350dc342c Test aginst the first stable version of valkey.
Now that valkey has an official release we can test against that and
remove the "continue-on-error" flag in CI.
2024-04-16 11:50:07 -07:00