2017 © Pedro Peláez
 

library tiny-rest-router

Tiny RESTful router

image

ashwoodslightfoot/tiny-rest-router

Tiny RESTful router

  • Wednesday, April 4, 2018
  • by AshwoodsLightfoot
  • Repository
  • 7 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Tiny Rest Router

tiny-rest-router is a simple library for PHP 5.6+., (*1)

Features, (*2)

  • Readable HTTP Method Support (GET, PUT, POST, DELETE, HEAD, PATCH and OPTIONS)
  • Automatic Parsing
  • Automatic Classes and SubClasses usage

Installation

Composer

tiny-rest-router is PSR-0 compliant and can be installed using composer.
Simply add ashwoodslightfoot/tiny-rest-router to your composer.json file., (*3)

{
    "require": {
        "ashwoodslightfoot/tiny-rest-router": "*"
    }
}

or use a console command: composer require "ashwoodslightfoot/tiny-rest-router:*" in your site root folder., (*4)

How to configure http server

Add a rest folder to your project root folder. Example: /var/www/mysite/rest. Configure your http server to add route for rest/index.php., (*5)

Apache

Make a file .htaccess in your rest folder, (*6)

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?path=$1 [NC,L,QSA]

Nginx

Add this part to your site configuration file., (*7)

location /rest {
    rewrite ^/rest(.*)$ $1&$args break;
    try_files $uri $uri/ /rest/index.php?path=$uri&args;
}

How to use

See a simple example YourSiteFolder/vendor/ashwoodslightfoot/tiny-rest-router/examples/rest/index.php, (*8)

See a class hierarchy YourSiteFolder/vendor/ashwoodslightfoot/tiny-rest-router/examples/resources/v1. The folder contains classes for RESTful API v1., (*9)

The Versions

04/04 2018

dev-fix-2018-04-04

dev-fix-2018-04-04

Tiny RESTful router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

04/04 2018

dev-master

9999999-dev

Tiny RESTful router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

04/04 2018

0.1.5

0.1.5.0

Tiny RESTful router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

20/02 2018

dev-fix-2018-02-20

dev-fix-2018-02-20

Tiny RESTful router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

23/01 2018

0.1.4

0.1.4.0

Tiny RESTful router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

23/01 2018

0.1.3

0.1.3.0

Tiny RESTful router

  Sources   Download

The MIT License (MIT)

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

17/01 2018

0.1.2

0.1.2.0

Tiny RESTful router

  Sources   Download

The MIT License (MIT)

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

17/01 2018

0.1.1

0.1.1.0

Tiny RESTful router

  Sources   Download

The MIT License (MIT)

The Requires

  • php >=5.4.0

 

by Valerii Tsarov

17/01 2018

0.1.0

0.1.0.0

Tiny RESTful router

  Sources   Download

The MIT License (MIT)

The Requires

  • php >=5.4.0

 

by Valerii Tsarov