PHPackages                             kislayphp/core - 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. kislayphp/core

ActivePhp-ext[API Development](/categories/api)

kislayphp/core
==============

High-performance C++ PHP extension providing HTTP/HTTPS server with routing and middleware for PHP microservices

v1.0.0(2w ago)172↓93.3%1Apache-2.0C++PHP &gt;=8.2CI failing

Since Feb 21Pushed 2w agoCompare

[ Source](https://github.com/KislayPHP/core)[ Packagist](https://packagist.org/packages/kislayphp/core)[ Docs](https://github.com/KislayPHP/core)[ RSS](/packages/kislayphp-core/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (14)Used By (1)

Kislay Core
===========

[](#kislay-core)

[![PHP Version](https://camo.githubusercontent.com/5fe05c705bf034839bda7651781e4d0a9d42f4a840478ca5e343873a0361bb89/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/109222cb0d1f59ed2e77b56722653623fa45f93e2bb201a6eef8561d26a52185/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d677265656e2e737667)](LICENSE)![Release](https://camo.githubusercontent.com/714333c10797cbf68663465e6f09c3e45d245b1555ed8c28cc7492af64cc51a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656c656173652d312e302e302d6f72616e67652e737667)

Kislay Core is the HTTP runtime for the KislayPHP ecosystem. It provides the embedded HTTP/HTTPS server, strict segment router, request/response lifecycle, middleware, async bridge, and Promise primitives used by the higher-level modules.

Install
-------

[](#install)

Prerequisites for PIE/source builds:

- macOS (Homebrew): `brew install libuv`
- Debian/Ubuntu: install the development packages for `libuv`, `curl`, and OpenSSL

Ubuntu 24.04 reference flow used for the release verification:

```
sudo apt-get update
sudo apt-get install -y pkg-config libcurl4-openssl-dev libssl-dev libuv1-dev
```

```
pie install kislayphp/core:1.0.0
```

Automation note:

- in a non-interactive automation session on macOS, PIE may stop after the build step because the final copy still goes through `sudo`
- the built module can still be validated directly from the PIE working directory before the final interactive install step

```
extension=kislayphp_extension.so
```

Build from source:

```
git clone https://github.com/KislayPHP/core.git
cd core
phpize
./configure --enable-kislayphp_extension
make -j4
sudo make install
```

New in 1.0.0
------------

[](#new-in-100)

- **`Kislay\Core\AttributeRouter`** — PHP 8 attribute-based routing (`#[Route]`, `#[Get]`, `#[Post]`, etc.) for declaring routes on controller methods instead of imperative `$app->get(...)` calls.
- **`Kislay\Core\EventPublisher`** — a typed, in-process event bus (Spring-style `ApplicationEventPublisher`) with class-hierarchy and interface-based listener dispatch.
- Hot-path work: flat vector-backed HTTP header storage (`FlatHeaders`) cutting per-request header allocations from N to 1, an atomic request-completion flag with a short spin-wait so fast handlers avoid extra context switches, and thread-local CURL handle pooling + a non-blocking retry queue for the async HTTP client.
- **Fixed:** `/actuator/health` could crash the whole process under concurrent load — its health-indicator invocation loop called Zend APIs directly from a raw civetweb worker thread instead of the safe single-dedicated-PHP-thread request pool, which on NTS builds could corrupt Zend's shared heap under concurrent access. Now serialized behind a mutex.

Runtime contract
----------------

[](#runtime-contract)

- Routes support only static segments and `:param` segments.
- Regex-style routes and wildcard route fragments are rejected at registration time.
- Middleware uses `function ($req, $res)` and must return a truthy value to continue.
- Query/body parsing is lazy.
- `listenAsync()` requires ZTS. On NTS, run `listen()` in its own process.
- `AsyncHttp` self-requests are rejected in single PHP runtime mode to avoid deadlocks.

Quick start
-----------

[](#quick-start)

```
