Download the PHP package maxcarter/restup without Composer
On this page you can find all versions of the php package maxcarter/restup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maxcarter/restup
More information about maxcarter/restup
Files in maxcarter/restup
Package restup
Short Description A customizable Representational State Transfer (REST) Application Program Interface (API) designed to provide a quick set of tools for developers to quickly build their own API.
License
Informations about the package restup
REST-UP
A customizable Representational State Transfer (REST) Application Program Interface (API) designed to provide a quick set of tools for developers to quickly build their own API.
Note: this repository is currently under construction.
Features
- Supports basic CRUD (Create Read Update Delete) operations
- Supports HTTP requests GET POST PUT and DELETE
- Can interact with anything that can send an HTTP request
- Data is returned in JSON (JavaScript Object Notation) format
- MySQL database preset
- Protection against MySQL injection
- Interfacing with new tables is as simple as adding new models
- Customizable controllers to interface with other databases
Installation
REST-UP can be installed using composer:
OR by simply extracting all files to the desired location in your website directory:
Test
Once installed you should be able to see the welcome text at: http://YourDomain.com/PathToAPI
Another way to test the API is to install the Chrome Extension Postman then open the app and send http requests to http://YourDomain.com/PathToAPI
.
Server Requirements
- PHP v5.6+
- MySQL v5.6+
MySQL Schema
The sample code is based on the following MySQL table:
To insert sample data into this database:
Configuration
To configure this REST-API to work with your database follow these steps:
- Modify
config.php
with the appropriate credentials. - Create your own DTO (Data Transfer Object) and place it in the
models
directory. (see models/person.php for a sample DTO)
Customize
This REST API can be customized to work with different databases. The default preset is MySQL, however, you can create your own database controller to interface with different databases and implement custom functionality.
To create a custom controller follow these steps:
- Create a new PHP file to implement the Controller class (see controllers/mysql.php for an example)
- Ensure your class implements the required CRUD functions.
- Modify config.php to include your controller's file name and database credentials.
Required Functions
Future Updates
- Live Demo
- HTTP request documentation
- More database presets