building apis with apigilty and zend framework 2
TRANSCRIPT
Welcome to
php[world] 2015Wifi:SSID: Sheraton_Conferenceuser: php2015pass: sheraton
Twitter:
#phpworld Rate talks on joind.inhttps://joind.in/event/phpworld2015
Building APIs with Apigility and ZF2
Building APIs with Apigility and ZF2
PHP [World]
David Stockton
Who Am I?• David Stockton
• VP of Technology, i3logix (Denver, CO)
• Developing PHP for ~17 years
• @dstockto
• http://davidstockton.com
• http://tddftw.com
Built with Apigility
• USB Drives contain Apigility skeleton and sqlite database
• Copy the apigility zip or tgz and db to your computer. You need PHP 5.4.8 or greater on your computer or a VM.
• Pass the drives on to the next person when copying is done
• Please return them to me when everyone has a copy
Other Software• REST tester
• DHC in chrome
• POSTman
• Advanced Rest Client
• PAW
• Httpie
• Curl
Why build APIs?
Why not build APIs?
Content Negotiation
HTTP Method Negotiation
Versioning
Validation
Authentication
Authorization
Documentation
Discovery
What can we do?
Apigility is opinionated
Content NegotiationJSON / JSON+HAL
HTTP Method Negotiation
GET, POST, PUT, PATCH, DELETE, OPTIONS
Versioning *supported*
Validation *supported*
Authentication *supported*
Authorization *supported*
Documentation *supported*
Discovery HATEOAS via HAL
H - HypermediaA - AsT - The E - EngineO - OfA - ApplicationS - State
HAL - Hypermedia Application Language
{ "_links": { "self": { "href": "http://phpcoder.ninja/api/user/dstockto" } } "id": "dstockto", "name": "David Stockton" }
Let’s get started!
php -S 0.0.0.0:8181 -t public/ public/index.php
Please rate this tutorial: https://joind.in/14821