-1

将 Firebase 与 php Codeigniter-3 连接的任何方法或解决方案?或者是否有可能相互连接?

4

1 回答 1

1

您可以通过https://github.com/eelkevdbos/firebase-php在您的项目中使用 FireBase

使用 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'));

Firebase 与 php 中的 codeigniter 的连接

于 2019-04-05T12:27:53.917 回答