Download the PHP package davidfricker/restapi without Composer

On this page you can find all versions of the php package davidfricker/restapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package restapi

Simple OOP MVC PHP REST API Framework

That's a lot of acronyms.

NB: This is a draft document

There is nothing especially ground breaking about this API Framework. It was born from my second year computer science project and has evolved and been re-thought into what you see before you today.

It's key selling point is how lightweight and simple to use, extend and understand it is.

How does it work?

Put simply, the framework will route requests to the correct controller and model. It will do this by analysing request URI for the controller name and the request type (be it POST, PUT, GET, etc.). It will then do some sanity checks, before initialising a new controller and model object and calling the correct method on the controller.

How do I add an end point?

You must create a new controller, in the controllers folder. This new controller must extend AbstractController. In addition, you must also create a corresponding model and place it in the models folder. The new model must extend AbstractController.

How do I add resource?

Let us take the example of an API that exposes the account email address for update. We would expect it to be formatted in the following way, PUT /accounts/email. To create this one must first create an accounts controller and model. the controller must then declare a method in the following format public function put_email(){}. inside this method the developer can then access the request object from the controller object itself $this->request->get_parameter('new_address');. Since this endpoint will likely (hopefully) require authentication a call to the member function is_authorised should be performed.

Important info

Included is a .htaccess file. It simply redirects all requests to the index file. if you are not running apache as your webserver you will need to redirect all traffic to /index.php/$1 where $1 is the rest of the URI.


All versions of restapi with dependencies

PHP Build Version
Package Version
Requires php Version ^5.3.3 || ^7.0
davidfricker/cleanjson Version *
davidfricker/dataabstracter Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davidfricker/restapi contains the following files

Loading the files please wait ....