PHPackages                             phpdic/swoole-auto-restart - 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. phpdic/swoole-auto-restart

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

phpdic/swoole-auto-restart
==========================

swoole development, automatically restarting the service after modifying the code.

0.0.1(7y ago)222.6k11MITPHPCI failing

Since Dec 14Pushed 6y ago2 watchersCompare

[ Source](https://github.com/phpdi/swoole-auto-restart)[ Packagist](https://packagist.org/packages/phpdic/swoole-auto-restart)[ RSS](/packages/phpdic-swoole-auto-restart/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

 swooleAutoRestart
===================

[](#-swooleautorestart-)

 .

说明
--

[](#说明)

此扩展包用于,swoole开发,修改代码后自动重启服务

依赖PHP扩展
-------

[](#依赖php扩展)

- swoole ```
    pecl install swoole
    ```
- inotify,此扩展为php文件监听扩展,安装命令如下 ```
    pecl install inotify
    ```

安装
--

[](#安装)

```
$ composer require phpdic/swoole-auto-restart -vvv
```

用法
--

[](#用法)

1.在你的项目根目建立一个php脚本,如:swoole-auto-start.php,内容如下:

```
require './vendor/autoload.php';

//启动服务的脚本,修改成你自己的
$startServiceCommand='/usr/bin/php easyswoole start';

$a = new \Phpdic\SwooleAutoRestart\swooleAutoRestart(__DIR__, $startServiceCommand);
$a->listen();
```

2.执行你刚刚创建的这个脚本

```
/usr/bin/php swoole-auto-start.php
```

说明
--

[](#说明-1)

swooleAutoRestart构造函数注解

```
 /**
     * swooleAutoRestart constructor.
     * @param string $rootDir 需要监听的项目根目录
     * @param string $startServerCommand 启动swoole服务器的命令
     * @param array $notCheckDir 配置不需要监听的目录
     * @param int $restartInterval 重启间隔
     * @param bool $showDetail 是否展示详细信息
     */
    public function __construct(string $rootDir,string $startServerCommand,array $notCheckDir=[],$restartInterval=1000,$showDetail=false)
    {
```

notCheckDir参数可以配置不需要监听的目录,例如,我的项目是laravel框架,设置如下:

```
$notCheckDir=['/bootstrap','/storage','/tests']
```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/phpdic/swooleAutoRestart/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/phpdic/swooleAutoRestart/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

2705d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32fb6930b94267ba46a4eb37e91b23c31a2601ad417f6e44f3c6c89015e85bb4?d=identicon)[phpdi](/maintainers/phpdi)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpdic-swoole-auto-restart/health.svg)

```
[![Health](https://phpackages.com/badges/phpdic-swoole-auto-restart/health.svg)](https://phpackages.com/packages/phpdic-swoole-auto-restart)
```

###  Alternatives

[astrotomic/laravel-webmentions

215.7k](/packages/astrotomic-laravel-webmentions)

PHPackages © 2026

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