{"id":15026110,"url":"https://github.com/mkgor/chiven","last_synced_at":"2026-02-19T12:02:32.418Z","repository":{"id":57041975,"uuid":"218034816","full_name":"mkgor/chiven","owner":"mkgor","description":"Simple library which allows you to build RESTful API fast, easy and flexible","archived":false,"fork":false,"pushed_at":"2019-12-29T08:28:19.000Z","size":1776,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-17T13:19:11.426Z","etag":null,"topics":["api","api-rest","http","php-library","php72","rest-api"],"latest_commit_sha":null,"homepage":"https://pixaye.github.io/chiven/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkgor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-28T11:50:05.000Z","updated_at":"2019-12-29T08:28:21.000Z","dependencies_parsed_at":"2022-08-23T23:40:19.463Z","dependency_job_id":null,"html_url":"https://github.com/mkgor/chiven","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mkgor/chiven","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fchiven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fchiven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fchiven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fchiven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkgor","download_url":"https://codeload.github.com/mkgor/chiven/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkgor%2Fchiven/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29612510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-rest","http","php-library","php72","rest-api"],"created_at":"2024-09-24T20:03:48.714Z","updated_at":"2026-02-19T12:02:32.394Z","avatar_url":"https://github.com/mkgor.png","language":"PHP","readme":"# Chiven\n\n![codecov](https://img.shields.io/badge/coverage-98%25-green)\n![GitHub](https://img.shields.io/github/license/pixaye/chiven)\n![GitHub repo size](https://img.shields.io/github/repo-size/pixaye/chiven)\n![PHP from Packagist](https://img.shields.io/packagist/php-v/pixaye/chiven)\n![Packagist](https://img.shields.io/packagist/dm/pixaye/chiven)\n\n![Logo](https://i.imgur.com/CXJyyDj.jpg)\n\nSimple library which allows you to build RESTful API fast, easy and flexible\n\n# Installation\nInstall it via composer  \n```composer require pixaye/chiven```\n\n# Usage\nFor 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)\n\nInitializating from globals\n```php\n$request = new \\Chiven\\Http\\Request();\n$request-\u003efromGlobals();\n```\n\nInitializating from custom variables\n```php\n$request = new \\Chiven\\Http\\Request();\n\n$files = array(\n  'file' =\u003e array (\n    'tmp_name' =\u003e '/tmp/df23fr32,\n    'name' =\u003e 'file.jpg',\n    'type' =\u003e 'image/jpeg',\n    'size' =\u003e 335057,\n    'error' =\u003e 0,\n  )\n);\n        \n$headers = array(\n  'X-Test-Header: 1',\n  'X-Test-Header: 2',\n);\n\n$get = array(\n  'key' =\u003e 'value'\n);\n\n$post = array(\n  'key' =\u003e 'value'\n);\n\n$request-\u003einitialize($files, $get, $post, $headers)\n```\n\nChiven 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**\n\nYou can get them by calling **$request-\u003egetFiles()** and **$request-\u003egetHeaders()**\n\n```php\n$filesRepository = $request-\u003egetFiles();\n\n$testFile = $filesRepository-\u003efindBy('name', 'test');\n```\n\n```php\n$headersRepository = $request-\u003egetHeaders();\n\n$testHeader = $filesRepository-\u003efindBy('name', 'X-Test-Header');\n```\n\nBoth repositories have methods:\n* findBy(**$criteria**, **$value**)\n* findLast()\n* findFirst()\n* findAll()\n* insert(*Insertable* **$object**)\n* remove(**$criteria**, **$value**)\n* set(*array* **$objects**)\n\nTo 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.\n\n```php\n$request = new \\Chiven\\Http\\Request();\n$request-\u003efromGlobals();\n\n(new \\Chiven\\Bootstrap())-\u003esetFormat(new \\Chiven\\Format\\Json());\n\n\n//Request handling...\n\n//Chiven response which returned by any script/controller/etc...\n$response = new \\Chiven\\Http\\Response\\Response();\n\necho $chiven-\u003egetFormat()-\u003eresponseDecorator($response);\n```\n\nThis is how Chiven works, you can use example above and start creating your API with Chiven.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkgor%2Fchiven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkgor%2Fchiven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkgor%2Fchiven/lists"}