kreait / firebase-bundle

A Symfony Bundle for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
136 stars 26 forks source link

Where is the file FirebaseBundle.php ? #5

Closed youngdreamer33 closed 6 years ago

youngdreamer33 commented 6 years ago

Hello,

I've been learning PHP with Symfony for a few months and want to add Firebase to my project (which I'm learning !). There are new issues with the last version of Symfony with bundles (https://stackoverflow.com/questions/44928982/appkernel-php-weird-behavior#comment76834486_44928982) and I cannot fix it for your bundle. The installation of the bundle crashes my project and I cannot find the file FirebaseBundle.php which is referred to in the AppKernel.php.

I don't know if I'm clear enough but I'd love if you could help me out !

Thanks for your bundle and the sdk anyway ! :)

youngdreamer33 commented 6 years ago

Update: in fact I didn't see the fact that composer failed to install the bundle saying that there is no version 1.0.

jeromegamez commented 6 years ago

Hey @youngdreamer33,

there is no 1.0 release yet, in the meantime you can install it with

composer require kreait/firebase-bundle 1.0.x-dev

or insert

"kreait/firebase-bundle": "1.0.x-dev",

in your composer.json followed by a composer update.

youngdreamer33 commented 6 years ago

Thanks, this is what I did. When I run the server I got this message:

[LogicException] Users will expect the alias of the default extension of a bundle to be the underscored version of the bundle name ( "firebase"). You can override "Bundle::getContainerExtension()" if you want to use "kreait_firebase" or another alias.

Do you know how and where I can override it by any chance ? :)

jeromegamez commented 6 years ago

Yes, this was a bug that I fixed a couple of minutes ago 🙈, please try a composer update to get the latest files :)

youngdreamer33 commented 6 years ago

Thanks but now I got this error:
[Symfony\Component\Config\Definition\Exception\InvalidTypeException] Invalid type for path "kreait_firebase.projects.third". Expected array, but got string ^^ Sorry for the inconvenience !

jeromegamez commented 6 years ago

No problem @youngdreamer33 :). The snippet in the README is just an example to show that you can define multiple projects. Here is a minimal example:

kreait_firebase:
    projects:
        my_project: # <- you can name this whatever you want
            database_uri: 'https://my_project.firebaseio.com'
            api_key: '<api_key>'

You just have to replace the values for database_uri and api_key with the actual values from project.

youngdreamer33 commented 6 years ago

Thanks !! I didn't think it was an issue in config.yml but with your explanation I understand better how the bundle works so thanks a lot for your help !

jeromegamez commented 6 years ago

You're welcome! 🌺