Skip to content

ibexcore/PHP-API-Template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why

This library was created to help assist developers in writing api libraries that interact with open government api keys.

Usage

include('APIBaseClass.php');
include('my_API_lib.php');

new my_API_lib('http://myurl.com');
    // or
    new my_API_lib();

How to Write your API Classes

  • Your class must be the same name as your php file

  • Your class must extend APIBaseClass

    class my_API_lib extends APIBaseClass{...

  • Your class must have a construct method that looks something like this:

    public function __construct($url) { self::new_request('http://myurl.com'); }

  • Methods are

    • get
    • post
    • put
    • delete

Use them in your api library class where needed

Run Tests

Tests are utilizing SimpleTest for testing. To run tests:

  1. Go to ./testing/ in the browser.

About

PHP Base Class for API libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.7%
  • CSS 0.3%