PHP Classes

PHP API Server Builder: Build a REST server API from custom classes

Recommend this page to a friend!
  Info   View files Example   View files View files (30)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 35%Total: 964 All time: 3,745 This week: 206Up
Version License PHP version Categories
api-builder 1.0.1GNU General Publi...5.0PHP 5, Web services
Description 

Author

This package can build a REST server API from custom classes.

It can register classes that will handle API calls under given server URI.

The main class can handle the requests to the API server and call the respective handler classes.

Optionally a custom class can validate the key value that clients may be required to pass as authorized clients to access the API.

Picture of Rodolfo Pereira Romano
Name: Rodolfo Pereira Romano <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 41
All time rank: 2413165 in Brazil Brazil
Week rank: 360 Up30 in Brazil Brazil Up

Recommendations

Access MySQL database from RESTful Web Service
I need to return data from a MySQL database using REST

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

Call a function with a socket connection
How to call a PHP function using a socket connection

What is the best PHP rest server class?
Develop Web service to work with Windows and Web and mobile App

Restful Web service
I need web services for Registration, Login, Forgot password

Example

<?php
   
/*
       Exemple of REST API for generate random number
    */
   
class SampleKeyValidator extends ApiKeyValidatorBase {
        function
isValid($key) {
           
/* Validade here using MySQL, etc... */
           
return ($key == "75f42660c4109c3dc81101d3a45fa174");
        }
    }

   
registerClass("Test_v1", "1");
   
/*
       This class is Public (extends ApiCommandBase), don´t need Key for acess
    */
   
class Test_v1 extends ApiCommandBase {
        function
_getURIName() {
            return
"random";
        }

        function
getNumber() {
            return
rand(0,100);
        }
    }

   
registerClass("Test_v2", "2");
   
/**
     * TESTE This is a doc_comment.
     * (see doc.php for view API Doc)
     */
   
class Test_v2 extends Test_v1 {
        function
getNumber() {
            return
rand(101,1000);
        }

       
/**
         * (en) Return number between <i>min</i> and <i>max</i>
         * (pt-br) Retorna um número entre <i>min</i> e <i>max</i>
         */
       
function getNumberRange($min = 0, $max = 100) {
            return
rand($min,$max);
        }
    }

   
registerClass("Test_v3", "2");
   
/*
        This class is Private (extends ApiComamndKeyed), need Key for acess
    */
   
class Test_v3 extends ApiComamndKeyed {
        function
getSecureString() {
            return
"string protected by Key";
        }

        function
_getURIName() {
            return
"text";
        }
    }
?>


Details

APIBuilder - PHP REST API Builder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This framework make easy the developmente of an REST Api for others developers can acsses information on your system. Este framework torna fácil o desenvolvimento de uma REST API para que outros desenvolvedores podssam acessar informações de seus sistema. This package can build a REST server API from custom classes. It can register classes that will handle API calls under given server URI. The main class can handle the requests to the API server and call the respective handler classes. Optionally a custom class can validate the key value that clients may be required to pass as authorized clients to access the API. Ajuda/HELP ~~~~~~~~~~ Any Help is welcome! Toda Ajuda é bem vinda! O que é REST API (REpresentational State Transfer (REST)) ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sobre REST http://pt.wikipedia.org/wiki/REST Primerios Passos / First Steps ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - includes: include('apibuilder/core/ApiApp.php'); include('apibuilder/language/pt-br.php'); include('apibuilder/formats/all_formats.php'); - Criar uma classe que extende de ApiCommandBase - Implementar _getURIName() - Implmentar os métodos públicos que estarão disponíveis para o usuário - Registrar a nova classe usando: registerClass() - Instanciar APIApp - Parametrizar - executar run()

  Files folder image Files  
File Role Description
Files folder imageapibuilder (5 directories)
Accessible without login Plain text file doc.php Example Example script
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file readme.txt Doc. Documentation
Accessible without login Plain text file sampleclass.php Example Example script
Accessible without login Plain text file _.htaccess Data Auxiliary data

  Files folder image Files  /  apibuilder  
File Role Description
Files folder imageapidoc (2 files)
Files folder imageclients (2 files, 2 directories)
Files folder imagecore (6 files)
Files folder imageformats (4 files)
Files folder imagelanguage (2 files)

  Files folder image Files  /  apibuilder  /  apidoc  
File Role Description
  Plain text file ApiDoc.php Class Class source
  Accessible without login Plain text file doc.template.php Aux. Class source

  Files folder image Files  /  apibuilder  /  clients  
File Role Description
Files folder imagejsmin-php-master (2 files, 1 directory)
Files folder imagetest (3 files)
  Plain text file jQueryClientBuilder.php Class Class source
  Plain text file jsClientBuilder.php Class Class source

  Files folder image Files  /  apibuilder  /  clients  /  jsmin-php-master  
File Role Description
Files folder imagetest (4 files)
  Accessible without login Plain text file jsmin.php Aux. Auxiliary script
  Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  apibuilder  /  clients  /  jsmin-php-master  /  test  
File Role Description
  Accessible without login Plain text file .gitignore Data Auxiliary data
  Accessible without login Plain text file setup.php Aux. Auxiliary script
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file utf8-with-bom.js Data Auxiliary data

  Files folder image Files  /  apibuilder  /  clients  /  test  
File Role Description
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login Plain text file lib.js Data Auxiliary data
  Accessible without login Plain text file lib.min.js Data Auxiliary data

  Files folder image Files  /  apibuilder  /  core  
File Role Description
  Plain text file ApiApp.php Class Class source
  Plain text file ApiClientBuilder.php Class Class source
  Plain text file ApiCommandBase.php Class Class source
  Plain text file ApiFormatResult.php Class Class source
  Plain text file ApiKeyValidatorBase.php Class Class source
  Plain text file uri.php Class Class source

  Files folder image Files  /  apibuilder  /  formats  
File Role Description
  Plain text file all_formats.php Class Class source
  Plain text file json.php Class Class source
  Plain text file php_serialize.php Class Class source
  Plain text file var_export.php Class Class source

  Files folder image Files  /  apibuilder  /  language  
File Role Description
  Accessible without login Plain text file en.php Aux. Auxiliary script
  Accessible without login Plain text file pt-br.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:964
This week:0
All time:3,745
This week:206Up
 User Ratings  
 
 All time
Utility:41%StarStarStar
Consistency:58%StarStarStar
Documentation:41%StarStarStar
Examples:41%StarStarStar
Tests:-
Videos:-
Overall:35%StarStar
Rank:4094