nathanfeitoza / firebase-php5.6
Firebase Admin SDK
1.0.0
2019-09-12 20:05 UTC
Requires
- ext-mbstring: *
- fig/http-message-util: ^1.1
- google/auth: ^0.11.0
- guzzlehttp/guzzle: ^6.2.1
- lcobucci/jwt: ^3.2
- mtdowling/jmespath.php: ^2.3
- nathanfeitoza/firebase-tokens-php-5.6: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-10-13 07:09:45 UTC
README
This repository is a fork of the original version 2.3.1 so that users of php version 5.6 or lower can work with google firebase.
Thanks for all support of Jérôme Gamez.
This SDK makes it easy to interact with Google Firebase applications.
For support, please use the issue tracker, or join the Firebase Community Slack at https://firebase-community.appspot.com and join the #php channel.
Documentation
You can find the documentation at https://firebase-php.readthedocs.io/en/2.3.1
composer require nathanfeitoza/firebase-php5.6
Usage example
$firebase = (new \Firebase\Factory()) ->withCredentials(__DIR__.'/path/to/google-service-account.json') ->withDatabaseUri('https://my-project.firebaseio.com') ->create(); $database = $firebase->getDatabase(); $newPost = $database ->getReference('blog/posts') ->push([ 'title' => 'Post title', 'body' => 'This should probably be longer.' ]); $newPost->getKey(); // => -KVr5eu8gcTv7_AHb-3- $newPost->getUri(); // => https://my-project.firebaseio.com/blog/posts/-KVr5eu8gcTv7_AHb-3- $newPost->getChild('title')->set('Changed post title'); $newPost->getValue(); // Fetches the data from the realtime database $newPost->remove();