Skip to content

Releases: kreait/firebase-php

2.1.2

19 Feb 21:18
2.1.2
ab4551a
Compare
Choose a tag to compare

Updated kreait/firebase-tokens to fix #65 (Invalid token when claims are empty).

2.1.1

17 Feb 23:54
2.1.1
54ee087
Compare
Choose a tag to compare

Updated kreait/firebase-tokens to make sure ID token verifications continue to work.

2.1.0

07 Feb 19:27
2.1.0
548ef24
Compare
Choose a tag to compare

These features are also available in a standalone library: kreait/firebase-tokens

2.0.2

26 Dec 21:02
2.0.2
3c3b6a8
Compare
Choose a tag to compare

Added a SERVER_TIMESTAMP constant to the Firebase\Database class to ease the population of fields with Firebase's timestamp server value

use Firebase\Database;

$ref = $db->getReference('my-ref')
          ->set('created_at', Database::SERVER_TIMESTAMP); 

is equivalent to

$ref = $db->getReference('posts/my-post')
          ->set('created_at', ['.sv' => 'timestamp']);

2.0.1

02 Dec 12:48
2.0.1
64b19f2
Compare
Choose a tag to compare
  • Renamed "Firebase SDK" to "Firebase Admin SDK for PHP" to emphasize the similarity to the newly
    introduced official Admin SDKs
    .
  • Added method Reference::getPath() to retrieve the full relative path to a node.
  • Updated docs to make clearer that authenticating with a Database Secret is not recommended since
    the official deprecation by Firebase (see
    the "Database Secrets" section in the "Service Accounts" tab of a project
    )
  • It is now possible to pass a JSON string as the Service Account parameter on Firebase::fromServiceAccount(). Until now, a string would have been treated as the path to a JSON file.

2.0.0

06 Nov 01:15
2.0.0
13aed82
Compare
Choose a tag to compare

Starting with version 2.0, this SDK is PHP7 only! For PHP 5 support, please use Version 1.x.

You can find the documentation at http://firebase-php.readthedocs.io .

2.0.0-beta3

05 Nov 22:01
2.0.0-beta3
ceadc7a
Compare
Choose a tag to compare

Changes to 2.0.0-beta2

  • A PermissionDenied exception is thrown when a request violates the
    Firebase Realtime Database rules
  • An IndexNotDefined exception is thrown when a Query is performed on an unindexed subtree
  • Removes the query option to sort results in descending order.
    • Nice in theory, conflicted in practice: when combined with limitToFirst() or limitToLast(),
      results were lost because Firebase sorts in ascending order and limits the results before
      we can process them further.
  • Adds a new Method Reference::getChildKeys() to retrieve the key names of a reference's children

Full list of changes: 2.0.0-beta2...2.0.0-beta3


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.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);