PHPackages                             sinri/ark - 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. sinri/ark

ActiveLibrary

sinri/ark
=========

A fundamental toolkit for PHP.

4.0.2(1y ago)81.9k↑1900%2MITPHPPHP ~8.0

Since Feb 14Pushed 1y ago2 watchersCompare

[ Source](https://github.com/sinri/Ark)[ Packagist](https://packagist.org/packages/sinri/ark)[ RSS](/packages/sinri-ark/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (9)Versions (73)Used By (0)

Ark
===

[](#ark)

[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/sinri/Ark/master/LICENSE)[![GitHub release](https://camo.githubusercontent.com/92014a9769b900b787f194deb71544adb9ab0aefa5154c2206fb13734968e0c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73696e72692f41726b2e737667)](https://github.com/sinri/Ark/releases)[![Packagist](https://camo.githubusercontent.com/64f958adaa727d1d51a70f863e8ab5bf32d7095956e640d4950144fd56f8bbb2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2e737667)](https://packagist.org/packages/sinri/ark)

A fundamental toolkit for PHP 7.

```
composer require sinri/ark
```

It is a new generation for [Enoch Project](https://github.com/sinri/enoch), as which might continuously support projects in PHP 5.4+.

If you have problem to connect to GitHub or too slow, try use mirror:

`composer config repo.packagist composer https://mirrors.aliyun.com/composer/`

> And every living substance was destroyed which was upon the face of the ground, both man, and cattle, and the creeping things, and the fowl of the heaven; and they were destroyed from the earth: and Noah only remained \[alive\], and they that \[were\] with him in the ark. (Genesis 7:23)

Environment
-----------

[](#environment)

Ark requests PHP 7. If you need Redis, you might need to declare the reference of `predis/predis`. Since version 2.1, Ark-Core and Ark-Curl use version 2. Since version 2.4, Ark-Cache use version 2 to support PSR-16. Since version 3.3, Ark-Web became independent as 1.0.0. Now Ark has been in 3.x.

Toolkit Map
-----------

[](#toolkit-map)

### Components

[](#components)

Basic Functions

- `sinri/ark-core` [![Packagist](https://camo.githubusercontent.com/311ada472ce3e7de75ededb1f419e29a9c8e8ffce23dbb3f809d5a73a41bba0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d636f72652e737667)](https://packagist.org/packages/sinri/ark-core)
- `sinri/ark-web` [![Packagist](https://camo.githubusercontent.com/d31b412af261d591829191fe9b55e5fb49dde3763e02daaf6979f15eec9aa9df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d7765622e737667)](https://packagist.org/packages/sinri/ark-web)
- `sinri/ark-curl` [![Packagist](https://camo.githubusercontent.com/2e2ce9e0a5c9cfef50002ce33bd8513def10471843299144564fe1fad97539f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6375726c2e737667)](https://packagist.org/packages/sinri/ark-curl)
- `sinri/ark-cache` [![Packagist](https://camo.githubusercontent.com/3926bf839b0eaad060681150a084081afe3cda70cba3dda44022df78ec5568fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d63616368652e737667)](https://packagist.org/packages/sinri/ark-cache)
- `sinri/ark-xml` [![Packagist](https://camo.githubusercontent.com/8c3af7fb06dab8496649a1d09172781c18f82fac3bd5672d21c06912a84ba04d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d786d6c2e737667)](https://packagist.org/packages/sinri/ark-xml)

Database Related

- `sinri/ark-pdo` [![Packagist](https://camo.githubusercontent.com/96061cc0a008ab10a8d8418446d6cdd4b8ee075da9d0e8cb4497a726ab9f68f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d70646f2e737667)](https://packagist.org/packages/sinri/ark-pdo)
- `sinri/ark-mysqli` [![Packagist](https://camo.githubusercontent.com/223c1ce61282cbcd6db8730bfb53157f965f3e03e64159030f6b1fdd65b28df6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6d7973716c692e737667)](https://packagist.org/packages/sinri/ark-mysqli)
- `sinri/ark-sqlite3` [![Packagist](https://camo.githubusercontent.com/bf9829d589e0bdb25b01b663edc29f47f6481cdc5fd342fc9729287b1c3b2683/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d73716c697465332e737667)](https://packagist.org/packages/sinri/ark-sqlite3)
- `sinri/ark-couchdb` [![Packagist](https://camo.githubusercontent.com/b259636562db03197fc77293dd08a9e1bbc6a42b46431aba6682bdfe6846d50a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d636f75636864622e737667)](https://packagist.org/packages/sinri/ark-couchdb)
- `sinri/ark-redis` [![Packagist](https://camo.githubusercontent.com/2b632da2238037e86b449657c0399d371b76d1891e5d545796ee5203750fafd2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d72656469732e737667)](https://packagist.org/packages/sinri/ark-redis)

Email Related

- `sinri/ark-mail` [![Packagist](https://camo.githubusercontent.com/2ec508c05673cb25bce26f7d05ef493947008835d7dd8ee59b6da0eb3867c3d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6d61696c2e737667)](https://packagist.org/packages/sinri/ark-mail)
- `sinri/ark-imap` [![Packagist](https://camo.githubusercontent.com/14dfa9f0f6b079d44dd785912d8ea950cb29ccbae7b2a6b03234439d9c27f7ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d696d61702e737667)](https://packagist.org/packages/sinri/ark-imap)

Queue Related

- `sinri/ark-queue` [![Packagist](https://camo.githubusercontent.com/e18ea003ec388c9dec7e6b05e8bc491e7313f797d65c21d196b409d222a17643/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d71756575652e737667)](https://packagist.org/packages/sinri/ark-queue)
- `sinri/ark-lock` [![Packagist](https://camo.githubusercontent.com/8ddafd79ab079178c1ee515423aab477f4957cf9e987797555d3f232c32bc028/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6c6f636b2e737667)](https://packagist.org/packages/sinri/ark-lock)
- `sinri/ark-event` [![Packagist](https://camo.githubusercontent.com/545919b9101b23aa1c042045b1d612e80de9497d4378c170025316e9721df834/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6576656e742e737667)](https://packagist.org/packages/sinri/ark-event)

Lightweight Directory Access Protocol

- `sinri/ark-ldap` [![Packagist](https://camo.githubusercontent.com/1af2c8f074617103c3bd40e7d57da0cc8188f0e30c0a7df1fbe58703d2be2fc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6c6461702e737667)](https://packagist.org/packages/sinri/ark-ldap)

QR Code

- `sinri/ark-qr-builder` [![Packagist](https://camo.githubusercontent.com/0d306febc8346aecf9e37839f63a57712b2e1901b767f4b1445a6c28824883c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d71722d6275696c6465722e737667)](https://packagist.org/packages/sinri/ark-qr-builder)

Remote File System Access

- `sinri/ark-ftp` [![Packagist](https://camo.githubusercontent.com/0dd7271a7ab0a4266c59156408a058165fe792b6cc26d97938764445b96b4dd0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d6674702e737667)](https://packagist.org/packages/sinri/ark-ftp)
- `sinri/ark-sftp` [![Packagist](https://camo.githubusercontent.com/d79f6570ee86133a1806bd7a76f3397110aa447087fe69992be9d3e47cd4c249/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f61726b2d736674702e737667)](https://packagist.org/packages/sinri/ark-sftp)

WebSocket Server

- `sinri/ark-websocket` [![Packagist Version](https://camo.githubusercontent.com/2b2d2cfb45ff4300ffa5d2b4c98c94d3c1122a774b8280167c8da87a72afaa85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f41726b2d576562536f636b6574)](https://camo.githubusercontent.com/2b2d2cfb45ff4300ffa5d2b4c98c94d3c1122a774b8280167c8da87a72afaa85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f41726b2d576562536f636b6574)

### Independent Toolkit

[](#independent-toolkit)

Class ArkHelper is designed for the convenience of developing, it help you to operate data structure safely, and some environment shortcuts.

Class ArkLogger is an implementation of [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). You might create an instance with certain log storage path, or use a silent one as default.

Class ArkCurl provides a higher level usage of CURL.

Class ArkCache defined the interface of being a cache handler, and implementations by File System and Redis, also the fallback choice Dummy. (Note, if you want to use Redis, `predis/predis` is needed in `composer.json`.)

Class ArkPDO with model encapsulation are there for you Database Operation.

Class ArkSqlite3 is an extended tool for working on SQLite3.

### Web Toolkit

[](#web-toolkit)

The main reference is `Ark()`, which would provide a singleton of class TheArk.

For web service, Class TheArk contains:

- Method `webInput`, give the global instance of class ArkWebInput.
- Method `webOutput`, give the global instance of class ArkWebOutput.
- Method `webService`, give the global instance of class ArkWebService.

For general routines, the multi-instance hubs (register and get) are provided:

- Hub for ArkPDO
- Hub for ArkLogger
- Hub for ArkCache

### CLI Toolkit

[](#cli-toolkit)

Class ArkCliProgram is designed to support a whole CLI project with certain namespace and class rule.

### Server Config Reference

[](#server-config-reference)

If you use Apache to load the project, you need to add the .htaccess file and open the allow override option.

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

```

For Nginx, you should use try\_files.

```
server {
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
}
```

Who use this?
-------------

[](#who-use-this)

Not so many in fact. Amongst them, Leqee is one.

Donation
--------

[](#donation)

BitCoin/BTC: 18wCjV8mnepDpLzASKdW7CGo6U8F9rPuV4

Alipay Account:

[![Alipay](https://camo.githubusercontent.com/1185c3d5c55defc33df15fd5cbbdef7dad9590e9a06a19c6b5a47bf8b0cc9f05/68747470733a2f2f6f75726269626c652e6e65742f6173736574732f696d672f416c69706179556b616e6f6b616e3235382e706e67)](https://camo.githubusercontent.com/1185c3d5c55defc33df15fd5cbbdef7dad9590e9a06a19c6b5a47bf8b0cc9f05/68747470733a2f2f6f75726269626c652e6e65742f6173736574732f696d672f416c69706179556b616e6f6b616e3235382e706e67)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99.4% of commits — single point of failure

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 ~33 days

Recently: every ~246 days

Total

70

Last Release

656d ago

Major Versions

0.11 → 1.02018-03-26

v1.x-dev → 2.0.02018-09-24

2.9.1 → 3.0.0-alpha2019-11-07

2.10.x-dev → 3.0.12020-01-02

3.4.4 → 4.0.02024-05-11

PHP version history (2 changes)0.5PHP ~7.0

4.0.0PHP ~8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f21c380187798de639192557cfc054683355c6f8c1649cff213fee795590831?d=identicon)[sinri](/maintainers/sinri)

---

Top Contributors

[![sinri](https://avatars.githubusercontent.com/u/5821330?v=4)](https://github.com/sinri "sinri (163 commits)")[![cagiant](https://avatars.githubusercontent.com/u/17401206?v=4)](https://github.com/cagiant "cagiant (1 commits)")

---

Tags

php-frameworkphp-libraryphp7

### Embed Badge

![Health badge](/badges/sinri-ark/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k997.0M2.8k](/packages/guzzlehttp-psr7)[pragmarx/tracker

A Laravel Visitor Tracker

3.0k298.5k1](/packages/pragmarx-tracker)[luracast/restler

Restler is a simple and effective multi-format Web API Server framework written in PHP. Just deal with your business logic in php, Restler will take care of the REST!

1.4k533.9k5](/packages/luracast-restler)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

1.0k453.9k2](/packages/akaunting-laravel-firewall)[slim/psr7

Strict PSR-7 implementation

14817.4M360](/packages/slim-psr7)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6938.6M296](/packages/drupal-core-recommended)

PHPackages © 2026

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