Download the PHP package amos97/firebase-php without Composer
On this page you can find all versions of the php package amos97/firebase-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package firebase-php
Firebase php
Php implementation of Firebase API.
Why
This package is built to be simple, scalable and configurable to allow easy integration in other packages or frameworks (ex: laravel-firebase ).
This package uses google/auth
to generate OAuth2.0 tokens from the service account and guzzlehttp/guzzle
as http library.
Install
Install it with composer via
composer require amos97/firebase-php
Usage
All the calls on the API are made using a Firebase OAuth2.0 token, this token is generated using your ServiceAccount informations.
Service Account
To use the API you need to authenticate the requests with your service account:
this is done by the ServiceAccount
class that uses your Firebase ServiceAccount json credential file.
You can download your service account json file from the Firebase console in settings > service accounts, keep in mind to store this file in a secure non-public location.
Accepted methods for the constructor are:
- string: ServiceAccount file content (json string)
- string: path to the serviceAccount json file
- array: php-translated array of the service account content
You can also add a token cache handler via the setCacheHandler
method that accepts an implementation of CacheItemPoolInterface
to allow custom cache integrations.
see google/auth MemoryCacheItemPool for an example implementation:
FCM
This package implements FCM Http v1 Api
see FCM docs
Real time database
This package includes the Firebase Real time database API integration
see Real time database docs
All versions of firebase-php with dependencies
google/auth Version ^1.2.1
guzzlehttp/guzzle Version ^6.3
firebase/php-jwt Version ^5.0