Download the PHP package kode/runtime without Composer

On this page you can find all versions of the php package kode/runtime. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package runtime

kode/runtime —— 跨平台运行时抽象层

一个为现代 PHP 常驻内存应用设计的统一运行时抽象包 支持 Swoole、Swow、PHP Fiber(协程)、多进程、多线程、Console 及传统 CLI 模式 面向 PHP 8.1+,基于协变/逆变、readonly、match 等 PHP 8+ 新特性构建


📦 包信息

项目 内容
包名 kode/runtime
PHP 版本 ^8.1
许可证 Apache-2.0
维护状态 Active
GitHub https://github.com/kodephp/runtime
Packagist kode/runtime

依赖包

包名 版本 说明
kode/context ^2.0 协程/纤程上下文管理
kode/console ^3.0 控制台输入输出(可选)

🎯 设计目标

为构建 常驻内存型 PHP 框架 提供底层运行时抽象能力:


✅ 核心功能

功能 说明
🔍 运行环境检测 自动识别 Swoole、Swow、Fiber、Console、Process、Thread、CLI 模式
🔄 统一协程启动 Runtime::async() 跨平台启动协程
⏱️ 统一 sleep API Runtime::sleep() 支持微秒级休眠
📦 通道(Channel) 跨平台协程间通信机制
🧩 defer 支持 函数退出时自动执行清理逻辑
🧠 上下文管理 基于 kode/context 的协程安全存储
🎮 Console 集成 RuntimeCommand 命令基类,集成控制台输出
🛠️ 适配器模式 易于扩展新运行时

🚀 快速开始

1. 安装

2. 环境检测

3. 启动协程

4. Channel 通信

5. defer 清理资源

6. 多进程支持

7. Console 命令


🧱 架构设计

适配器模式

核心类

类名 说明
Runtime 静态门面,提供全局访问点
RuntimeInterface 运行时接口契约
RuntimeAdapterFactory 适配器工厂类
ConsoleRuntime Console 环境适配器
SwooleRuntime Swoole 协程适配器
SwowRuntime Swow 协程适配器
FiberRuntime PHP Fiber 适配器
ProcessRuntime 多进程适配器
ThreadRuntime 多线程适配器
CliRuntime CLI 同步执行适配器
RuntimeCommand Console 命令基类

🔄 API 参考

Runtime 门面

RuntimeAdapterFactory

RuntimeCommand 基类


🧪 Channel 接口


🧪 兼容性

运行环境 支持 说明
Swoole v4.8+,需启用协程
Swow v1.5+
PHP Fiber PHP 8.1+
Console 集成 kode/console
多进程 基于 PCNTL
多线程 ⚠️ 需 pthreads 扩展
CLI 同步执行

🧪 测试

测试覆盖


🛡️ 特性


📁 目录结构


🙌 贡献

欢迎提交 PR 和 Issue!

请遵循 PSR-12 编码规范,编写单元测试。


📄 许可证

Apache License 2.0


kode/runtime —— 让 PHP 在任何运行时都如丝般顺滑 🚀


All versions of runtime with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
kode/context Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kode/runtime contains the following files

Loading the files please wait ...