PHPackages                             devbry/firebase-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. devbry/firebase-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

devbry/firebase-php
===================

Firebase PHP Client

2.0.0(11y ago)121MITPHPPHP &gt;=5.3.0

Since Oct 9Pushed 10y agoCompare

[ Source](https://github.com/brayansdt/firebase-php)[ Packagist](https://packagist.org/packages/devbry/firebase-php)[ Docs](https://github.com/ktamas77/firebase-php)[ RSS](/packages/devbry-firebase-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Firebase PHP Client
===================

[](#firebase-php-client)

[![Build Status](https://camo.githubusercontent.com/78cd336a5d6090adb62e62267f7b3204be84e5041d5f94cd3913971486f4c230/68747470733a2f2f64726f6e652e696f2f6769746875622e636f6d2f6b74616d617337372f66697265626173652d7068702f7374617475732e706e67)](https://drone.io/github.com/ktamas77/firebase-php/latest)

[![Scrutinizer Quality Score](https://camo.githubusercontent.com/cf864e8f3350a38b2fb7b3adb76af251d39112ccb6b09bb242209042f9ba35a4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b74616d617337372f66697265626173652d7068702f6261646765732f7175616c6974792d73636f72652e706e673f733d32333966666361373636323862356138363534306239646566313837653266386131393963623130)](https://scrutinizer-ci.com/g/ktamas77/firebase-php/)

Based on the [Firebase REST API](https://www.firebase.com/docs/rest-api.html).

Available on [Packagist](https://packagist.org/packages/ktamas77/firebase-php).

### Adding Firebase PHP to your project using Composer

[](#adding-firebase-php-to-your-project-using-composer)

```
cd
composer require ktamas77/firebase-php dev-master
```

More info about Composer at [getcomposer.org](http://getcomposer.org).

### Example

[](#example)

```
const DEFAULT_URL = 'https://kidsplace.firebaseio.com/';
const DEFAULT_TOKEN = 'MqL0c8tKCtheLSYcygYNtGhU8Z2hULOFs9OKPdEp';
const DEFAULT_PATH = '/firebase/example';

$firebase = new \Firebase\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN);

// --- storing an array ---
$test = array(
    "foo" => "bar",
    "i_love" => "lamp",
    "id" => 42
);
$dateTime = new DateTime();
$firebase->set(DEFAULT_PATH . '/' . $dateTime->format('c'), $test);

// --- storing a string ---
$firebase->set(DEFAULT_PATH . '/name/contact001', "John Doe");

// --- reading the stored string ---
$name = $firebase->get(DEFAULT_PATH . '/name/contact001');
```

### Supported Commands

[](#supported-commands)

```
// -- Firebase API commands

$firebase->set($path, $value);   // stores data in Firebase
$value = $firebase->get($path);  // reads a value from Firebase
$firebase->delete($path);        // deletes value from Firebase
$firebase->update($path, $data); // updates data in Firebase
$firebase->push($path, $data);   // push data to Firebase

// -- Firebase PHP Library commands

$firebase->setToken($token);     // set up Firebase token
$firebase->setBaseURI($uri);     // set up Firebase base URI (root node)
$firebase->setTimeOut($seconds); // set up maximum timeout / request
```

Please refer to the [Firebase REST API documentation](https://www.firebase.com/docs/rest/api/) for further details.

### Firebase PHP Stub

[](#firebase-php-stub)

A Firebase PHP Stub has been created to allow for integration with phpunit without actually interacting with FirebaseIO.

To use the firebaseLib and firebaseStub in your application and testing, you must pass in a firebase object to your application.

For example, if your current code is:

```
public function setFirebaseValue($path, $value) {
  $firebase = new Firebase('https://radiant-fire-2427.firebaseio.com', 'czvEX8vMU8FZn4wYCvf466P3J6zH5ZlKQeuwxmEZ');
  $firebase->set($path, $value);
}
```

You will change it to be:

```
public function setFirebaseValue($path, $value, $firebase) {
  $firebase->set($path, $value);
}
```

Then your phpunit tests will look like:

```

```

### Unit Tests

[](#unit-tests)

All the unit tests are found in the "/tests" directory. Due to the usage of an interface, the tests must run in isolation.

The firebaseLib tests have inherent latency due to actual cURL calls to a live firebaseIO account. The firebaseLib tests can be executed by running the following command:

```
$ phpunit tests/firebaseTest.php
```

The FirebaseStub tests can be executed by running the following command:

```
$ phpunit tests/firebaseStubTest.php
```

#### The MIT License (MIT)

[](#the-mit-license-mit)

```
Copyright (c) 2012-2015 Tamas Kalman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~145 days

Total

2

Last Release

4093d ago

Major Versions

1.0.0 → 2.0.02015-03-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6397ae8dfa7e3ea22ed80b5302d3912cea4f7a5a001e66856617ecc5fe1fb5a?d=identicon)[devbry](/maintainers/devbry)

---

Top Contributors

[![ktamas77](https://avatars.githubusercontent.com/u/1231708?v=4)](https://github.com/ktamas77 "ktamas77 (36 commits)")[![llbbl](https://avatars.githubusercontent.com/u/19964?v=4)](https://github.com/llbbl "llbbl (10 commits)")[![craigrusso](https://avatars.githubusercontent.com/u/3504649?v=4)](https://github.com/craigrusso "craigrusso (4 commits)")[![brianpilati](https://avatars.githubusercontent.com/u/369083?v=4)](https://github.com/brianpilati "brianpilati (3 commits)")[![brayansdt](https://avatars.githubusercontent.com/u/3244346?v=4)](https://github.com/brayansdt "brayansdt (1 commits)")[![taylornotwell](https://avatars.githubusercontent.com/u/78162749?v=4)](https://github.com/taylornotwell "taylornotwell (1 commits)")[![dvidsilva](https://avatars.githubusercontent.com/u/1588753?v=4)](https://github.com/dvidsilva "dvidsilva (1 commits)")[![elliotchance](https://avatars.githubusercontent.com/u/927418?v=4)](https://github.com/elliotchance "elliotchance (1 commits)")[![miyukki](https://avatars.githubusercontent.com/u/720609?v=4)](https://github.com/miyukki "miyukki (1 commits)")

---

Tags

restwrapperfirebase

### Embed Badge

![Health badge](/badges/devbry-firebase-php/health.svg)

```
[![Health](https://phpackages.com/badges/devbry-firebase-php/health.svg)](https://phpackages.com/packages/devbry-firebase-php)
```

###  Alternatives

[ktamas77/firebase-php

Firebase PHP Client

7881.8M10](/packages/ktamas77-firebase-php)[gnikyt/basic-shopify-api

A basic Shopify API wrapper with REST and GraphQL support, powered by Guzzle.

245514.8k5](/packages/gnikyt-basic-shopify-api)[zoonman/linkedin-api-php-client

LinkedIn API PHP SDK with OAuth 2.0 &amp; CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.

127704.0k](/packages/zoonman-linkedin-api-php-client)[eelkevdbos/firebase-php

Firebase php wrapper for REST API

7728.8k](/packages/eelkevdbos-firebase-php)[highsidelabs/laravel-spapi

A Laravel wrapper for Amazon's Selling Partner API (via jlevers/selling-partner-api)

2133.4k](/packages/highsidelabs-laravel-spapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
