alkurn/yii2-firebase

Yii2 helper for creating and upload file or files

Installs: 355

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Type:yii2-extension

dev-master 2019-01-17 06:25 UTC

This package is not auto-updated.

Last update: 2024-04-05 17:43:05 UTC


README

Yii2 helper for creating firebase connection on real time.

Installation

The preferred way to install this extension is through composer.

  • Either run
php composer.phar require --prefer-dist alkurn/yii2-firebase "dev-master"

or add

"alkurn/yii2-firebase":"dev-master"

to the require section of your application's composer.json file.

  • Add a new component in components section of your application's configuration file (optional), for example:
'components' => [
    'firebase' => [
            'class' => 'alkurn\firebase\Firebase',
            'credential_file' => 'uploads/firebase-credential.json',
            'database_uri' => 'https://firebase-db.firebaseio.com', // (optional)
        ], 
],

and in bootstrap section, for example:

'bootstrap' => ['log','firebase'],

It is necessary if you want to set global helper's settings for the application.

Usage

For example:

$db = Yii::$app->firebase->getDatabase();