Skip to content

Commit

Permalink
Replace $redis->eval() with $redis->evaluate(), see phpredis/phpredis…
Browse files Browse the repository at this point in the history
  • Loading branch information
rybakit committed Mar 22, 2013
1 parent cd379f4 commit c354e47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/Phive/Queue/Redis/RedisQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
use Phive\Queue\QueueUtils;

/**
* RedisQueue requires Redis >= 2.6 (for a Lua scripting feature) and
* phpredis >= 2.2.2 which has a fix @link https://github.com/nicolasff/phpredis/pull/189
* for a PHP 5.4 bug @link https://bugs.php.net/bug.php?id=62112.
* RedisQueue requires Redis >= 2.6 and phpredis >= d287163de2
*/
class RedisQueue implements QueueInterface
{
Expand Down Expand Up @@ -55,7 +53,7 @@ public function push($item, $eta = null)
$self = $this;
$this->exceptional(function(\Redis $redis) use ($self, $item, $eta) {
$prefix = $redis->getOption(\Redis::OPT_PREFIX);
$redis->eval($self::SCRIPT_PUSH, array($prefix.'items', $eta, $item, 'sequence'));
$redis->evaluate($self::SCRIPT_PUSH, array($prefix.'items', $eta, $item, 'sequence'));
});
}

Expand All @@ -68,7 +66,7 @@ public function pop()
$item = $this->exceptional(function(\Redis $redis) use ($self) {
$prefix = $redis->getOption(\Redis::OPT_PREFIX);

return $redis->eval($self::SCRIPT_POP, array($prefix.'items', time()));
return $redis->evaluate($self::SCRIPT_POP, array($prefix.'items', time()));
});

if (false === $item) {
Expand Down
6 changes: 3 additions & 3 deletions tests/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ sudo apt-get update > /dev/null 2>&1
sudo apt-get install redis-server > /dev/null 2>&1

# phpredis
wget https://github.com/nicolasff/phpredis/tarball/22f455593a9027cf935d37d70e198de225283d2e > /dev/null 2>&1
tar -xzf 22f455593a9027cf935d37d70e198de225283d2e > /dev/null 2>&1
sh -c "cd nicolasff-phpredis-22f4555 && phpize && ./configure && make && sudo make install" > /dev/null 2>&1
wget -O phpredis-master.zip https://github.com/nicolasff/phpredis/archive/master.zip > /dev/null 2>&1
unzip phpredis-master.zip > /dev/null 2>&1
sh -c "cd phpredis-master && phpize && ./configure && make && sudo make install" > /dev/null 2>&1
echo "extension=redis.so" >> $PHP_INI_FILE

# mongo
Expand Down

0 comments on commit c354e47

Please sign in to comment.