From 2d4fbae0c687eedc03c4cae736233c03b3f5137c Mon Sep 17 00:00:00 2001 From: wandoubaba Date: Fri, 19 Jul 2024 12:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7workerman=E5=88=B04.1.5?= =?UTF-8?q?=EF=BC=8Cwebman=E5=8D=87=E7=BA=A7=E5=88=B01.5.5=EF=BC=8Cwebman-?= =?UTF-8?q?framework=E7=89=88=E6=9C=AC1.5.20=EF=BC=8C=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8C=85=E5=85=A8=E9=83=A8=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=EF=BC=8Cphp=E9=95=9C=E5=83=8F=E5=88=87=E6=8D=A2=E4=B8=BAquay.i?= =?UTF-8?q?o/wandoubaba517/workerman:8.2.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 103 ++++++++++-- composer | 16 +- composer.lock | 397 ++++++++++++++++++++++---------------------- config/jsonrpc.php | 2 +- docker-compose.yml | 13 -- php | 25 ++- server | 47 ------ support/helpers.php | 6 +- webman | 8 +- 9 files changed, 328 insertions(+), 289 deletions(-) delete mode 100644 docker-compose.yml delete mode 100755 server diff --git a/README.md b/README.md index 665d68b..5038f74 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,88 @@ # 基于docker的webman-jsonrpc -我们在`php:8.1-cli`基础上安装了运行webman必要的一些扩展和开发中常用的扩展,以及composer,制作成`workerman:8.1`镜像,因此在开发环境中不需要再额外配置php环境,直接写业务代码即可。 +我们在`php:8.2.20-cli`基础上安装了运行webman必要的一些扩展和开发中常用的扩展,以及composer,制作成`workerman:8.2.20`镜像,因此在开发环境中不需要再额外配置php环境,直接写业务代码即可。 + +## 版本 + +```txt +./php start.php start +Workerman[start.php] start in DEBUG mode +------------------------------------------- WORKERMAN -------------------------------------------- +Workerman version:4.1.15 PHP version:8.2.20 Event-Loop:\Workerman\Events\Event +-------------------------------------------- WORKERS --------------------------------------------- +proto user worker listen processes status +tcp root webman http://0.0.0.0:8787 8 [OK] +tcp root monitor none 1 [OK] +tcp root jsonrpc jsonNL://0.0.0.0:8021 8 [OK] +-------------------------------------------------------------------------------------------------- +Press Ctrl+C to stop. Start success. +``` ## 依赖 -只要系统环境中有docker即可,不需要安装php环境 +只要系统环境中有docker即可(生产环境需要docker-compose),不需要安装php环境。 ## 使用方法 ```sh # composer -./composer install ./composer require xxxx -# 服务控制 -./server start|restart|stop|status|reload|connections|logs -# 自动生成.env.example文件 -./envexample +# 启动服务 +./php start.php start # 执行其它php命令 ./php -m ./php webman build:bin ``` -## 一些有用的文件 - -| 文件 | 作用 | 用法或说明 | -|---|---|---| -|composer|调起容器中的`composer`命令的shell脚本|用法与主机中的compose完全一致,`./composer $args...`| -|server|服务控制脚本|`./server`可以查看用法| -|php|调起容器中的`php`命令的shell脚本|用法与主机中的php一致,但注意执行`./php start.php start`命令时不要加-d参数| -|docker-compose.yml|运行容器的编排文件|| -|php.ini|映射到容器中的php.ini配置文件|容器中已经安装的扩展都有单独的配置文件,这里不会有体现| - ## 服务端口 在.env文件中可以定义服务端口,默认情况下docker容器是在host网络下启动的,当然,实际使用中也可以改成端口映射模式。 +## 生产环境使用 + +创建一个docker-compose.yml文件: + +```yml +services: + webman: + image: quay.io/wandoubaba517/workerman:8.1.27 + container_name: webman + restart: always + volumes: + - ./:/app/service + working_dir: /app/service + stdin_open: true + ports: + - 8787:8787 + # 部署生产时启动这一句 + command: ['php', 'start.php', 'start'] + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8787/"] + interval: 5s + retries: 3 + start_period: 5s + timeout: 10s +``` + +然后直接执行(前提要有docker-compose插件) + +```sh +docker compose up -d +``` + +## 一些有用的文件 +|文件|作用|用法或说明| +|---|---|---| +|composer|调起容器中的composer命令的shell脚本|用法与主机中的compose完全一致,./composer $args...| +|php|调起容器中的php命令的shell脚本|用法与主机中的php一致,但注意执行./php start.php start命令时不要加-d参数| +|php.ini|映射到容器中的php.ini配置文件|容器中已经安装的扩展都有单独的配置文件,这里不会有体现| + ## 已安装PHP扩展 ```sh php -m [PHP Modules] +bcmath Core ctype curl @@ -51,11 +94,14 @@ fileinfo filter ftp gd +gmp hash iconv +imagick json libxml mbstring +mongodb mysqli mysqlnd openssl @@ -86,7 +132,30 @@ xmlwriter Zend OPcache zip zlib +zookeeper [Zend Modules] Zend OPcache ``` + +## 开发说明 + +### jsonrpc服务端配置 + +主要在`config/process.php`中配置,`.env`文件可以辅助。 + +### jsonrpc控制器 + +在`app/jsonrpc`目录中参照示例创建控制器文件和方法即可。 + +### jsonrpc客户端配置 + +主要在`config/jsonrpc.php`中配置,`.env`文件可以辅助。 + +### 客户端调用服务端的方法 + +```php +$res1 = \jsonrpc\Client::service('default', 'Demo')->hello('Json'); +$res2 = \jsonrpc\Client::service('user', 'User')->login('admin', '123456'); +$res3 = \jsonrpc\Client::service('default', 'Demo')->text(); +``` diff --git a/composer b/composer index 4b7edcd..019569d 100755 --- a/composer +++ b/composer @@ -1,3 +1,17 @@ #!/bin/bash -docker compose run --rm webman-jsonrpc composer $@ \ No newline at end of file +read -r -d '' DOCKER_COMMAND <<'EOF' +docker run --rm \ +-v "$(pwd)":/app/service \ +-w /app/service \ +quay.io/wandoubaba517/workerman:8.2.20 \ +composer +EOF + +# 检查是否有传递参数,并将它们附加到命令的末尾 +if [ $# -gt 0 ]; then + DOCKER_COMMAND+=" $@" +fi + +# 执行docker run命令 +eval "$DOCKER_COMMAND" \ No newline at end of file diff --git a/composer.lock b/composer.lock index f926694..3d902ac 100644 --- a/composer.lock +++ b/composer.lock @@ -8,25 +8,25 @@ "packages": [ { "name": "brick/math", - "version": "0.11.0", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", "shasum": "" }, "require": { - "php": "^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "5.0.0" + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" }, "type": "library", "autoload": { @@ -46,12 +46,17 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.11.0" + "source": "https://github.com/brick/math/tree/0.12.1" }, "funding": [ { @@ -59,7 +64,7 @@ "type": "github" } ], - "time": "2023-01-15T23:15:59+00:00" + "time": "2023-11-29T23:19:16+00:00" }, { "name": "carbonphp/carbon-doctrine-types", @@ -132,16 +137,16 @@ }, { "name": "doctrine/inflector", - "version": "2.0.8", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { @@ -203,7 +208,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.8" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -219,7 +224,7 @@ "type": "tidelift" } ], - "time": "2023-06-16T13:40:37+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "graham-campbell/result-type", @@ -285,16 +290,16 @@ }, { "name": "illuminate/bus", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "8db4b00a3f6071075e9f08094c6c7b059f8deddf" + "reference": "252e200dacaeb168675cbf1aa26dbead57492a6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/8db4b00a3f6071075e9f08094c6c7b059f8deddf", - "reference": "8db4b00a3f6071075e9f08094c6c7b059f8deddf", + "url": "https://api.github.com/repos/illuminate/bus/zipball/252e200dacaeb168675cbf1aa26dbead57492a6c", + "reference": "252e200dacaeb168675cbf1aa26dbead57492a6c", "shasum": "" }, "require": { @@ -334,20 +339,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-15T14:09:57+00:00" + "time": "2024-05-24T17:00:27+00:00" }, { "name": "illuminate/collections", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "63fc240a047788fbc2ebe153de85cb72fce88440" + "reference": "37c863cffb345869dd134eff8e646bc82a19cc96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/63fc240a047788fbc2ebe153de85cb72fce88440", - "reference": "63fc240a047788fbc2ebe153de85cb72fce88440", + "url": "https://api.github.com/repos/illuminate/collections/zipball/37c863cffb345869dd134eff8e646bc82a19cc96", + "reference": "37c863cffb345869dd134eff8e646bc82a19cc96", "shasum": "" }, "require": { @@ -389,11 +394,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-21T14:17:35+00:00" + "time": "2024-06-19T14:25:05+00:00" }, { "name": "illuminate/conditionable", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -439,7 +444,7 @@ }, { "name": "illuminate/container", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -490,16 +495,16 @@ }, { "name": "illuminate/contracts", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "f6bf37a272fda164f6c451407c99f820eb1eb95b" + "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/f6bf37a272fda164f6c451407c99f820eb1eb95b", - "reference": "f6bf37a272fda164f6c451407c99f820eb1eb95b", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac", + "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac", "shasum": "" }, "require": { @@ -534,24 +539,24 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-10-30T00:59:22+00:00" + "time": "2024-01-15T18:52:32+00:00" }, { "name": "illuminate/database", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "f014850671278a8d1a0e9fd2f421aad5b487ab9e" + "reference": "ec00738a49e9fb0db4fc19b5d70310e214b32bff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/f014850671278a8d1a0e9fd2f421aad5b487ab9e", - "reference": "f014850671278a8d1a0e9fd2f421aad5b487ab9e", + "url": "https://api.github.com/repos/illuminate/database/zipball/ec00738a49e9fb0db4fc19b5d70310e214b32bff", + "reference": "ec00738a49e9fb0db4fc19b5d70310e214b32bff", "shasum": "" }, "require": { - "brick/math": "^0.9.3|^0.10.2|^0.11", + "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12", "ext-pdo": "*", "illuminate/collections": "^10.0", "illuminate/container": "^10.0", @@ -607,20 +612,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-21T01:49:42+00:00" + "time": "2024-07-03T21:35:00+00:00" }, { "name": "illuminate/events", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "8d84d6220a6b3446a0bf3e4138e2eb0e10792bb1" + "reference": "a931bfa88edc6ac52c9abbfd7b769343d321d3eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/8d84d6220a6b3446a0bf3e4138e2eb0e10792bb1", - "reference": "8d84d6220a6b3446a0bf3e4138e2eb0e10792bb1", + "url": "https://api.github.com/repos/illuminate/events/zipball/a931bfa88edc6ac52c9abbfd7b769343d321d3eb", + "reference": "a931bfa88edc6ac52c9abbfd7b769343d321d3eb", "shasum": "" }, "require": { @@ -662,11 +667,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-10-30T00:59:35+00:00" + "time": "2024-03-04T14:41:04+00:00" }, { "name": "illuminate/macroable", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -712,16 +717,16 @@ }, { "name": "illuminate/pagination", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", - "reference": "2af69e712297cc38377593a72f00d430867e8bdc" + "reference": "616874b9607ff35925347e1710a8b5151858cdf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/2af69e712297cc38377593a72f00d430867e8bdc", - "reference": "2af69e712297cc38377593a72f00d430867e8bdc", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/616874b9607ff35925347e1710a8b5151858cdf2", + "reference": "616874b9607ff35925347e1710a8b5151858cdf2", "shasum": "" }, "require": { @@ -758,11 +763,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-04-17T16:01:53+00:00" + "time": "2024-04-11T14:31:05+00:00" }, { "name": "illuminate/pipeline", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -810,16 +815,16 @@ }, { "name": "illuminate/redis", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", - "reference": "e0d81f4f9972b0b9dd416516a1f4c209939ef15a" + "reference": "8a438aa70f4bf48973dfe8de9af3ad91cc5361a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/redis/zipball/e0d81f4f9972b0b9dd416516a1f4c209939ef15a", - "reference": "e0d81f4f9972b0b9dd416516a1f4c209939ef15a", + "url": "https://api.github.com/repos/illuminate/redis/zipball/8a438aa70f4bf48973dfe8de9af3ad91cc5361a7", + "reference": "8a438aa70f4bf48973dfe8de9af3ad91cc5361a7", "shasum": "" }, "require": { @@ -860,20 +865,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-25T01:10:57+00:00" + "time": "2024-01-03T14:02:53+00:00" }, { "name": "illuminate/support", - "version": "v10.39.0", + "version": "v10.48.16", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "6705007f24091863fefdf1f9320ac2c121cf37f1" + "reference": "263f389d81488c237846b69469f91387ca2729f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/6705007f24091863fefdf1f9320ac2c121cf37f1", - "reference": "6705007f24091863fefdf1f9320ac2c121cf37f1", + "url": "https://api.github.com/repos/illuminate/support/zipball/263f389d81488c237846b69469f91387ca2729f3", + "reference": "263f389d81488c237846b69469f91387ca2729f3", "shasum": "" }, "require": { @@ -931,7 +936,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-25T01:11:56+00:00" + "time": "2024-05-16T21:33:51+00:00" }, { "name": "laravel/serializable-closure", @@ -995,16 +1000,16 @@ }, { "name": "monolog/monolog", - "version": "3.5.0", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", - "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8", + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8", "shasum": "" }, "require": { @@ -1027,7 +1032,7 @@ "phpstan/phpstan": "^1.9", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "^10.1", + "phpunit/phpunit": "^10.5.17", "predis/predis": "^1.1 || ^2", "ruflin/elastica": "^7", "symfony/mailer": "^5.4 || ^6", @@ -1080,7 +1085,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.5.0" + "source": "https://github.com/Seldaek/monolog/tree/3.7.0" }, "funding": [ { @@ -1092,20 +1097,20 @@ "type": "tidelift" } ], - "time": "2023-10-27T15:32:31+00:00" + "time": "2024-06-28T09:40:51+00:00" }, { "name": "nesbot/carbon", - "version": "2.72.1", + "version": "2.72.5", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78" + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", "shasum": "" }, "require": { @@ -1139,8 +1144,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ @@ -1199,7 +1204,7 @@ "type": "tidelift" } ], - "time": "2023-12-08T23:47:49+00:00" + "time": "2024-06-03T19:18:41+00:00" }, { "name": "nikic/fast-route", @@ -1658,47 +1663,46 @@ }, { "name": "symfony/console", - "version": "v6.4.2", + "version": "v7.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625" + "reference": "0aa29ca177f432ab68533432db0de059f39c92ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625", + "url": "https://api.github.com/repos/symfony/console/zipball/0aa29ca177f432ab68533432db0de059f39c92ae", + "reference": "0aa29ca177f432ab68533432db0de059f39c92ae", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -1732,7 +1736,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.2" + "source": "https://github.com/symfony/console/tree/v7.1.2" }, "funding": [ { @@ -1748,20 +1752,20 @@ "type": "tidelift" } ], - "time": "2023-12-10T16:15:48+00:00" + "time": "2024-06-28T10:03:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.4.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { @@ -1770,7 +1774,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -1799,7 +1803,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" }, "funding": [ { @@ -1815,20 +1819,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -1842,9 +1846,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1881,7 +1882,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -1897,20 +1898,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -1921,9 +1922,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1962,7 +1960,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -1978,20 +1976,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -2002,9 +2000,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2046,7 +2041,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -2062,20 +2057,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -2089,9 +2084,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2129,7 +2121,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -2145,20 +2137,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -2166,9 +2158,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2212,7 +2201,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -2228,25 +2217,26 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.4.1", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^1.1|^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -2254,7 +2244,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -2294,7 +2284,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" }, "funding": [ { @@ -2310,24 +2300,24 @@ "type": "tidelift" } ], - "time": "2023-12-26T14:02:43+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/string", - "version": "v6.4.2", + "version": "v7.1.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc" + "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc", + "url": "https://api.github.com/repos/symfony/string/zipball/14221089ac66cf82e3cf3d1c1da65de305587ff8", + "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -2337,11 +2327,12 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2380,7 +2371,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.2" + "source": "https://github.com/symfony/string/tree/v7.1.2" }, "funding": [ { @@ -2396,20 +2387,20 @@ "type": "tidelift" } ], - "time": "2023-12-10T16:15:48+00:00" + "time": "2024-06-28T09:27:18+00:00" }, { "name": "symfony/translation", - "version": "v6.4.2", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681" + "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a2ab2ec1a462e53016de8e8d5e8912bfd62ea681", - "reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681", + "url": "https://api.github.com/repos/symfony/translation/zipball/a002933b13989fc4bd0b58e04bf7eec5210e438a", + "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a", "shasum": "" }, "require": { @@ -2432,7 +2423,7 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", "symfony/config": "^5.4|^6.0|^7.0", "symfony/console": "^5.4|^6.0|^7.0", @@ -2475,7 +2466,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.2" + "source": "https://github.com/symfony/translation/tree/v6.4.8" }, "funding": [ { @@ -2491,20 +2482,20 @@ "type": "tidelift" } ], - "time": "2023-12-18T09:25:29+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.4.1", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "06450585bf65e978026bda220cdebca3f867fde7" + "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/06450585bf65e978026bda220cdebca3f867fde7", - "reference": "06450585bf65e978026bda220cdebca3f867fde7", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", + "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", "shasum": "" }, "require": { @@ -2513,7 +2504,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -2553,7 +2544,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.4.1" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.0" }, "funding": [ { @@ -2569,20 +2560,20 @@ "type": "tidelift" } ], - "time": "2023-12-26T14:02:43+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.4.2", + "version": "v6.4.9", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "68d6573ec98715ddcae5a0a85bee3c1c27a4c33f" + "reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/68d6573ec98715ddcae5a0a85bee3c1c27a4c33f", - "reference": "68d6573ec98715ddcae5a0a85bee3c1c27a4c33f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c31566e4ca944271cc8d8ac6887cbf31b8c6a172", + "reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172", "shasum": "" }, "require": { @@ -2638,7 +2629,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.2" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.9" }, "funding": [ { @@ -2654,7 +2645,7 @@ "type": "tidelift" } ], - "time": "2023-12-28T19:16:56+00:00" + "time": "2024-06-27T13:23:14+00:00" }, { "name": "vlucas/phpdotenv", @@ -2860,16 +2851,16 @@ }, { "name": "webman/console", - "version": "v1.3.3", + "version": "v1.3.9", "source": { "type": "git", "url": "https://github.com/webman-php/console.git", - "reference": "3c1aa4a89afcda3e879adc99c09a56fcb5786c96" + "reference": "9ba334486b9c8dc6b88e98f423d8fedfe3d71d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webman-php/console/zipball/3c1aa4a89afcda3e879adc99c09a56fcb5786c96", - "reference": "3c1aa4a89afcda3e879adc99c09a56fcb5786c96", + "url": "https://api.github.com/repos/webman-php/console/zipball/9ba334486b9c8dc6b88e98f423d8fedfe3d71d45", + "reference": "9ba334486b9c8dc6b88e98f423d8fedfe3d71d45", "shasum": "" }, "require": { @@ -2909,20 +2900,20 @@ "source": "https://github.com/webman-php/console", "wiki": "http://www.workerman.net/doc/webman" }, - "time": "2023-12-07T03:56:07+00:00" + "time": "2024-06-12T01:30:26+00:00" }, { "name": "workerman/webman-framework", - "version": "v1.5.14", + "version": "v1.5.20", "source": { "type": "git", "url": "https://github.com/walkor/webman-framework.git", - "reference": "d9304dfa142b610f2ce307267a32ddbd0553e474" + "reference": "6fcbf1b2a2eb448a09d1cbe44fdc4deb1516f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/webman-framework/zipball/d9304dfa142b610f2ce307267a32ddbd0553e474", - "reference": "d9304dfa142b610f2ce307267a32ddbd0553e474", + "url": "https://api.github.com/repos/walkor/webman-framework/zipball/6fcbf1b2a2eb448a09d1cbe44fdc4deb1516f7f8", + "reference": "6fcbf1b2a2eb448a09d1cbe44fdc4deb1516f7f8", "shasum": "" }, "require": { @@ -2971,20 +2962,20 @@ "source": "https://github.com/walkor/webman-framework", "wiki": "https://doc.workerman.net/" }, - "time": "2024-01-03T07:32:40+00:00" + "time": "2024-07-04T07:12:58+00:00" }, { "name": "workerman/workerman", - "version": "v4.1.14", + "version": "v4.1.16", "source": { "type": "git", "url": "https://github.com/walkor/workerman.git", - "reference": "f7c9667c7b5387c01fa9e50ee79ed931e93ee76e" + "reference": "405d904d33026e19497dffc3d085bbc16e66534e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/workerman/zipball/f7c9667c7b5387c01fa9e50ee79ed931e93ee76e", - "reference": "f7c9667c7b5387c01fa9e50ee79ed931e93ee76e", + "url": "https://api.github.com/repos/walkor/workerman/zipball/405d904d33026e19497dffc3d085bbc16e66534e", + "reference": "405d904d33026e19497dffc3d085bbc16e66534e", "shasum": "" }, "require": { @@ -3034,7 +3025,7 @@ "type": "patreon" } ], - "time": "2023-08-09T03:37:45+00:00" + "time": "2024-07-04T08:26:39+00:00" } ], "packages-dev": [], diff --git a/config/jsonrpc.php b/config/jsonrpc.php index cbacbe4..f591c7f 100644 --- a/config/jsonrpc.php +++ b/config/jsonrpc.php @@ -9,7 +9,7 @@ return [ env('DEFAULT_RPC_SERVER', 'tcp://127.0.0.1:8021'), // rpc服务端的地址和端口 ], 'user' => [ - env('USER_RPC_SERVER', 'tcp://127.0.0.1:8022'), // rpc服务端的地址和端口 + env('USER_RPC_SERVER', 'tcp://127.0.0.1:8021'), // rpc服务端的地址和端口 ], // 'server2' => [ // /// ... diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 452fd47..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: "3.1" - -services: - webman-jsonrpc: - image: wandoubaba517/workerman:8.1 - container_name: webman-jsonrpc - network_mode: host - restart: always - volumes: - - ./:/app/service - - ./php.ini:/usr/local/etc/php/php.ini - working_dir: /app/service - stdin_open: true diff --git a/php b/php index f5816fc..7748ba6 100755 --- a/php +++ b/php @@ -1,3 +1,26 @@ #!/bin/bash -docker compose run --rm webman-jsonrpc php "$@" +# 获取脚本所在目录的绝对路径 +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) + +# 切换工作目录到脚本所在目录 +cd "$SCRIPT_DIR" || exit 1 + +# 使用heredoc构建docker run命令 +read -r -d '' DOCKER_COMMAND <<'EOF' +docker run --rm \ +--network host \ +-v "$(pwd)":/app/service \ +-v "$(pwd)/php.ini":/usr/local/etc/php/php.ini \ +-w /app/service \ +quay.io/wandoubaba517/workerman:8.2.20 \ +php +EOF + +# 检查是否有传递参数,并将它们附加到命令的末尾 +if [ $# -gt 0 ]; then + DOCKER_COMMAND+=" $@" +fi + +# 执行docker run命令 +eval "$DOCKER_COMMAND" \ No newline at end of file diff --git a/server b/server deleted file mode 100755 index e96e3f3..0000000 --- a/server +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -if [ -z "$1" ]; then - echo "Usage: $0 [start|stop|logs|restart|status|reload|connections]" - exit 1 -fi - -container_name="webman-jsonrpc" - -if [ "$1" = "stop" ]; then - if [ "$(docker inspect -f {{.State.Running}} $container_name 2>/dev/null)" = "true" ]; then - docker stop $container_name - else - echo "Container $container_name is not running." - fi -else - # 判断容器是否存在 - # if [ ! "$(docker ps -a -q -f name=$container_name)" ]; then - # # 调用init脚本 - # ./init - # fi - # 判断容器是否在运行 - if [ ! "$(docker inspect -f {{.State.Running}} $container_name 2>/dev/null)" = "true" ]; then - # 启动容器 - docker start $container_name - fi - if [ "$1" = "logs" ]; then - docker logs -f $container_name - elif [ "$1" = "start" ]; then - # docker exec -itd $container_name bash -c "php start.php start" - : - elif [ "$1" = "restart" ]; then - docker restart $container_name - elif [ "$1" = "status" ]; then - docker exec -it $container_name bash -c "php start.php status" - elif [ "$1" = "reload" ]; then - docker exec -it $container_name bash -c "php start.php reload" - elif [ "$1" = "connections" ]; then - docker exec -it $container_name bash -c "php start.php connections" - else - echo "Invalid command" - echo "Usage: $0 [start|stop|logs|restart|status|reload|connections]" - exit 1 - fi -fi diff --git a/support/helpers.php b/support/helpers.php index dc5db77..8de22c0 100644 --- a/support/helpers.php +++ b/support/helpers.php @@ -517,12 +517,12 @@ function cpu_count(): int } /** - * get GET or POST request parameters, if no parameter name is passed, an array of all values is returned, default values is supported + * Get request parameters, if no parameter name is passed, an array of all values is returned, default values is supported * @param string|null $param param's name - * @param string|null $default default value + * @param mixed|null $default default value * @return mixed|null */ -function input(string $param = null, string $default = null) +function input(string $param = null, $default = null) { return is_null($param) ? request()->all() : request()->input($param, $default); } diff --git a/webman b/webman index 69758c1..5bca7b2 100755 --- a/webman +++ b/webman @@ -27,9 +27,11 @@ if (is_dir($command_path = Util::guessPath(app_path(), '/command', true))) { foreach (config('plugin', []) as $firm => $projects) { if (isset($projects['app'])) { - if ($command_str = Util::guessPath(base_path() . "/plugin/$firm", 'command')) { - $command_path = base_path() . "/plugin/$firm/$command_str"; - $cli->installCommands($command_path, "plugin\\$firm\\$command_str"); + foreach (['', '/app'] as $app) { + if ($command_str = Util::guessPath(base_path() . "/plugin/$firm{$app}", 'command')) { + $command_path = base_path() . "/plugin/$firm{$app}/$command_str"; + $cli->installCommands($command_path, "plugin\\$firm" . str_replace('/', '\\', $app) . "\\$command_str"); + } } } foreach ($projects as $name => $project) {