PHP library access Firebase RESTful API alternatives and similar libraries
Based on the "Database" category.
Alternatively, view PHP library access Firebase RESTful API alternatives based on common mentions on social networks and blogs.
-
Doctrine
Doctrine Object Relational Mapper (ORM) -
Medoo
The lightweight PHP database framework to accelerate the development. -
Doctrine Extensions
Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable -
ProxyManager
🎩✨🌈 OOP Proxy wrappers/utilities - generates and manages proxies of your objects -
Eloquent
[READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework) -
Baum
Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM. -
Idiorm
A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5. -
RedBean
ORM layer that creates models, config and database on the fly -
Propel
Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP -
Doctrine2 Behaviors
Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior -
EasyDB
Easy-to-use PDO wrapper for PHP projects. -
Aura.Sql
SQL database access through PDO. -
Spot2
Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer -
Aura.SqlQuery
Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. -
Atlas.Orm
A data mapper implementation for your persistence model in PHP. -
ATK Data
Data Access PHP Framework for SQL & high-latency databases -
Cake ORM
[READ-ONLY] A flexible, lightweight and powerful Object-Relational Mapper for PHP, implemented using the DataMapper pattern. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp -
Pomm
PHP Object Model Manager for Postgresql -
Elasticsearch Eloquent
⚡️ Models like Eloquent for Elasticsearch. -
Simple MySQLi Class
:gem: Simple MySQLi Abstraction Layer + Doctrine/DBAL support -
LDBA
High-performance, low-memory-footprint, single-file embedded database for key/value storage -
Corma
Convention-based Object-Relational Mapper -
Symfony-RDM
Helps with the use of domain driven design & rich domain model in symfony / doctrine applications. -
LazyRecord
The fast ORM for PHP. (This is a history repo, please visit maghead/maghead)
Access the most powerful time series database as a service
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of PHP library access Firebase RESTful API or a related project?
README
PHP library access Firebase RESTful API
Installation
$ composer require jaredchu/jc-firebase-php
Usage
Generate a private key in JSON format.
Check Firebase credential
use JC\Firebase\JCFirebase;
$firebaseURI = "https://<DATABASE_NAME>.firebaseio.com";
$jsonKeyFile = "path/to/serviceAccountKey.json";
$firebase = new JCFirebase::fromKeyFile( $firebaseURI, $jsonKeyFile );
if( $firebase->isValid() ){
//do something
}
GET - Reading Data
$response = $firebase->get('user');
echo $response->success;
echo $response->body;
PUT - Writing Data
$response = $firebase->put('user', array('data' => array('first_name'=>'Jared','last_name'=>'Chu')));
echo $response->status_code;
echo $response->body;
POST - Pushing Data
$response = $firebase->post('log', array('data' => array('code'=>401,'message'=>'Not Authorized')));
echo $response->status_code;
echo $response->body;
PATCH - Updating Data
$response = $firebase->patch('user', array('data' => array('first_name'=>'Jared',
'last_name'=>'Leto','age'=>27)));
echo $response->status_code;
echo $response->body;
DELETE - Removing Data
$response = $firebase->delete('user/first_name');
echo $response->status_code;
echo $response->body;
Modeling
Create Firebase connector
use JC\Firebase\JCFirebase;
$firebaseURI = "https://<DATABASE_NAME>.firebaseio.com";
$jsonKeyFile = "path/to/serviceAccountKey.json";
$firebase = new JCFirebase::fromKeyFile( $firebaseURI, $jsonKeyFile );
Extend your Model with FirebaseModel
class Log extends FirebaseModel {
/**
* @var integer
*/
public $code;
/**
* @var string
*/
public $message;
}
Get record
$log = Log::findByKey( $key, $firebase );
echo $log->key;
echo $log->code;
echo $log->message;
$logs = Log::findAll( $firebase );
foreach ($logs as $log){
echo $log->key;
echo $log->code;
echo $log->message;
}
Create record
$log = new Log( $firebase );
$log->code = 200;
$log->message = 'Success';
$log->save();
Update record
$log = Log::findByKey( $key, $firebase );
$log->code = 400;
$log->message = 'Bad Request';
$log->save();
Delete record
$log = Log::findByKey( $key, $firebase );
$log->delete();
Contributing
- Fork it!
- Create your feature branch:
$ git checkout -b feature/your-new-feature
- Commit your changes:
$ git commit -am 'Add some feature'
- Push to the branch:
$ git push origin feature/your-new-feature
- Submit a pull request.
License
Support on Beerpay
Hey dude! Help me out for a couple of :beers:!
*Note that all licence references and agreements mentioned in the PHP library access Firebase RESTful API README section above
are relevant to that project's source code only.