Using Geofire query with PHP

757 views
Skip to first unread message

Ros

unread,
Dec 18, 2015, 11:31:35 AM12/18/15
to Firebase Google Group
Hi,

We use geofire javascript https://github.com/firebase/geofire-js to be able to stream realtime location of multiple items.

We now need to send a query using PHP to be able to find a list of ids in a 5 mile radius. Does anyone know how I can go about writing a query to obtain a list of ids' that fall in the radius? I need to be able to send lat, long, radius and obtain a list of points from PHP side. This is easily done with Geofire in JS. 

I would appreciate any help with PHP or to create the required queries? 

Thanks & Regards,
Ros

Jacob Wenger

unread,
Dec 27, 2015, 2:22:24 PM12/27/15
to fireba...@googlegroups.com
Hey Ros,

Firebase itself does not have a PHP-compatible library. Since GeoFire uses Firebase as its underlying data storage, GeoFire does not have a PHP-compatible library either. Your options are JavaScript, Java, or Objective-C/Swift.

But if you are using PHP in a web app, you can just use the JS API and do some hacky stuff to send JS variables to PHP code. If you are using PHP to store your data somewhere, you should consider just dropping the PHP entirely and store your data in Firebase! The beauty of Firebase is that languages like PHP are not needed to interact with it.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/3d17012a-d952-4e30-b988-bcf810306484%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Dunsterville

unread,
Apr 3, 2020, 12:09:44 PM4/3/20
to Firebase Google Group
Old post, but I thought I'd add for anyone searching that I am working on a PHP implementation of Geofire based on geofire-js

Reply all
Reply to author
Forward
0 new messages