Closed oswazteca closed 5 years ago
With the following code...
<?php require __DIR__.'/vendor/autoload.php'; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ const DEFAULT_URL = 'https://dbname.firebaseio.com/'; const DEFAULT_TOKEN = '<tokenfromfirebasewebpage>'; 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');
I am getting the following error:
In the composer.json I have:
"require": { "php": ">=5.2.4", "kreait/firebase-php": "^3.0" }
I am using CodeIgniter 3 but I think that isn't the problem, any idea what it could be?
Your composer require should be "ktamas77/firebase-php": "dev-master" You are including another PHP firebase library (kreait/firebase-php) instead of this one
"ktamas77/firebase-php": "dev-master"
With the following code...
I am getting the following error:
In the composer.json I have:
I am using CodeIgniter 3 but I think that isn't the problem, any idea what it could be?