Code Monkey home page Code Monkey logo

Comments (5)

danhunsaker avatar danhunsaker commented on May 18, 2024

Generally speaking, your string should be quoted in the command() string, so $redis->command('set test "' . $value . '"'); would be your function call.

That said, using command() is not the preferred method of using CI-Redis - instead, use $redis->set('test', $value); and the class will take care of all the escaping and other such tricks on your behalf.

from codeigniter-redis.

danhunsaker avatar danhunsaker commented on May 18, 2024

(Also, it should be $this->redis->set(...) instead of $redis->set(...), but I'm guessing you know that, working with CI...)

from codeigniter-redis.

jonathanwiesel avatar jonathanwiesel commented on May 18, 2024

Thank you very much, dumb of me, I should have tried using the set function in the first place, worked perfectly.

About the use of $redis->... instead of $this->redis->... was because I implemented a constructor in the library and was using the $redis variable for the object:

$redis = new CI_Redis();

from codeigniter-redis.

jonathanwiesel avatar jonathanwiesel commented on May 18, 2024

I noticed that setting a json as a value went good.

However when I try to get it, the response becomes truncated (no fixed size), one with more than 3500 characters came good but other with 2800 was truncated.

Looking at the database through the terminal I can see that the values are indeed complete so the truncation process may be happening in the parser that receives the 'get' call back to CodeIgniter.

from codeigniter-redis.

danhunsaker avatar danhunsaker commented on May 18, 2024

See issues #39 and #40...

from codeigniter-redis.

Related Issues (20)

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.