eelkevdbos / firebase-php Goto Github PK
View Code? Open in Web Editor NEWFirebase php wrapper for REST API
License: MIT License
Firebase php wrapper for REST API
License: MIT License
Hi, I keep getting the following response. Any ideas?
"Client error response [url] FIREBASE_URL/test.json?auth=FIREBASE_SECRET [status code] 400 [reason phrase] Bad Request" on line 89 of /home/vagrant/projects/hostpedia/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
can this library upload file to firebase storage?
Current get() function only accepts a Criteria as parameter.
We need to be able to use any of the URI Parameters listed here: https://www.firebase.com/docs/rest/guide/retrieving-data.html#section-rest-uri-params such as 'shallow' or 'print'.
Regards,
Hey,
I'm wanting to register and login users using your lib.
Is it possible? Struggling to find a way to do it. Everything else I've done using your library works perfectly (using Laravel 5.3)
Cheers
Hi @eelkevdbos,
Is it it possible with your php code to trigger on an event when the firebase is update. For example, I have a JS client that updates data in the firebase on the server. The PHP code that you have is also a client, but is there a channel that is opened to the firebase server that will pick up the new update? I am trying to understand how this works on the backend. Do I have to write php code that polls the firebase server loop?
Thanks!
Adam
Hello,
I want to use laravel 5.2 with firebase. When I try to get data from firebase I get this error. Can you please help me with this? Thank you!
Code:
` $hash = $request->get('hash');
$fb = Firebase::initialize('https://dasdsadas.firebaseio.com', 'dasdasdasdasdas');
$nodeGetContent = $fb->get('/users/' . $hash);
dd($nodeGetContent);`
ERROR:
RequestException in RequestException.php line 51:
Error creating resource: [message] fopen(https://dasdsadas.firebaseio.com/users/dsadsada.json?auth=dasdasdasdasdas): failed to open stream: Connection timed out
[file] /var/www/getaride-api/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 406
[message] Undefined variable: http_response_header
[file] /var/www/getaride-api/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 407
When I append a child path, I have to remember to prefix it with /
; could firebase-php check internally to make sure the / is present? This would also more closely match other Firebase APIs' handling of child paths.
Example:
$fb = new Firebase\Firebase(array(
'base_url' => 'https://INSTANCE.firebaseio.com/phptest',
'token' => SECRET,
),new GuzzleHttp\Client());
// this dumps the data for /phptestfoo instead of /phptest/foo :(
// there is no error or indication that the path is wrong
var_dump($fb->get('foo'));
Same is true for all get/set/push/delete et al methods.
Hi im trying to use this lib
but when i try to do for example
$FB->set('/lotto',array('data'=>'valore'));
only the root will be changed with the value to '/lotto' and not as a key
Hi,
Just want to know if how can I used the orderBy and startAt in $fb->get()?
Hey, I have this error after setting the minimum-stability to dev on my composer.json file.
Here's the log:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for eelkevdbos/firebase-php dev-master -> satisfiable by eelkevdbos/firebase-php[dev-master].
- Conclusion: remove guzzlehttp/guzzle 6.2.3
- Conclusion: don't install guzzlehttp/guzzle 6.2.3
- eelkevdbos/firebase-php dev-master requires guzzlehttp/guzzle 5.* -> satisfiable by guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.0.0, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.0.1, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.0.2, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.0.3, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.1.0, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.2.0, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.3.0, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.3.1, 6.2.3].
- Can only install one of: guzzlehttp/guzzle[5.3.x-dev, 6.2.3].
- Installation request for guzzlehttp/guzzle (locked at 6.2.3) -> satisfiable by guzzlehttp/guzzle[6.2.3].
Installation failed, reverting ./composer.json to its original content.
Edit, I have installed "irazasyed/telegram-bot-sdk": "^2.2", that require guzzlehttp6
I have an SSL host & domain, which I can access from https://example.net and Chrome shows the green SSL lock ; and I get Laravel's welcome page.
I installed firebase-php using composer and set it up. But I started getting this error:
RequestException in RequestException.php line 51:
Error creating resource: [message] fopen(https://example.firebaseio.com/users.json?auth=QwerTy): failed to open stream: Connection timed out [file] /var/www/laravel/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php [line] 406 [message] Undefined variable: http_response_header [file] /var/www/laravel/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php [line] 407
My code:
use Firebase\Firebase;
class MyController extends Controller
{
public function sendToken() {
$fb = Firebase::initialize($_ENV['FIREBASE_URL'], $_ENV['FIREBASE_SECRET']);
// Also tried, but same error
// $fb = new Firebase([ 'base_url' => $_ENV['FIREBASE_URL'], 'token' => $_ENV['FIREBASE_SECRET']], new Client());
$nodeGetContent = $fb->get('/users');
dd($nodeGetContent);
}
}
Hello Eelke,
Checking out firebase-php today, but couldn't get it to install via composer, after running the instructions as found in the README:
Sputnik:test-firebase-php katowulf$ php composer.phar require eelkevbos/firebase-php dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package eelkevbos/firebase-php could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
Sputnik:test-firebase-php katowulf$
My PHP is a bit rusty; they didn't have composer back in my day; any ideas here?
Hello
I updated require part of composer.json by appending "eelkevdbos/firebase-php": "dev-master"
(Laravel v4.1) but running composer update
results in:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for eelkevdbos/firebase-php dev-master -> satisfiable by eelkevdbos/firebase-php[dev-master].
- eelkevdbos/firebase-php dev-master requires firebase/php-jwt dev-master -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Hi @eelkevdbos , I think your package is good compared to https://github.com/ktamas77/firebase-php. However his package is listed here:
https://www.firebase.com/docs/rest/quickstart.html
and that the only package listed for PHP.
can you request Firebase team to include your package? This will help many PHP programmers to get start with Firebase.
:)
One more thing, Please write a tutorial(A Todo app) to show the implementation of the package would be great.
Thank you very much for this package.
Currently, only anonymous and secret authentication are supported. Authentication with a token generator should also be possible. This allows for specific permissions per user.
See: streaming API
It's not possible to access the current or root path using get/set/et al.
Example:
$fb = new Firebase\Firebase(array(
'base_url' => 'https://INSTANCE.firebaseio.com/phptest',
'token' => SECRET,
),new GuzzleHttp\Client());
// this generates an error and I can't access the phptest/ path, nor would I be able to access
// the root path in a Firebase
var_dump($fb->get());
$ composer require eelkevdbos/firebase-php
Using version 0.1.* for eelkevdbos/firebase-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- eelkevdbos/firebase-php v0.1.2 requires guzzlehttp/guzzle 4.1.1 -> no matching package found.
- eelkevdbos/firebase-php v0.1.1 requires guzzlehttp/guzzle dev-master#d79c982 -> no matching package found.
- eelkevdbos/firebase-php v0.1 requires guzzlehttp/guzzle dev-master#d79c982 -> no matching package found.
- Installation request for eelkevdbos/firebase-php 0.1.* -> satisfiable by eelkevdbos/firebase-php[v0.1, v0.1.1, v0.1.2].
Potential causes:
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
then tried with dev-master:
$composer require eelkevdbos/firebase-php dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for eelkevdbos/firebase-php dev-master -> satisfiable by eelkevdbos/firebase-php[dev-master].
- eelkevdbos/firebase-php dev-master requires firebase/php-jwt ~1.0 -> no matching package found.
Potential causes:
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Composer.json
{
"require": {
"illuminate/support": "~4.0",
"firebase/php-jwt": "dev-master",
"guzzlehttp/guzzle": "~5.0.3"
}
}
i am getting this error and don't know why this is happening.
use Firebase\Firebase;
$fb = Firebase::initialize('url','key');
$fb->set('/node/path', array('data' => 'toset'));
Hi,
My project uses firebase/php-jwt[v3.0.0] but you're using an older version of the library ~2 in your composer.json.
As a result installation fails.
composer require eelkevdbos/firebase-php
Using version dev-master for eelkevdbos/firebase-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for eelkevdbos/firebase-php dev-master -> satisfiable by eelkevdbos/firebase-php[dev-master].
- Conclusion: remove firebase/php-jwt v3.0.0
- Conclusion: don't install firebase/php-jwt v3.0.0
- eelkevdbos/firebase-php dev-master requires firebase/php-jwt ~2.0 -> satisfiable by firebase/php-jwt[2.0.0, v2.1.0, v2.2.0].
- Can only install one of: firebase/php-jwt[2.0.0, v3.0.0].
- Can only install one of: firebase/php-jwt[v2.1.0, v3.0.0].
- Can only install one of: firebase/php-jwt[v2.2.0, v3.0.0].
- Installation request for firebase/php-jwt (locked at v3.0.0) -> satisfiable by firebase/php-jwt[v3.0.0].
Installation failed, reverting ./composer.json to its original content.
Hi all,
I have issuse .when use firebase. this error :
Guzzle returns cURL error 3: malformed
please help me thank all so much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.