Giter VIP home page Giter VIP logo

redisent's People

Contributors

bitdeli-chef avatar intarstudents avatar jdp avatar jmhobbs avatar kevburnsjr avatar oker1 avatar spk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redisent's Issues

Constant already defined

Could you check if CRLF is defined as a constant before setting it?

The FuelPHP framework already defines this constant, so our users can not use redisent at the moment.

Constant CRLF already defined

If CRLF has already been defined, then

define('CRLF', sprintf('%s%s', chr(13), chr(10)));

in Redisent.php will cause an error and stop execution.

if( !defined('CRLF') ) define('CRLF', sprintf('%s%s', chr(13), chr(10)));

This fixes it, and it seems to work but this may be system / code dependant.

Infinite loop on broken pipe.

        for ($written = 0; $written < strlen($command); $written += $fwrite) {
            $fwrite = fwrite($this->__sock, substr($command, $written));
            if ($fwrite === FALSE) {
                throw new Exception('Failed to write entire command to stream');
            }
        }

On broken pipe fwrite returns 0 and it loops for ever.

ZADD, ZREM, etc

I think adding sortable sets support from Redis 1.2
Adding 'ZADD', 'ZREM' to $bulk_cmds worked for me (just using ZADD and ZRANGE currently)
Cheers!

sort command doesn't work as before

It was possible to call sort command like this in older versions:
$redis->sort('set_name limit 0 10 desc');
It doesn't work anymore so you have to call sort method like this:
$redis->sort('set_name', 'limit', '0', '10', 'desc');
Is it possible to do something with that?

fsockopen error

Hi
I think it's a bit of a bug. When the redis server is down

$this->__sock = fsockopen($host, $port, $errno, $errstr); 

PHP displays a warning before the exception is thrown.

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:6379 (Connection refused) in ./lib/redisent/redisent.php on line 47

I think some checking if the socket exists would help or at least something like this:

$this->__sock = @fsockopen($host, $port, $errno, $errstr);

Which is not the bes solition but it works :)
Cheers!

Add support for specifying a socket connect timeout

I'm interested in adding support for adding a socket connect timeout and I wanted to get some feedback on your preferred approach for this.

Setting the timeout is relatively straightforward (just one more parameter to fsockopen), my question is really about the best way to pass in the timeout, it could either be done as an extra parameter on the constructor:

<?php
$redis = new redisent\Redis('redis://localhost:6379', $timeout = 2);

Or it could be made a query string parameter on the dsn:

<?php
$redis = new redisent\Redis('redis://localhost:6379?timeout=2');

I'm happy to code it up myself, just let me know which option you prefer.

sprintf issue

Its not so much an issue in your code but if you compile it in HipHop, the sprintf fails if a string starts with \x00

eg

$args[0] = "\x00\x5f";
$args[1] = "\x81\x77\x97\xa1\x8d\x4a\x25\xc1\x83\x71\xa0\x50\x02\xb7";
$name = 'hget';

If you replace the array_map with this, it works

$command = '*' . intval(count($args)) . CRLF. implode(array_map(function($arg) {
return '$' . intval(strlen($arg)) . CRLF . $arg . CRLF;
}, $args)). . CRLF ;

HMSET

How do I use HMSET with redisent?
I'm trying:

$array= array("IP", $IP, "ROOMNAME", $room);
$redis->hmset("new_room", $array);

But I'm receiving an error:

PHP Fatal error:  Uncaught exception 'redisent\\RedisException' with message 'Protocol error: invalid bulk length' (...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.