Download the PHP package teamicon/apikit without Composer
On this page you can find all versions of the php package teamicon/apikit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download teamicon/apikit
More information about teamicon/apikit
Files in teamicon/apikit
Package apikit
Short Description A simple toolkit to help a team icon's developer to create a native php API
License CC-BY-NC-ND-4.0
Informations about the package apikit
Team Icon ApiKit v.1.1 stable
This library is a simple toolkit to help Team icon's developer to create a native php API.
Installation
You need to use a composer installation to add this library on your application. Open a terminal or a command prompt and digit:
after some minutes it should appear a vendor folder and a composer.json file in the root.
Usage
In the application you'll need to write as first line of your script:
the your-path token is the right path where the folder vendor is located. For instance if your script is put in the sources folder in the root, your path becomes ../ because you need to browse back.
The body of the index
Creating an API application is simple but required some features for working well. In the body we need to put the references of the scripts which will use in the application, after we'll put the headers required and finally we can use the apikit to manage fast all route rules.
List of classes in the apikit
ApiKitException
This class is inherit from Exception and it will use to identify internal exception.
ApiResult
It's used to create a standard response. You can use the static function OK to return the right message with the associative payload array or you can use the KO function to advise about the presence of errors in the call.
DbManager
This class helps user to use the database with a set of fuction pre built. You must be create an instance of the class with all parameters to connect to db. After this operation you might use Query or Execute functions to extract dataset in an associative array or receive the number of rows edited. The parameters for these functions are similar: a query statement, a list of params type and the parameters as an associative array.
Logger
It's use to log some activities and error in the specific file.
RouteManager
It's the core of the apikit and we had discussed before about you can use it.
RouteParameters
It's an internal class to exchange info about routing. You can receive info about:
Utility
It contains some tips to simplyfy the life of the developer. The list of funcitions is:
License
Creative Commons Attribution Non Commercial No Derivatives 4.0 International CC-BY-NC-ND-4.0
All versions of apikit with dependencies
ext-json Version *
ext-mysqli Version *