Giter Site home page Giter Site logo

String values with space about phpiredis HOT 11 CLOSED

nrk avatar nrk commented on June 12, 2024
String values with space

from phpiredis.

Comments (11)

nrk avatar nrk commented on June 12, 2024

Hi @fightbulc,

You should really use phpiredis_command_bs since phpiredis_command is not safe to use (we should just remove it IMHO). phpiredis_command_bs accepts an array instead of a string with each command argument being an element of the array:

<?php

$redis = phpiredis_connect("127.0.0.1");
phpiredis_command_bs($redis, array("SET", "user", "Foo bar"));

from phpiredis.

fightbulc avatar fightbulc commented on June 12, 2024

Hi Daniele, thanks for the prompt answer. I've noticed that _bs was working but how could I use then the pipeline feature? I assumed multi_command would do the trick.

cheers
Tino

Tino Ehrich
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, 23. November 2012 at 19:23, Daniele Alessandri wrote:

Hi @fightbulc (https://github.com/fightbulc),
You should really use phpiredis_command_bs since phpiredis_command is not safe to use (we should just remove it IMHO). phpiredis_command_bs accepts an array instead of a string with each command argument being an element of the array:

from phpiredis.

nrk avatar nrk commented on June 12, 2024

Good catch, there's indeed no way to pipeline commands in a binary-safe way right now. I'll try implementing a phpiredis_multi_command_bs function this weekend.

from phpiredis.

fightbulc avatar fightbulc commented on June 12, 2024

Nice one! Looking forward.

Cheers

from phpiredis.

fightbulc avatar fightbulc commented on June 12, 2024

Morning nrk,

any success over the weekend?

Cheers from Berlin

from phpiredis.

nrk avatar nrk commented on June 12, 2024

Heya @fightbulc,

sorry for being late but in the end I didn't have much time last weekend to hack on phpiredis, but anyway now I got phpiredis_multi_command_bs() implemented in the multi_command_bs branch. If you can give it a try and confirm that everything works I'll merge that branch into master.

Thanks!

from phpiredis.

fightbulc avatar fightbulc commented on June 12, 2024

Heyho @nrk,

no worries. I will give it a try today and let you know about the outcome.

Really appreciate your taken time.

Thanks!
Cheers

from phpiredis.

fightbulc avatar fightbulc commented on June 12, 2024

@nrk, on my mac installing went smooth.

On my gentoo machine not quite because I got thrown off by test fails.
I simply got failed tests although compilation went find. After a couple
of reinstalls without any effect on the result I assumed that you might
forgot about adjusting the tests. So I ran my application and all
seems to run as expected.

Any idea?

Find below the test summary.

Cheers
Tino

TEST RESULT SUMMARY

Exts skipped : 0

Exts tested : 44

Number of tests : 25 25
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 10 ( 40.0%) ( 40.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)

Tests passed : 15 ( 60.0%) ( 60.0%)

Time taken : 1 seconds

FAILED TEST SUMMARY

phpiredis connect [tests/001.phpt]
phpiredis command [tests/002.phpt]
phpiredis multicommand [tests/003.phpt]
phpiredis array [tests/004.phpt]
phpiredis multicommand [tests/005.phpt]
phpiredis command binary safe [tests/006.phpt]
phpiredis command binary safe using image [tests/007.phpt]
phpiredis reconnect on disconnect [tests/008.phpt]
phpiredis reconnect on disconnect [tests/009.phpt]

phpiredis multicommand (binary safe) [tests/025.phpt]

from phpiredis.

nrk avatar nrk commented on June 12, 2024

@fightbulc yeah the failed tests are most likely unrelated, the fact that your failed tests are the ones opening a connection to Redis makes me think that you have something that blocks connections to port 6379 on localhost on your gentoo machine or Redis is bound to a different port than the standard one as I can't really think of a different reason.

I'll merge that branch into master anyway, thanks for the feedback!

from phpiredis.

fightbulc avatar fightbulc commented on June 12, 2024

@nrk, you're right. The server is bound to a different IP.

from phpiredis.

nrk avatar nrk commented on June 12, 2024

@fightbulc alright thanks for confirming it wasn't a bug or anything :-)

from phpiredis.

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.