任何将Firebase与php Codeigniter-3连接的方法或解决方案?或可以互相连接吗?
答案 0 :(得分:1)
您可以通过以下方式在项目中使用FireBase: https://github.com/eelkevdbos/firebase-php
使用Firebase \ Firebase;
$fb = Firebase::initialize(YOUR_FIREBASE_URL, YOUR_FIREBASE_SECRET);
//or set your own implementation of the ClientInterface as second parameter of the regular constructor
$fb = new Firebase([ 'base_url' => YOUR_FIREBASE_BASE_URL, 'token' => YOUR_FIREBASE_SECRET ], new GuzzleHttp\Client());
//retrieve a node
$nodeGetContent = $fb->get('/node/path');
//set the content of a node
$nodeSetContent = $fb->set('/node/path', array('data' => 'toset'));
//update the content of a node
$nodeUpdateContent = $fb->update('/node/path', array('data' => 'toupdate'));
//delete a node
$nodeDeleteContent = $fb->delete('/node/path');
//push a new item to a node
$nodePushContent = $fb->push('/node/path', array('name' => 'item on list'));