PHP Classes
elePHPant
Icontem

PHP API Server: Route requests to API calls to handler classes

Recommend this page to a friend!
  Info   View files Example   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2015-01-23 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 518 All time: 5,484 This week: 710Up
Version License PHP version Categories
php-api-server 1.0GNU General Publi...5.4PHP 5, Web services
Description Author

This class can route requests to API calls to handler classes.

It takes as parameters the name of an API call being invoked by a client via HTTP and an array of request parameters.

If the called API function is named Describe, the router class loads a class named Describe from the API directory path and makes the request be handled by that class.

For other API calls, the name of the call up to the / character defines the class that will handle the API call.

The name in front of the first / character defines the API call function name that is invoked on the API call handler class.

The router class checks first if a class file exists with that class name and loads it in that case. The router class also checks if the handler class also has a function with the invoked name before calling that handler class function.

API call error responses are returned in JSON encoded format.

Recommendations

What is the best PHP request routing class?
I want to route my PHP HTML templates for easy navigation

What is the best PHP api creation class?
i need to create api to be executed in multiple devices

  Performance   Level  
Name: Ettore Moretti <contact>
Classes: 11 packages by
Country: Italy Italy
Innovation award
Innovation award
Nominee: 3x

Details
For more information go to:

http://localhost/phpapiserver/ExampleUse
  Files folder image Files  
File Role Description
Files folder imagecore (1 file, 1 directory)
Files folder imagedb (1 file)
Files folder imageimg (2 files)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file config.php Conf. Class source
Accessible without login Plain text file index.php Example Class source
Accessible without login Plain text file README.txt Data Documentation

  Files folder image Files  /  core  
File Role Description
Files folder imageapi (4 files)
  Plain text file router.php Class Class source

  Files folder image Files  /  core  /  api  
File Role Description
  Plain text file API.php Class Class source
  Plain text file Describe.php Class Class source
  Accessible without login Plain text file Exampleuse.php Aux. Class source
  Plain text file User.php Class Class source

  Files folder image Files  /  db  
File Role Description
  Plain text file database.php Class Class source

  Files folder image Files  /  img  
File Role Description
  Accessible without login Image file flag-it.gif Icon Icon image
  Accessible without login Image file icon_flag_us_en.gif Icon Icon image

 Version Control Unique User Downloads Download Rankings  
 100%
Total:518
This week:0
All time:5,484
This week:710Up