Skip to content

Commit

Permalink
Add configuration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Jul 17, 2016
1 parent 20242c6 commit 90c3768
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#############
Configuration
#############

.. code-block:: php
use Kreait\Firebase\Configuration;
use Kreait\Firebase\Firebase;
$config = new Configuration();
$firebase = new Firebase('https://my-app.firebaseio.com', $config);
*******
Logging
*******

Any `PSR-3 compliant logger <https://packagist.org/providers/psr/log-implementation>`_
can be used for logging. The following example uses
`Monolog <https://github.com/Seldaek/monolog>`_:

.. code-block:: php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$logger = new Logger('firebase-php');
$logger->pushHandler(new StreamHandler('path/to/your.log', Logger::DEBUG));
$config->setLogger($logger);
*******************
Custom HTTP Adapter
*******************

By default, the library tries to find an already existing instance of an
HTTP adapter, and if none is found, it will create a new one. You can
override the used HTTP adapter by setting it in the configuration like this:

.. code-block:: php
use Ivory\HttpAdapter\FopenHttpAdapter;
$http = new FopenHttpAdapter(); // or any other available adapter
$config->setHttpAdapter($http);
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ User Guide
authentication
retrieving-data
writing-data
configuration
about

0 comments on commit 90c3768

Please sign in to comment.