PHP wrapper for google places API (https://developers.google.com/places/documentation/)
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
GooglePlacesApiTest.php
NotImplementedException.php
README.md
Utils.php
composer.json
configuration.php
googleplaces.class.php
index.php

README.md

PHP Wrapper for Google Place API

About

A PHP wrapper for the Google Place API

Requirements

  • PHP 5.3.2 or higher
  • cURL
  • phpunit
  • API KEY for Google Place API

Get started

Register your application with your google account and create an application. And then create an API Key using Create new Browser Key options.

And set the API KEY to the configuration.php

Initialize the class

<?php
    require_once 'googleplaces.class.php';
    
    $googlePlaces = new GooglePlaces(array(
      'apiKey'      => 'YOUR_APP_KEY'
    ));
?>

###Installing Depenedencies

If Composer is not installed into the system, install composer first by following this tutorial. And then run the following command:

run composer install

###Run the Test case Navigate terminal to the project directory and simply run following command:

phpunit GooglePlacesApiTest.php 

###Example Calls

http://localhost/ag-location/index.php?place=Krankenhaus%20in%20Stuttgart

http://localhost/ag-location/index.php?place=Pubs%20in%20Stadtmitte%20Stuttgart