PHPackages                             chongyi/actuator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. chongyi/actuator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chongyi/actuator
================

轻松调用 shell 命令，同时实现双向进程管道的读写操作，以实现更为丰富的进程调用功能。

v0.1.1(10y ago)6191MITPHP

Since Oct 28Pushed 10y ago3 watchersCompare

[ Source](https://github.com/chongyi/Actuator)[ Packagist](https://packagist.org/packages/chongyi/actuator)[ RSS](/packages/chongyi-actuator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Actuator 执行器
============

[](#actuator-执行器)

轻松调用 shell 命令，同时实现双向进程管道的读写操作，以实现更为丰富的进程调用功能。

安装
--

[](#安装)

通过 Composer 安装

`composer require chongyi/actuator dev-master`

使用
--

[](#使用)

基本示例：

```
use Dybasedev\Actuator\Actuator;

// 创建执行器实例
$actuator = new Actuator;

// 创建一个进程
$process = $actuator->createProcess('php -i');

// 从管道中读取进程输出的数据
while (!$process->getPipeManager()[1]->eof()) {
    print $process->getPipeManager()[1]->read(64);
}
```

管道的双向读写：

```
use Dybasedev\Actuator\Actuator;

$actuator = new Actuator;

$printer = $actuator->createProcess('php -i');
$grep    = $actuator->createProcess('grep extension');

while (!$process->getPipeManager()[1]->eof()) {
    // 从管道中读取进程输出的数据，同时向另一个进程的管道写入数据
    $grep->getPipeManager()[0]->write($process->getPipeManager()[1]->read(64));
}

// 关闭 grep 进程的写入管道
$grep->getPipeManager()[0]->close();

// 从 grep 进程管道读取搜索结果
while (!$grep->getPipeManager()[1]->eof()) {
    print $grep->getPipeManager()[1]->read(64);
}
```

上述例子等同于执行命令 `php -i|grep` 。对于更复杂的管道读写操作可以用更为灵活的方式进行。

计划更新
----

[](#计划更新)

下一步打算利用协程概念实现更为强大的功能，敬请期待。

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3855d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5a593e3eea7724cec4b1056d83887fb717963f40a6ff81d8357f45f71eb0734?d=identicon)[chongyi](/maintainers/chongyi)

---

Top Contributors

[![chongyi](https://avatars.githubusercontent.com/u/7391880?v=4)](https://github.com/chongyi "chongyi (8 commits)")

### Embed Badge

![Health badge](/badges/chongyi-actuator/health.svg)

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

PHPackages © 2026

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