Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.08 KB

installation.md

File metadata and controls

63 lines (46 loc) · 2.08 KB

Installation

To install the Ivory Google Map bundle, you will need Composer. It's a PHP 5.3+ dependency manager which allows you to declare the dependent libraries your project needs and it will install & autoload them for you.

Set up Composer

Composer comes with a simple phar file. To easily access it from anywhere on your system, you can execute:

$ curl -s https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Download the bundle

Require the library in your composer.json file:

$ composer require egeloen/google-map-bundle

Download additional libraries

If you want to use the Direction, Distance Matrix, Elevation, Geocoder, Place or Time Zone services, you will need an http client and message factory via Httplug which is an http client abstraction library as well as the Ivory Serializer which is an advanced (de)-serialization library.

Httplug and Ivory Serializer provide bundles, so let's install them to ease our life:

$ composer require egeloen/serializer-bundle
$ composer require php-http/guzzle6-adapter
$ composer require php-http/httplug-bundle

Here, I have chosen to use Guzzle6 but since Httplug supports the most popular http clients, you can install your preferred one instead.

Register the bundle

Then, add the bundle in your AppKernel:

// app/AppKernel.php

public function registerBundles()
{
    return [
        // ...
        new Ivory\GoogleMapBundle\IvoryGoogleMapBundle(),
        
        // Optionally
        new Ivory\SerializerBundle\IvorySerializerBundle(),
        new Http\HttplugBundle\HttplugBundle(),
    ];
}