Closed setiawanandre06 closed 7 years ago
I have this same issue with ServiceAccount::fromJson()
EDIT: The docs just need to be updated it seems. Upgrading the composer.json from "3.0" to "3.1" solved this issue.
Oh yeah, right. I just read the docs and It only supports 3.1 version. Thanks!
Hi guys,
Can you explain me how you solved the problem?
It looks I have the same issue and I can not access correctly the ServiceAccount.
Is there any step-by-step guide on getting a Snapshot from Firebase in PHP?
Best,
There is a usage example at http://firebase-php.readthedocs.io/en/latest/overview.html#usage-example which writes something into the RealtimeDatabase and then fetches it (getValue()
is a shortcut for getSnapshot()->getValue()
).
Make sure to also require the autoloader (the first line in the code snippet)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I tried to follow the setup instruction (Manually), and I got this fatal error message:
Here is my code :
`<?php
require DIR.'\vendor\autoload.php';
use Kreait\Firebase\Factory; use Kreait\Firebase\ServiceAccount;
$serviceAccount = ServiceAccount::fromJsonFile(DIR.'/google-service-account.json');
$firebase = (new Factory) ->withServiceAccount($serviceAccount) ->create(); ?>`
DId I make a wrong path with my 'google-service-account.json'?