PHPackages                             teamicon/apikit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. teamicon/apikit

ActiveLibrary[API Development](/categories/api)

teamicon/apikit
===============

A simple toolkit to help a team icon's developer to create a native php API

v1.1.4(5y ago)011CC-BY-NC-ND-4.0PHP

Since Jun 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/teamicon/apikit)[ Packagist](https://packagist.org/packages/teamicon/apikit)[ RSS](/packages/teamicon-apikit/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

Team Icon ApiKit v.1.1 stable
=============================

[](#team-icon-apikit-v11-stable)

This library is a simple toolkit to help Team icon's developer to create a native php API.

Installation
------------

[](#installation)

You need to use a [composer](https://getcomposer.org/) installation to add this library on your application. Open a terminal or a command prompt and digit:

```
composer require teamicon/apikit:*
```

after some minutes it should appear a vendor folder and a composer.json file in the root.

Usage
-----

[](#usage)

In the application you'll need to write as first line of your script:

```
require_once(__DIR__ . "/your-path/vendor/autoload.php");
use \teamicon\apikit\className;
$foo = new className();
...
```

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.

```
require_once(__DIR__ . "/../vendor/autoload.php");
```

The body of the index
---------------------

[](#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.

```
require_once(__DIR__. "/vendor/autoload.php");
use \teamicon\apikit\{list of classes that you will use separated by comma}
...
//header for CORS calls
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: POST, GET, PATCH, DELETE, OPTIONS");
header("Access-Control-Max-Age: 100");
//header('Access-Control-Allow-Credentials: true');
header("Access-Control-Allow-Headers: X-SC, X-LNG, AccountKey,x-requested-with, Content-Type, origin, authorization, accept, client-security-token, host, date, cookie, cookie2");
header("Content-Type: application/json");
//preflight test
if ($_SERVER['REQUEST_METHOD'] != 'OPTIONS') echo RouteManager::Start( 'route');
function route(string $sc, string $url, string $lng, RouteParameters $rp) {
    //put here your logic
}
```

List of classes in the apikit
-----------------------------

[](#list-of-classes-in-the-apikit)

### ApiKitException

[](#apikitexception)

This class is inherit from Exception and it will use to identify internal exception.

### ApiResult

[](#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

[](#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

[](#logger)

It's use to log some activities and error in the specific file.

### RouteManager

[](#routemanager)

It's the core of the apikit and we had discussed before about you can use it.

### RouteParameters

[](#routeparameters)

It's an internal class to exchange info about routing. You can receive info about:

```
public function GetSC() : string { return $this->sc; }
public function GetLanguage() : string { return $this->lng; }
public function GetMethod() : string { return $this->method; }
public function GetEntity() : string { return $this->entity; }
public function GetAction() : string { return $this->action; }
public function GetKeys() : array { return $this->keys; }
```

### Utility

[](#utility)

It contains some tips to simplyfy the life of the developer. The list of funcitions is:

```
public static function Curl(string $url, string $method, bool $forceHeaders = false, array $headers = [], array $params = []) : array
public static function GenerateRandomToken(int $numOfChar) : string
public static function GetClientIp() : string
public  static function GetClientLanguage() : string
```

License
-------

[](#license)

[Creative Commons Attribution Non Commercial No Derivatives 4.0 International CC-BY-NC-ND-4.0](https://spdx.org/licenses/CC-BY-NC-ND-4.0.html)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~0 days

Total

6

Last Release

2121d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b3f66ec5a5b9b7749fc49603e18ef3efac7a22a4cf6407f5b41e351f34ca674?d=identicon)[teamicon](/maintainers/teamicon)

### Embed Badge

![Health badge](/badges/teamicon-apikit/health.svg)

```
[![Health](https://phpackages.com/badges/teamicon-apikit/health.svg)](https://phpackages.com/packages/teamicon-apikit)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
