2017 © Pedro Peláez
 

library canvaspest

An extension of Pest to make RESTful queries to the Instructure Canvas API

image

smtech/canvaspest

An extension of Pest to make RESTful queries to the Instructure Canvas API

  • Wednesday, June 14, 2017
  • by battis
  • Repository
  • 4 Watchers
  • 1 Stars
  • 336 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 15 Versions
  • 2 % Grown

The README.md

CanvasPest

Latest Version Scrutinizer Code Quality Code Coverage Build Status, (*1)

Object-oriented access to the Canvas API using PHP., (*2)

Install

In your composer.json, include:, (*3)

"require": {
    "smtech/canvaspest": "1.*"
}

Use

CanvasPest

Create a new CanvasPest to make RESTful queries to the Canvas API:, (*4)

// construct with the API URL and an API access token
$api = new CanvasPest('https://canvas.instructure.com/api/v1', 'df2bcbad95f606d6e80093f8e40c4e5ca171d8c5e4f2138e1d58273e33b262ef')

Make a RESTful query to the API:, (*5)

// GET, PUT, POST, DELETE are all supported
$obj = $api->get('users/self/profile');

The response from a query is either a CanvasObject or a CanvasArray (of CanvasObjects, natch), depending on whether you requested a specific object or a list of objects (even if the list turns out to be a single object)., (*6)

CanvasObjects

CanvasObject fields can be accessed either object-style or array style:, (*7)

$obj = $api->get('courses/123');
echo $obj['sis_course_id']; // array-style
echo $obj->title; // object-style

CanvasArrays

CanvasArrays can be iterated conveniently using the foreach control structure., (*8)

$arr = $api->get('/accounts/1/users');
foreach($arr as $obj) {
    echo $obj->name;
}

One could also access arbitrary elements of the CanvasArray:, (*9)

$arr = $api->get('accounts/1/courses');
echo $arr[1337]->title;

Note that both CanvasObjects and CanvasArrays are immutable objects -- that is, they are treated as read-only. In fact, if you attempt to alter a CanvasObject or a CanvasArray, exceptions will be thrown., (*10)

Full API documentation is available in the repository., (*11)

The Versions

14/06 2017

dev-master

9999999-dev

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Seth Battis

14/06 2017

dev-develop

dev-develop

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Seth Battis

14/06 2017

v1.1.9

1.1.9.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Seth Battis

31/05 2017

v1.1.8

1.1.8.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

24/05 2017

v1.1.7

1.1.7.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

04/04 2017

v1.1.6

1.1.6.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

05/08 2016

v1.1.5

1.1.5.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

25/07 2016

v1.1.4

1.1.4.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

23/03 2016

v1.1.3

1.1.3.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

16/03 2016

v1.1.2

1.1.2.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

15/02 2016

v1.1.1

1.1.1.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

22/08 2015

v1.1

1.1.0.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

17/08 2015

v1.0.1

1.0.1.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

31/07 2015

v1.0

1.0.0.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

30/06 2015

v0.9

0.9.0.0

An extension of Pest to make RESTful queries to the Instructure Canvas API

  Sources   Download

The Requires

 

by Seth Battis