2017 © Pedro Peláez
 

library cartodbclient-php

CartoDB SQL API v2 client for PHP

image

simbiotica/cartodbclient-php

CartoDB SQL API v2 client for PHP

  • Thursday, May 1, 2014
  • by tiagojsag
  • Repository
  • 10 Watchers
  • 6 Stars
  • 2,992 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

CartoDB SQL API v2 Client for PHP by Simbiotica

About

A easy to use PHP client for CartoDB's SQL API v2, using OAuth or API key authentication., (*1)

Installation

There are two versions of the library: OAuth or API Key. When installing, you have to choose which to use., (*2)

This library requires composer, a package manager for PHP. To use the OAuth version, add the following to your composer.json:, (*3)

{
    "require": {
        "simbiotica/cartodbclient-php": "dev-master"
    }
}

Or, if you prefer the API key version, use the following:, (*4)

{
    "require": {
        "simbiotica/cartodbclient-php": "dev-api-key"
    }
}

After, install it using the command:, (*5)

bash $ php composer.phar update simbiotica/cartodbclient-php, (*6)

This will install not only this library, but the required dependencies., (*7)

Usage - OAuth

Currently two types of connections are supported: PrivateConnection and PublicConnection. Public connections are a subset of Private ones, as they can be established to any public table, with reduced privileges and configuration requirements, (*8)

Additionally, TokenStorageInterface implementation is required to presist the OAuth Token across requests. We provide SessionStorage and FileStorage, but feel free to implement your own., (*9)

For reference, check the Connection class, where you'll find all the handy functions you'll need. There's also a runSql() function for everything that's not covered by existing functions., (*10)

All reponses are wrapped as a Payload object, which holds the formated answer, request metadata and a couple of utilities to handle the result., (*11)

No actual demo is provided, but you can view a sort-of-example inside the /tests folder. Remember to fill in your data before trying it., (*12)

Usage - API Key

Usage with just API key is less secure, but equaly functional and easier to setup., (*13)

All connections are supported by the Connection class, which accepts your domain and, optionally, you API key. If you don't provide it, you will have limited access to the tables., (*14)

For reference, check the Connection class, where you'll find all the handy functions you'll need. There's also a runSql() function for everything that's not covered by existing functions., (*15)

All reponses are wrapped as a Payload object, which holds the formated answer, request metadata and a couple of utilities to handle the result., (*16)

No actual demo is provided, but you can view a sort-of-example inside the /tests folder. Remember to fill in your data before trying it., (*17)

The Versions

01/05 2014

dev-master

9999999-dev https://github.com/simbiotica/cartoDBclient-PHP

CartoDB SQL API v2 client for PHP

  Sources   Download

MIT

The Requires

 

cartodb

04/04 2013

1.0.0-beta

1.0.0.0-beta https://github.com/simbiotica/cartoDBclient-PHP

CartoDB SQL API v2 client for PHP

  Sources   Download

MIT

The Requires

 

cartodb

04/04 2013

dev-api-key

dev-api-key https://github.com/simbiotica/cartoDBclient-PHP

CartoDB SQL API v2 client for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

cartodb