PHPackages                             pixaye/chiven - 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. pixaye/chiven

ActiveLibrary[API Development](/categories/api)

pixaye/chiven
=============

Simple library which allows you to build RESTful API fast, easy and flexible

00PHPCI failing

Since Nov 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/pixaye/chiven)[ Packagist](https://packagist.org/packages/pixaye/chiven)[ RSS](/packages/pixaye-chiven/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Chiven
======

[](#chiven)

[![codecov](https://camo.githubusercontent.com/bc1d69b90a73ba8af00698e14b0ee0822b299e16335f5c125b5fc6dbc00bb105/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d39382532352d677265656e)](https://camo.githubusercontent.com/bc1d69b90a73ba8af00698e14b0ee0822b299e16335f5c125b5fc6dbc00bb105/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d39382532352d677265656e)[![GitHub](https://camo.githubusercontent.com/545b87d81a3f9f44f31231b6bccd222619ad5a685686823e907e125e706610dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7069786179652f63686976656e)](https://camo.githubusercontent.com/545b87d81a3f9f44f31231b6bccd222619ad5a685686823e907e125e706610dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7069786179652f63686976656e)[![GitHub repo size](https://camo.githubusercontent.com/f5dca75ea5fb19b0d10577c14024368632c70758e56aa6dce9d9196104f6f2dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f7069786179652f63686976656e)](https://camo.githubusercontent.com/f5dca75ea5fb19b0d10577c14024368632c70758e56aa6dce9d9196104f6f2dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f7069786179652f63686976656e)[![PHP from Packagist](https://camo.githubusercontent.com/227084c613fdef5d3a7b80085bb8fd8ece2e5340003031ae257b340662b302b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7069786179652f63686976656e)](https://camo.githubusercontent.com/227084c613fdef5d3a7b80085bb8fd8ece2e5340003031ae257b340662b302b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7069786179652f63686976656e)[![Packagist](https://camo.githubusercontent.com/846a571048cc8d34d8d85ea0bfd0c4425e9b30791956858f262c781e92a4366f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7069786179652f63686976656e)](https://camo.githubusercontent.com/846a571048cc8d34d8d85ea0bfd0c4425e9b30791956858f262c781e92a4366f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7069786179652f63686976656e)

[![Logo](https://camo.githubusercontent.com/7510ab07e34c5d53f81345ef23529f06d322b2fa6879e03fb64ef2d1bdd5151c/68747470733a2f2f692e696d6775722e636f6d2f43584a7979446a2e6a7067)](https://camo.githubusercontent.com/7510ab07e34c5d53f81345ef23529f06d322b2fa6879e03fb64ef2d1bdd5151c/68747470733a2f2f692e696d6775722e636f6d2f43584a7979446a2e6a7067)

Simple library which allows you to build RESTful API fast, easy and flexible

Installation
============

[](#installation)

Install it via composer
`composer require pixaye/chiven`

Usage
=====

[](#usage)

For start using Chiven`s functionality, you should initialize its Request class as early, as you can (for example, you can init it in index.php)

Initializating from globals

```
$request = new \Chiven\Http\Request();
$request->fromGlobals();
```

Initializating from custom variables

```
$request = new \Chiven\Http\Request();

$files = array(
  'file' => array (
    'tmp_name' => '/tmp/df23fr32,
    'name' => 'file.jpg',
    'type' => 'image/jpeg',
    'size' => 335057,
    'error' => 0,
  )
);

$headers = array(
  'X-Test-Header: 1',
  'X-Test-Header: 2',
);

$get = array(
  'key' => 'value'
);

$post = array(
  'key' => 'value'
);

$request->initialize($files, $get, $post, $headers)
```

Chiven allows you to work with files and headers in object oriented style. It builds objects of them and puts it in repositories: **FileRepostiory** and **HeaderRepository**

You can get them by calling **$request-&gt;getFiles()** and **$request-&gt;getHeaders()**

```
$filesRepository = $request->getFiles();

$testFile = $filesRepository->findBy('name', 'test');
```

```
$headersRepository = $request->getHeaders();

$testHeader = $filesRepository->findBy('name', 'X-Test-Header');
```

Both repositories have methods:

- findBy(**$criteria**, **$value**)
- findLast()
- findFirst()
- findAll()
- insert(*Insertable* **$object**)
- remove(**$criteria**, **$value**)
- set(*array* **$objects**)

To make Chiven process the request correctly and display the result in the desired format, there are **format classes**. At the moment, only JSON format is available to use.

```
$request = new \Chiven\Http\Request();
$request->fromGlobals();

(new \Chiven\Bootstrap())->setFormat(new \Chiven\Format\Json());

//Request handling...

//Chiven response which returned by any script/controller/etc...
$response = new \Chiven\Http\Response\Response();

echo $chiven->getFormat()->responseDecorator($response);
```

This is how Chiven works, you can use example above and start creating your API with Chiven.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ba0bf52dbd8e0208891f33b6802487d5ea52f8a44f8081386566d6408ff450?d=identicon)[pixaye](/maintainers/pixaye)

---

Tags

apiapi-resthttpphp-libraryphp72rest-api

### Embed Badge

![Health badge](/badges/pixaye-chiven/health.svg)

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

###  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)
