Skip to content

Releases: kreait/firebase-php

1.2.1

26 Oct 09:35
1.2.1
959fb66
Compare
Choose a tag to compare

Simplify query construction and ensure that the correct variable types are used (previously, a numeric value would be wrapped into a string)

1.2

21 Oct 09:42
1.2
acaf316
Compare
Choose a tag to compare
1.2

Permission errors can now be catched as Kreait\Firebase\Exception\PermissionDeniedException

2.0.0-beta2

11 Oct 13:45
2.0.0-beta2
ebee678
Compare
Choose a tag to compare
2.0.0-beta2 Pre-release
Pre-release

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

29 Sep 10:05
1.1.1
8f926f3
Compare
Choose a tag to compare

Fixes a bug that prevented querying by boolean values.

Thanks to @waleedazam for finding it!

2.0.0-beta1

13 Aug 23:41
2.0.0-beta1
Compare
Choose a tag to compare
2.0.0-beta1 Pre-release
Pre-release

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

20 Jul 08:58
1.1
Compare
Choose a tag to compare
1.1

Adds support for "equalTo" queries

1.0.1

16 Jul 09:01
Compare
Choose a tag to compare

Enables the usage of egeleon/http-adapter ^1.0 in addition to ^0.8.

1.0

15 Jul 20:51
Compare
Choose a tag to compare
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

15 Jul 14:50
Compare
Choose a tag to compare

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

03 Jul 14:56
Compare
Choose a tag to compare

Added support for authentication with a Google Service account