diff --git a/README.md b/README.md
index 147ffbf..4031784 100644
--- a/README.md
+++ b/README.md
@@ -1,121 +1,70 @@
-# 基于docker的webman
+
+
webman
-我们在php:8.1.27-cli基础上安装了运行webman必要的一些扩展和开发中常用的扩展,以及composer,制作成workerman:8.1.27镜像,因此在开发环境中不需要再额外配置php环境,直接写业务代码即可。
+基于
workerman开发的超高性能PHP框架
-> 把镜像的tag换成8.2.20即可把php版本换成8.2.20
-## 依赖
+
学习
-只要系统环境中有docker即可(生产环境需要docker-compose),不需要安装php环境。
+
-## 使用方法
+
-```sh
-# composer
-./composer require xxxx
-# 启动服务
-./php start.php start
-# 执行其它php命令
-./php -m
-./php webman build:bin
-```
+
赞助商
-## 生产环境使用
+
特别赞助
+
+
+
-创建一个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扩展
+
请作者喝咖啡
+
+

+

+
+
如果您觉得webman对您有所帮助,欢迎捐赠。
+
+
+
+
+
+
+
LICENSE
+The webman is open-sourced software licensed under the MIT.
+
+
+
-```sh
-php -m
-[PHP Modules]
-bcmath
-Core
-ctype
-curl
-date
-dom
-event
-exif
-fileinfo
-filter
-ftp
-gd
-gmp
-hash
-iconv
-imagick
-json
-libxml
-mbstring
-mongodb
-mysqli
-mysqlnd
-openssl
-pcntl
-pcre
-PDO
-pdo_mysql
-pdo_pgsql
-pdo_sqlite
-pgsql
-Phar
-posix
-readline
-redis
-Reflection
-session
-SimpleXML
-sockets
-sodium
-SPL
-sqlite3
-standard
-tokenizer
-xlswriter
-xml
-xmlreader
-xmlwriter
-Zend OPcache
-zip
-zlib
-zookeeper
-[Zend Modules]
-Zend OPcache
-```
diff --git a/app/process/Monitor.php b/app/process/Monitor.php
index 4fab730..399ce62 100644
--- a/app/process/Monitor.php
+++ b/app/process/Monitor.php
@@ -42,18 +42,13 @@ class Monitor
*/
protected $loadedFiles = [];
- /**
- * @var string
- */
- public static $lockFile = __DIR__ . '/../runtime/monitor.lock';
-
/**
* Pause monitor
* @return void
*/
public static function pause()
{
- file_put_contents(static::$lockFile, time());
+ file_put_contents(static::lockFile(), time());
}
/**
@@ -63,8 +58,8 @@ class Monitor
public static function resume(): void
{
clearstatcache();
- if (is_file(static::$lockFile)) {
- unlink(static::$lockFile);
+ if (is_file(static::lockFile())) {
+ unlink(static::lockFile());
}
}
@@ -75,7 +70,16 @@ class Monitor
public static function isPaused(): bool
{
clearstatcache();
- return file_exists(static::$lockFile);
+ return file_exists(static::lockFile());
+ }
+
+ /**
+ * Lock file
+ * @return string
+ */
+ protected static function lockFile(): string
+ {
+ return runtime_path('monitor.lock');
}
/**
diff --git a/composer.json b/composer.json
index f6617e2..d25c083 100644
--- a/composer.json
+++ b/composer.json
@@ -24,10 +24,9 @@
"source": "https://github.com/walkor/webman"
},
"require": {
- "php": ">=7.2",
- "workerman/webman-framework": "^1.6.6",
- "monolog/monolog": "^2.0",
- "workerman/workerman": "^4.2.1"
+ "php": ">=8.1",
+ "workerman/webman-framework": "^2.1",
+ "monolog/monolog": "^2.0"
},
"suggest": {
"ext-event": "For better performance. "
@@ -38,10 +37,7 @@
"app\\": "./app",
"App\\": "./app",
"app\\View\\Components\\": "./app/view/components"
- },
- "files": [
- "./support/helpers.php"
- ]
+ }
},
"scripts": {
"post-package-install": [
diff --git a/composer.lock b/composer.lock
index 5f642e0..8265136 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "afbf9db9e4592c74428dc015992026ea",
+ "content-hash": "691f538563ac6695008ddc51b7722c80",
"packages": [
{
"name": "monolog/monolog",
@@ -18,13 +18,7 @@
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7",
"reference": "5cf826f2991858b54d5c3809bee745560a1042a7",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"php": ">=7.2",
@@ -126,13 +120,7 @@
"type": "zip",
"url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812",
"reference": "181d480e08d9476e61381e04a71b34dc0432e812",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"php": ">=5.4.0"
@@ -182,13 +170,7 @@
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
"reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "shasum": ""
},
"require": {
"php": ">=7.4.0"
@@ -231,23 +213,17 @@
},
{
"name": "psr/log",
- "version": "3.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "79dff0b268932c640297f5208d6298f71855c03e"
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/79dff0b268932c640297f5208d6298f71855c03e",
- "reference": "79dff0b268932c640297f5208d6298f71855c03e",
- "shasum": "",
- "mirrors": [
- {
- "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
- "preferred": true
- }
- ]
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "shasum": ""
},
"require": {
"php": ">=8.0.0"
@@ -281,31 +257,79 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/3.0.1"
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
},
- "time": "2024-08-21T13:31:24+00:00"
+ "time": "2024-09-11T13:17:53+00:00"
+ },
+ {
+ "name": "workerman/coroutine",
+ "version": "v1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/workerman-php/coroutine.git",
+ "reference": "df8fc428967d512a74a8a7d80355c1d40228c9fa"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/workerman-php/coroutine/zipball/df8fc428967d512a74a8a7d80355c1d40228c9fa",
+ "reference": "df8fc428967d512a74a8a7d80355c1d40228c9fa",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^11.0",
+ "psr/log": "*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Workerman\\": "src",
+ "Workerman\\Coroutine\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Workerman coroutine",
+ "support": {
+ "issues": "https://github.com/workerman-php/coroutine/issues",
+ "source": "https://github.com/workerman-php/coroutine/tree/v1.1.3"
+ },
+ "time": "2025-02-17T03:34:21+00:00"
},
{
"name": "workerman/webman-framework",
- "version": "v1.6.6",
+ "version": "v2.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/walkor/webman-framework.git",
+ "reference": "f803bd867f07bb0929faef060b59a19a44186bfc"
+ },
"dist": {
"type": "zip",
- "url": "https://mirrors.cloud.tencent.com/repository/composer/workerman/webman-framework/v1.6.6/workerman-webman-framework-v1.6.6.zip",
- "reference": "9a89995796acff015d303f3a7eda62e0a6a5a361",
+ "url": "https://api.github.com/repos/walkor/webman-framework/zipball/f803bd867f07bb0929faef060b59a19a44186bfc",
+ "reference": "f803bd867f07bb0929faef060b59a19a44186bfc",
"shasum": ""
},
"require": {
"ext-json": "*",
"nikic/fast-route": "^1.3",
- "php": ">=8.0",
+ "php": ">=8.1",
"psr/container": ">=1.0",
- "workerman/workerman": "^4.2.1 || ^5.0.0 || dev-master"
+ "psr/log": "^3.0",
+ "workerman/workerman": "^5.1 || dev-master"
},
"suggest": {
"ext-event": "For better performance. "
},
"type": "library",
"autoload": {
+ "files": [
+ "./src/support/helpers.php"
+ ],
"psr-4": {
"Webman\\": "./src",
"Support\\": "./src/support",
@@ -315,6 +339,7 @@
"Support\\Exception\\": "./src/support/exception"
}
},
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -332,19 +357,42 @@
"High Performance",
"http service"
],
- "time": "2024-11-25T06:39:00+00:00"
+ "support": {
+ "email": "walkor@workerman.net",
+ "forum": "https://wenda.workerman.net/",
+ "issues": "https://github.com/walkor/webman/issues",
+ "source": "https://github.com/walkor/webman-framework",
+ "wiki": "https://doc.workerman.net/"
+ },
+ "time": "2025-03-10T11:52:22+00:00"
},
{
"name": "workerman/workerman",
- "version": "v4.2.1",
+ "version": "v5.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/walkor/workerman.git",
+ "reference": "72cafa19e488896abd2576ea67b3b1af1abf71c0"
+ },
"dist": {
"type": "zip",
- "url": "https://mirrors.cloud.tencent.com/repository/composer/workerman/workerman/v4.2.1/workerman-workerman-v4.2.1.zip",
- "reference": "cafb5a43d93d7d30a16b32a57948581cca993562",
+ "url": "https://api.github.com/repos/walkor/workerman/zipball/72cafa19e488896abd2576ea67b3b1af1abf71c0",
+ "reference": "72cafa19e488896abd2576ea67b3b1af1abf71c0",
"shasum": ""
},
"require": {
- "php": ">=8.0"
+ "ext-json": "*",
+ "php": ">=8.1",
+ "workerman/coroutine": "^1.1 || dev-main"
+ },
+ "conflict": {
+ "ext-swow": "