Note that this script takes care of customizing `phpunit.xml.dist` so
that tests can be run as soon as the PEAR package has been installed
as requested in #126.
This method is mostly an utility method which is the main reason for
it bein static, but can be useful to have it available when extending
this class.
This change was inspired by b9b899e (master) even though the original
commit is meant to fix an issue not affecting v0.8.
This oversight didn't end up in a blatant bug only because the correct
handler definition for INFO replaced the old class in the profile.
Backported from 5065541 (master).
This condition can occur when merging multiple class files (with their
own independent "use" directives) in one big file: when imported class
names or aliases clashes, the script now tries to automatically rename
them by defining a new alias in the "use" directive and renaming the
occurences in the buffer containing the class code.
This fix is naive at best, but seems to work fine so we will just live
with it for now.
Using PHP's "parse_str()" to parse the query string is slightly more
efficient then our own code especially when the number of fields in
the query string grows, with the additional benefit of supporting
arrays for values when brackets are present in fieldnames.
So after this commit, providing this URI string:
$string = 'tcp://127.0.0.1?metavars[]=foo&metavars[]=hoge';
Is equivalent to providing the following named array:
$array = [
'scheme' => 'tcp',
'host' => '127.0.0.1',
'metavars' => ['foo', 'hoge'],
];
Other improvements are that parsing does not break when the value of a
field contains one or more "=" and empty or incomplete "key=value"
pairs result in an empty string for "key".
List of changes:
- The cluster connection sends an ASKING command before retrying
a command on a different node when Redis returns a -ASK response.
- The cluster connection can be initialized with a partial list of
nodes, the full slots map will be fetched from Redis itself using
the CLUSTER NODES command.
- The slots map can be optionally retrieved from Redis if the server
returns a -MOVE response, otherwise only the interested slot will
be permanently reassigned to the new target node.
- It is possible to specify a set of common parameters applied to
connections created on the fly when not part of the current pool
upon -MOVE and -ASK responses returned by Redis for redirections.
- $cluster->connect() connects to a random connection in the pool
instead of forcing the connect operation on all the connections.
We now have a base test case class for Predis (namely PredisTestCase)
grouping various commonly used utility methods shared by all of the
tests in the suite, greatly improving reusability.
NOTE: Backported from v0.9-dev.