sroze / firebase-php

Firebase Admin SDK for PHP

Home Page:http://firebase-php.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firebase Admin SDK for PHP

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality Code Coverage

This SDK makes it easy to interact with Google Firebase applications.

Starting with version 2.0, this SDK requires PHP 7 - for PHP 5.5/5.6 support, please use Version 1.x.

For support, please use the issue tracker, or join the Firebase Community Slack at https://firebase-community.appspot.com and join the #php channel.

Documentation

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

Usage example

$firebase = Firebase::fromServiceAccount(__DIR__.'/google-service-account.json')
$database = $firebase->getDatabase();

$newPost = $database
    ->getReference('blog/posts')
    ->push([
        'title' => 'Post title',
        'body' => 'This should probably be longer.'
    ]);

$newPost->getKey(); // => -KVr5eu8gcTv7_AHb-3-
$newPost->getUri(); // => https://my-project.firebaseio.com/blog/posts/-KVr5eu8gcTv7_AHb-3-

$newPost->getChild('title')->set('Changed post title');
$newPost->getValue(); // Fetches the data from the realtime database
$newPost->remove();

About

Firebase Admin SDK for PHP

http://firebase-php.readthedocs.io

License:MIT License


Languages

Language:PHP 99.1%Language:Makefile 0.9%