PHPackages                             typephp-org/native-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. [CLI &amp; Console](/categories/cli)
4. /
5. typephp-org/native-core

ActiveLibrary[CLI &amp; Console](/categories/cli)

typephp-org/native-core
=======================

AOT-first, host-neutral native application core for TypePHP and Zend PHP

v0.1.0-alpha.1(yesterday)01↑2900%MITPHPPHP &gt;=8.4CI passing

Since Aug 25Pushed yesterdayCompare

[ Source](https://github.com/typephp-org/native-core)[ Packagist](https://packagist.org/packages/typephp-org/native-core)[ Docs](https://github.com/typephp-org/native-core)[ RSS](/packages/typephp-org-native-core/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

TypePHP Native Core
===================

[](#typephp-native-core)

[English](README.md) | [简体中文](README.zh-CN.md)

[![CI](https://github.com/typephp-org/native-core/actions/workflows/ci.yml/badge.svg)](https://github.com/typephp-org/native-core/actions/workflows/ci.yml)[![PHP](https://camo.githubusercontent.com/4d6a3631e75425a18393115dc47935213c193bb3c92834b171ffa1856754bf9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344253230382e342d3737374242342e737667)](composer.json)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

An AOT-first, host-neutral application core for building CLI tools, workers, foreground daemons, and native Windows desktop applications with TypePHP and Zend PHP.

Native Core supplies the application lifecycle and portable service contracts; hosts own the process loop and platform integration. It is intentionally not a Web MVC/API framework. An HTTP host can be built on top, but routing, request/response abstractions, middleware, and a production server are outside the current scope.

Current release line: `0.1.0-alpha.2`. Public APIs are still alpha.

Why TypePHP?
------------

[](#why-typephp)

[TypePHP](https://swoole.com/aot/) brings an AOT compilation path to PHP. It lets an explicitly structured PHP application become native code and provides PHPX/C++ interop for operating-system APIs. Native Core is designed so the same application graph can be developed and tested quickly on Zend PHP, then validated and shipped through TypePHP AOT—without rewriting its lifecycle in a second language.

The result is a practical split:

- Zend PHP provides the familiar, fast edit-test loop and Composer tooling.
- TypePHP provides native compilation and a path to C++/platform integration.
- Native Core keeps lifecycle, cancellation, configuration, events, and logging consistent across both runtimes.

What Native Core provides
-------------------------

[](#what-native-core-provides)

- Deterministic module startup and reverse-order cleanup from a `finally`boundary.
- Explicit modules and `ServiceFactory` objects instead of reflection or runtime scanning.
- Small replaceable ports for configuration, events, logging, clocks, cancellation, filesystems, process locks, and channels.
- AOT-friendly APIs: named callback objects, concrete types, explicit sources, and no runtime code generation.
- Console, foreground Daemon, and reusable Windows Desktop host contracts.
- PHP `>=8.4`, matching the minimum required by the current TypePHP compiler and generated programs, with no other runtime Composer dependencies.

Dependency direction is always:

```
Application / Host adapter  ->  Native Core

```

Platform handles and Win32, SDL, WebView, or daemon-specific behavior never enter `src/`.

Platform support
----------------

[](#platform-support)

Native Core is cross-platform at the Core boundary. Native executables and platform adapters are still built and verified per operating system.

AreaPortabilityCurrent evidenceHost-neutral Core, Console, and WorkerOS-neutral by contractZend PHP 8.4 CI on Ubuntu and Windows; TypePHP AOT verified on Windows x64Foreground DaemonCore loop is OS-neutral; signals and service integration are adaptersZend regressions on Ubuntu/Windows and a Windows TypePHP smoke; POSIX signal behavior is not yet verifiedWindows Desktop HostWindows onlyZend contract regressions and a real TypePHP/Win32 desktop smokeTypePHP AOTTypePHP targets Linux, macOS, and Windows; each platform produces its own native artifactThis repository currently has native runtime evidence for Windows x64 onlymacOS and Linux TypePHP builds are intended and supported by the architecture, but they are not marked confirmed here until the matching build and runtime smokes have actually run.

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

[](#installation)

Install from Packagist:

```
composer require typephp-org/native-core:^0.1@alpha
```

The Composer package contains PHP source only. It does not bundle the TypePHP compiler, PHPX, PHP Embed, native runtime libraries, or build tools. TypePHP projects must list the Core and Host source files explicitly in `project.yml`.

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

[](#quick-start)

```
