2017 © Pedro PelĂĄez
 

library parsecom-manager

Manage API queries to Parse.com cloud service.

image

sly/parsecom-manager

Manage API queries to Parse.com cloud service.

  • Monday, December 3, 2012
  • by Ph3nol
  • Repository
  • 2 Watchers
  • 1 Stars
  • 234 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ParseComManager

Manage API queries to Parse.com cloud service., (*1)

Continuous Integration status, (*2)

Requirements

  • PHP 5.3+
  • PHP Curl extension

Installation

Add to your project Composer packages

Just add sly/parsecom-manager package to the requirements of your Composer JSON configuration file, and run php composer.phar install to install it., (*3)

Install from GitHub

Clone this library from Git with git clone https://github.com/Ph3nol/ParseComManager.git., (*4)

Goto to the library directory, get Composer phar package and install vendors:, (*5)

curl -s https://getcomposer.org/installer | php
php composer.phar install

You're ready to go., (*6)

Usage

``` php <?php, (*7)

require_once '/path/to/vendor/autoload.php';, (*8)

use Sly\ParseComManager\Manager\Manager; use Sly\ParseComManager\Query\Query;, (*9)

/** * Initialize the manager with your application ID and REST API key. */ $manager = new Manager(array( 'appID' => 'XXXXX', 'masterKey' => 'XXXXX', 'apiKey' => 'XXXXX', 'sessionToken' => null, // Optional session token ));, (*10)

/** * Initialize the query with 'login' API part parameters. * * Some API parameters are defined into the library: * Resources/config/api.yml * * You can add yours or overload base ones with declaring * your YAML file path as second argument: * $query = new Query('login', '/path/to/your/api.yml'); */ $query = new Query('login');, (*11)

/** * Add some properties, required by Parse.com REST API. */ $query->addProperties(array( 'username' => 'Chuck', 'password' => 'n0rr1s', ));, (*12)

// or/and $query->addProperty('specificProperty', 'propertyValue');, (*13)

/** * Get API JSON response. * * You can use 'client' second argument to get the client response. * Example: $clientResponse = $manager->execute($query, 'client'); */ $userFromApi = $manager->execute($query);, (*14)


## YAML API config file You can use your own YAML API config file. Here is an example: ``` yaml signup: method: post url: /login login: method: get url: /login retrieveUser: method: get url: /users/%userKey% # ...

Be careful: URLs are relative ones. Base one is declared as Sly\ParseComManager\Query\Query::API_BASE_URL constant., (*15)

You can use keys into a URL, like retrieveUser '%userKey%' case. Just set a 'userKey' property to your query, as usual, it will be replaced in your URL., (*16)

Test with Atoum

This library is using Atoum for unit testing, whose Composer package can be installed with dev mode:, (*17)

php composer install --dev
./atoum -d tests/units

The Versions

03/12 2012

dev-master

9999999-dev

Manage API queries to Parse.com cloud service.

  Sources   Download

The Requires

 

The Development Requires

by Cédric Dugat

03/12 2012

v0.1

0.1.0.0

Manage API queries to Parse.com cloud service.

  Sources   Download

The Requires

 

The Development Requires

by Cédric Dugat