Releases: kreait/firebase-php
1.2.1
Simplify query construction and ensure that the correct variable types are used (previously, a numeric value would be wrapped into a string)
1.2
Permission errors can now be catched as Kreait\Firebase\Exception\PermissionDeniedException
2.0.0-beta2
Changes to 2.0.0-beta1
It seems more than just possible that the ID of a project given in the Google Service Account JSON file is different to the xxx.firebaseio.com subdomain of a Firebase application. It was already possible to pass the URL of the Realtime Database as a second parameter:
$firebase = Firebase::fromServiceAccount(
__DIR__.'/google-service-account.json',
'https://my-project.firebaseio.com'
);
Now a more visible method is available to do the same:
$firebase = Firebase::fromServiceAccount(__DIR__.'/google-service-account.json')
->withDatabaseUri('https://my-project.firebaseio.com');
Full list of changes: 2.0.0-beta1...2.0.0-beta2
Starting with version 2.0, this SDK is PHP7 only! The SDK is considered stable, but will stay in beta until the documentation at http://firebase-php.readthedocs.io has been finished.
Quickstart
Create a service account as described in the Firebase Docs and download the service account JSON file, or retrieve a database secret from your Firebase application's project settings page.
$firebase = Firebase::fromServiceAccount(__DIR__.'/google-service-account.json');
// or
$firebase = Firebase::fromDatabaseUriAndSecret(
'https://<project>.firebaseio.com',
'<database secret>'
);
$db = $firebase->getDatabase();
$fullTree = $db
->getReference('/')
->orderByKey(SORT_DESC)
->getValue(); // Shortcut for ->getSnapshot()->getValue()
print_r($fullTree);
1.1.1
Fixes a bug that prevented querying by boolean values.
Thanks to @waleedazam for finding it!
2.0.0-beta1
Starting with version 2.0, this SDK is PHP7 only! The SDK is considered stable, but will stay in beta until the documentation at http://firebase-php.readthedocs.io has been finished.
Quickstart
Create a service account as described in the Firebase Docs and download the service account JSON file, or retrieve a database secret from your Firebase application's project settings page.
$firebase = Firebase::fromServiceAccount(__DIR__.'/google-service-account.json');
// or
$firebase = Firebase::fromDatabaseUriAndSecret(
'https://<project>.firebaseio.com',
'<database secret>'
);
$db = $firebase->getDatabase();
$fullTree = $db
->getReference('/')
->orderByKey(SORT_DESC)
->getValue(); // Shortcut for ->getSnapshot()->getValue()
print_r($fullTree);
1.1
Adds support for "equalTo" queries
1.0.1
Enables the usage of egeleon/http-adapter ^1.0
in addition to ^0.8
.
1.0
- The deprecated methods from pre-releases have been removed
- The project now has a shiny documentation at http://firebase-php.readthedocs.io
- This version supports the usage of Google Service Accounts for authentication (Firebase Authentication V3) and the creation of custom tokens for the Firebase SDK V2 and V3.
0.10.2
See https://github.com/kreait/firebase-php/blob/0.10.2/doc/authentication.md for the updated authentication method. The previous methods still work.
- Added support for authentication overrides when using a Google Service account
- It is now easier to override authentication credentials through
$firebase->setAuthOverride($uid, array $claims = [])
.- There's no need to create and set the needed custom tokens yourself.
- The new method works regardless of whether you use a database secret or
a Google Service Account for the basic authentication.
- Updated authentication docs
- Added methods:
Firebase::setAuthOverride(string $uid, array $claims = [])
Firebase::removeAuthOverride()
- Deprecated methods:
Firebase::setAuthToken()
Firebase::getAuthToken()
Firebase::hasAuthToken()
Firebase::removeAuthToken()
0.10.1
Added support for authentication with a Google Service account