jalallinux/php-pm2

管理php中的pm2进程

资助包维护!
jalallinux

1.3.0 2023-06-17 18:43 UTC

README

Latest Version on Packagist Tests Total Downloads

在php中使用和管理 PM2

安装

您可以通过composer安装此包

composer require jalallinux/php-pm2

用法

Pm2

  • 全名: \JalalLinuX\Pm2\Pm2

list

获取所有正在运行的应用程序列表

pm2()->list(string $sortField = 'name', bool $desc = true): array<Process>

参数

link

将您的服务器连接到仪表板并开始收集指标

pm2()->link(string $publicKey, string $secretKey, string|null $machineName = null): bool

参数

unlink

将您的服务器从指标仪表板断开连接

pm2()->unlink(): bool

start

带有特定选项的启动命令或启动一个 ecosystem.config.js

pm2()->start(string $command = null, array $options = []): bool

参数

findBy

查找特定进程

pm2()->findBy(string $key, string $value): \JalalLinuX\Pm2\Structure\Process|null

参数

kill

终止守护进程

pm2()->kill(): bool

pid

获取特定进程的pid

pm2()->pid(string $name): int|null

参数

flush

清空所有日志文件

pm2()->flush(): bool

update

更新内存中的pm2

pm2()->update(): mixed

stopAll

停止所有进程

pm2()->stopAll(): bool

restartAll

重启所有进程

pm2()->restartAll(): bool

deleteAll

将停止并从pm2列表中删除所有进程

pm2()->deleteAll(): bool

stop

停止特定进程

pm2()->stop(string $idOrName): bool

参数

restart

重启特定进程

pm2()->restart(string $idOrName): bool

参数

delete

删除特定进程

pm2()->delete(string $idOrName): bool

参数

save

冻结进程列表以自动重生

pm2()->save(bool $force = true): bool

参数

logOut

显示所有进程的输出日志

pm2()->logOut(string $idOrName = null, int $lines = 100): string

参数

logErr

显示所有进程的错误日志

pm2()->logErr(string $idOrName = null, int $lines = 100): string

参数

startup

生成一个活动启动脚本

pm2()->startup(): bool

version

获取已安装的pm2版本

pm2()->version(): string

install

安装 PM2(需求:nodenpm

pm2()->install(string $version = 'latest'): false|string|null

参数

isInstall

检查是否已安装 PM2

pm2()->isInstall(bool $forceInstall = false, string $version = 'latest'): bool

参数

测试

composer test

变更日志

请参阅CHANGELOG了解最近的变化。

致谢

许可

MIT 许可证 (MIT)。更多信息请参阅许可文件