2017 © Pedro Peláez
 

library relax

A library for consuming simple REST services in PHP5.

image

99designs/relax

A library for consuming simple REST services in PHP5.

  • Saturday, July 11, 2015
  • by lox
  • Repository
  • 44 Watchers
  • 3 Stars
  • 40,057 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

Relax - Easy interaction with RESTful APIs

Relax is a client designed to interact with APIs that conform to the following:, (*1)

  • Return JSON
  • Respond to GET, PUT AND POST
  • Urls map to the pattern of /collection/123/subcollection/234

Relax also provides a set of Openssl helper classes., (*2)

<?php


$client = new \Ergo\Http\Client("http://mywebservice.io");

$model = new Relax_Client_Model($client);
$model
  ->hasMany(
      $model->define('Transaction')
        ->hasMany('PaymentDevice')
        ->hasMany('PaymentIntention')
        ->hasMany('TransactionItem','items','item')
      )
  ->hasMany(
      $model->define('Customer')
        ->hasOne('Address')
      )
;


// GET queries
$items = $model->transactions(1)->items(); // returns a collection from /transactions/1/items
$address = $model->customers(1)->address(); // returns a resource from /customers/1/address

print $address->streetname; // returns the streetname property from the json doc
print $items->count(); // returns the number of items in the transaction

// PUT queries
$model->customers()->create(array('i'=>'x'));

// POST queries
$model->customers(1)->set('name','Fred')->save();

Copyright (c) 2012 99designs See LICENSE for details., (*3)

The Versions

11/07 2015

dev-master

9999999-dev

A library for consuming simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/11 2014

2.0.0

2.0.0.0

A library for consuming simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/11 2014

dev-use-ergo-http

dev-use-ergo-http

A library for consuming simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

The Development Requires

04/01 2013

v1.1.2

1.1.2.0

A library for consuming simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

The Development Requires

04/01 2013

v1.1.1

1.1.1.0

A library for building simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

The Development Requires

04/01 2013

v1.1.0

1.1.0.0

A library for building simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/01 2013

v1.0.1

1.0.1.0

A library for building simple REST services in PHP5.

  Sources   Download

MIT

The Requires

 

17/12 2012

v1.0.0

1.0.0.0

A library for building simple REST services in PHP5.

  Sources   Download

The Requires

  • php >=5.3