Chapter 5.  Creating a RESTful Web Service

The goal of this chapter is to implement a RESTful Web Service that can be used to manage user profiles. Each user will have some basic contact information (such as a username, a given name, and a family name), a password for authentication, and a profile image.

This service will be implemented using the Slim micro framework, a small and lightweight framework that is available as an open-source library (MIT licensed) for PHP 5.5 and newer (we'll be using PHP 7, of course). For persistence, a MongoDB database will be used. This offers the perfect chance to explore PHP's MongoDB extension, which replaces the old (similarly named, but completely different) Mongo extension that was removed with PHP 7.

In this ...

Get PHP 7 Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.