Giter Club home page Giter Club logo

Comments (10)

BatuhanK avatar BatuhanK commented on June 21, 2024

Yes, please. It's really bad to use Firebase in this way.

from firebase-php.

ktamas77 avatar ktamas77 commented on June 21, 2024

it's relatively easy to implement, please feel free to fork the repository and send a pull request if you want to have this functionality immediately. otherwise i'll examine the best possible implementation soon. thank you for your suggestion.

from firebase-php.

BatuhanK avatar BatuhanK commented on June 21, 2024

@ktamas77 Too busy with midterms 👎

Waiting for your solution :) Thank you for fast response

from firebase-php.

kijin avatar kijin commented on June 21, 2024

Just opened a pull request that adds Keep-Alive support. Please test. Thanks.

from firebase-php.

BatuhanK avatar BatuhanK commented on June 21, 2024

I added your method + fsocks multi set method. #16

And good for news who needs amazing write speeds !

  • Added parallel curl with shell_exec; only works in linux ( i guess ).
    But you have no control after setting data, no callbacks no tracing etc.

Some stats (on digitalocean vps - ubuntu 12.04 )

  • [default] 50 set request with set method [ it using cURL ]=> 30sec
  • [mine]50 set requests with set_multi method [ it using fsocks ] => 12 sec
  • [mine]50 set requests with set_fast method [ it using cURL with shell exec /
    parallel ] => 0.4 sec

from firebase-php.

kijin avatar kijin commented on June 21, 2024

Amazing speed is great and all, but I'm not sure whether it should be the job of an API client library to handle parallelization through platform-specific shell commands. Parallelization should be the job of a different library, of which PHP already has plenty.

Not to mention this opens the door to all sorts of nasty security bugs. (addslashes? seriously?)

The fsockopen version looks cool, though. Could you add Keep-Alive support to that? It seems wasteful to close the socket after every request. As long as you don't need to read the responses, it should be just as fast as, if not faster than, the shell_exec method. Forking a shell is kinda expensive.

Anyway, just my $0.02 as the original opener of this issue. Of course @ktamas77 will have the final say.

from firebase-php.

BatuhanK avatar BatuhanK commented on June 21, 2024

@kijin haha you're right :)

in push request i mentioned :

Be careful it contains shell_exec method and json_data ( may contains your user inputs ).
so if you are not trusting to data, I suggest you to sanitize it carefully.

What is 0.02$, i don't understand.

(i'm newbie in version controlling and github. Sorry if I made mistake )

from firebase-php.

kijin avatar kijin commented on June 21, 2024

What is 0.02$, i don't understand.

Haha, it's just an American idiom, "my two cents".

from firebase-php.

BatuhanK avatar BatuhanK commented on June 21, 2024

@kijin
Dude, i just added keep-alive support for fsocks and removed shell_exec method. #16

You have to try it 👍 IT'S AWESOME !!

from firebase-php.

ktamas77 avatar ktamas77 commented on June 21, 2024

I agree, it's a nice improvement, please see my comment on #15 and #16

from firebase-php.

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.