prageeth-peiris/connect-to-rpm2 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

prageeth-peiris/connect-to-rpm2

Composer 安装命令:

composer require prageeth-peiris/connect-to-rpm2

包简介

A Simple Laravel Package to connect with rpm2 server (An express JS server that connects to pm2 node process manager)

README 文档

README

This Laravel package helps you to connect to a RPM2 Server and manipulates PM2 processes.

https://github.com/FizzyApple12/rpm2

How to set up RPM2 Server

npm i rpm2 -g
npx rpm2 start

This commands should run a RPM2 Server in 8008 port in default

Installation

You can install the package via composer:

composer require prageeth-peiris/connect-to-rpm2

Requirements

  • Laravel 8 or above
  • PHP 8.1

ENV Setup

RPM2_HOST = "2.3.5.4:8080"
PM2_SCRIPT_LOCATION = "/app/myapp/test"
PM2_SCRIPT_NAME = "index.js"
DEFAULT_PM2_SCRIPT_ARGUMENTS = "-x  foo -y bar"

Usage

//create an instance of manager class 
$manager = new \PrageethPeiris\ConnectToRpm2\Manager\Rpm2Manager()

//optionally you can pass your custom rpm2Client to manager
$rpm2Client = new \PrageethPeiris\ConnectToRpm2\Clients\Rpm2Client();
$rpm2Client->setHost('x')->setScriptLocation('/ssss/ssss')
$manager = new \PrageethPeiris\ConnectToRpm2\Manager\Rpm2Manager($rpm2Client)


//execute new process with arguments
$response =  $manager->run("-x1 customArg1 -x2 CustomArg2")

//stop process by processName
// package automatically  generates processName using Unix Timestamp
$response = $manager->stop(12345678);


//kill an process by processName
$response = $manager->kill(12345798)

// list all processList
$response = $manager->listAll();

// check status of a process by process name
$response = $manager->check(123456789)

//dump response 
dd($response);

Testing

composer test

You need an actual rpm2 server to run tests. Also set env variables in config file.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email glpspeiris@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

  • 总下载量: 180
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固