升级wandoubaba/res支持php-di注入自定义错误码,升级illuminate系列库至版本10.x
This commit is contained in:
parent
b24b9bbd00
commit
c5150821b9
35
app/biz/ResCode.php
Normal file
35
app/biz/ResCode.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\biz;
|
||||||
|
|
||||||
|
class ResCode
|
||||||
|
{
|
||||||
|
const ERROR = 0; // 系统错误
|
||||||
|
const SUCCESS = 200; // 正确
|
||||||
|
const FAILED = -1; // 通用一般错误
|
||||||
|
const HEARTBEAT = 1; // 自定义1表示心跳消息,可忽略
|
||||||
|
const INTERNAL_ERROR = 500; // 500错误
|
||||||
|
const LOGIN_FAILED = 301; // 自定义301表示登录失败
|
||||||
|
const NOT_LOGGED = 306; // 自定义306表示未登录
|
||||||
|
const NOT_ALLOWED = 308; // 自定义308表示没有权限
|
||||||
|
const TOKEN_ERROR = 309; // 自定义309错误表示token失效
|
||||||
|
const TIMEOUT = 400; // 400超时
|
||||||
|
const NOT_FOUND = 404; // 404错误
|
||||||
|
const NO_DATA = 407; // 自定义407表示数据不存在
|
||||||
|
const NO_CHANGE = 408; // 自定义408表示无数据变化
|
||||||
|
|
||||||
|
const CODE_MESSAGES = [
|
||||||
|
self::ERROR => '内部错误',
|
||||||
|
self::SUCCESS => '操作成功',
|
||||||
|
self::FAILED => '操作失败',
|
||||||
|
self::NOT_LOGGED => '用户未登录',
|
||||||
|
self::HEARTBEAT => '心跳',
|
||||||
|
self::NOT_ALLOWED => '没有权限',
|
||||||
|
self::NOT_FOUND => '请求路径不正确',
|
||||||
|
self::INTERNAL_ERROR => '系统错误',
|
||||||
|
self::NO_DATA => '数据不存在',
|
||||||
|
self::LOGIN_FAILED => '登录失败',
|
||||||
|
self::NO_CHANGE => '无数据变化',
|
||||||
|
self::TOKEN_ERROR => '令牌无效',
|
||||||
|
self::TIMEOUT => '超时',
|
||||||
|
];
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\controller;
|
namespace app\controller;
|
||||||
|
|
||||||
|
use support\Container;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use Wandoubaba\Res;
|
use Wandoubaba\Res;
|
||||||
@ -10,7 +11,7 @@ class IndexController
|
|||||||
{
|
{
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$res = new Res();
|
$res = Container::make(Res::class);
|
||||||
$res1 = \jsonrpc\Client::service('default', 'Demo')->hello('Json');
|
$res1 = \jsonrpc\Client::service('default', 'Demo')->hello('Json');
|
||||||
$res2 = \jsonrpc\Client::service('user', 'User')->login('admin', '123456');
|
$res2 = \jsonrpc\Client::service('user', 'User')->login('admin', '123456');
|
||||||
$res3 = \jsonrpc\Client::service('default', 'Demo')->text();
|
$res3 = \jsonrpc\Client::service('default', 'Demo')->text();
|
||||||
|
329
composer.lock
generated
329
composer.lock
generated
@ -285,7 +285,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/bus",
|
"name": "illuminate/bus",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/bus.git",
|
"url": "https://github.com/illuminate/bus.git",
|
||||||
@ -338,7 +338,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/collections",
|
"name": "illuminate/collections",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/collections.git",
|
"url": "https://github.com/illuminate/collections.git",
|
||||||
@ -393,7 +393,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/conditionable",
|
"name": "illuminate/conditionable",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/conditionable.git",
|
"url": "https://github.com/illuminate/conditionable.git",
|
||||||
@ -439,7 +439,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/container",
|
"name": "illuminate/container",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/container.git",
|
"url": "https://github.com/illuminate/container.git",
|
||||||
@ -490,7 +490,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/contracts",
|
"name": "illuminate/contracts",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/contracts.git",
|
"url": "https://github.com/illuminate/contracts.git",
|
||||||
@ -538,7 +538,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/database",
|
"name": "illuminate/database",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/database.git",
|
"url": "https://github.com/illuminate/database.git",
|
||||||
@ -611,7 +611,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/events",
|
"name": "illuminate/events",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/events.git",
|
"url": "https://github.com/illuminate/events.git",
|
||||||
@ -666,7 +666,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/macroable",
|
"name": "illuminate/macroable",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/macroable.git",
|
"url": "https://github.com/illuminate/macroable.git",
|
||||||
@ -712,7 +712,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/pagination",
|
"name": "illuminate/pagination",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/pagination.git",
|
"url": "https://github.com/illuminate/pagination.git",
|
||||||
@ -762,7 +762,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/pipeline",
|
"name": "illuminate/pipeline",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/pipeline.git",
|
"url": "https://github.com/illuminate/pipeline.git",
|
||||||
@ -810,16 +810,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/redis",
|
"name": "illuminate/redis",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/redis.git",
|
"url": "https://github.com/illuminate/redis.git",
|
||||||
"reference": "69771c1ef8d76a0066d86e41f26598d6650eb79f"
|
"reference": "e0d81f4f9972b0b9dd416516a1f4c209939ef15a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/redis/zipball/69771c1ef8d76a0066d86e41f26598d6650eb79f",
|
"url": "https://api.github.com/repos/illuminate/redis/zipball/e0d81f4f9972b0b9dd416516a1f4c209939ef15a",
|
||||||
"reference": "69771c1ef8d76a0066d86e41f26598d6650eb79f",
|
"reference": "e0d81f4f9972b0b9dd416516a1f4c209939ef15a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -860,20 +860,20 @@
|
|||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2023-09-11T19:51:35+00:00"
|
"time": "2023-12-25T01:10:57+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/support",
|
"name": "illuminate/support",
|
||||||
"version": "v10.38.2",
|
"version": "v10.39.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/support.git",
|
"url": "https://github.com/illuminate/support.git",
|
||||||
"reference": "a9f486d76d5403b0c95b8532cd151a0a960f9565"
|
"reference": "6705007f24091863fefdf1f9320ac2c121cf37f1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/support/zipball/a9f486d76d5403b0c95b8532cd151a0a960f9565",
|
"url": "https://api.github.com/repos/illuminate/support/zipball/6705007f24091863fefdf1f9320ac2c121cf37f1",
|
||||||
"reference": "a9f486d76d5403b0c95b8532cd151a0a960f9565",
|
"reference": "6705007f24091863fefdf1f9320ac2c121cf37f1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -931,7 +931,67 @@
|
|||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2023-12-19T15:11:55+00:00"
|
"time": "2023-12-25T01:11:56+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "laravel/serializable-closure",
|
||||||
|
"version": "v1.3.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/laravel/serializable-closure.git",
|
||||||
|
"reference": "3dbf8a8e914634c48d389c1234552666b3d43754"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754",
|
||||||
|
"reference": "3dbf8a8e914634c48d389c1234552666b3d43754",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"nesbot/carbon": "^2.61",
|
||||||
|
"pestphp/pest": "^1.21.3",
|
||||||
|
"phpstan/phpstan": "^1.8.2",
|
||||||
|
"symfony/var-dumper": "^5.4.11"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Laravel\\SerializableClosure\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Nuno Maduro",
|
||||||
|
"email": "nuno@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.",
|
||||||
|
"keywords": [
|
||||||
|
"closure",
|
||||||
|
"laravel",
|
||||||
|
"serializable"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/serializable-closure/issues",
|
||||||
|
"source": "https://github.com/laravel/serializable-closure"
|
||||||
|
},
|
||||||
|
"time": "2023-11-08T14:08:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "monolog/monolog",
|
"name": "monolog/monolog",
|
||||||
@ -1192,6 +1252,134 @@
|
|||||||
},
|
},
|
||||||
"time": "2018-02-13T20:26:39+00:00"
|
"time": "2018-02-13T20:26:39+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "php-di/invoker",
|
||||||
|
"version": "2.3.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/PHP-DI/Invoker.git",
|
||||||
|
"reference": "33234b32dafa8eb69202f950a1fc92055ed76a86"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/33234b32dafa8eb69202f950a1fc92055ed76a86",
|
||||||
|
"reference": "33234b32dafa8eb69202f950a1fc92055ed76a86",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.3",
|
||||||
|
"psr/container": "^1.0|^2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"athletic/athletic": "~0.1.8",
|
||||||
|
"mnapoli/hard-mode": "~0.3.0",
|
||||||
|
"phpunit/phpunit": "^9.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Invoker\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "Generic and extensible callable invoker",
|
||||||
|
"homepage": "https://github.com/PHP-DI/Invoker",
|
||||||
|
"keywords": [
|
||||||
|
"callable",
|
||||||
|
"dependency",
|
||||||
|
"dependency-injection",
|
||||||
|
"injection",
|
||||||
|
"invoke",
|
||||||
|
"invoker"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/PHP-DI/Invoker/issues",
|
||||||
|
"source": "https://github.com/PHP-DI/Invoker/tree/2.3.4"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/mnapoli",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-09-08T09:24:21+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "php-di/php-di",
|
||||||
|
"version": "7.0.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/PHP-DI/PHP-DI.git",
|
||||||
|
"reference": "8097948a89f6ec782839b3e958432f427cac37fd"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/8097948a89f6ec782839b3e958432f427cac37fd",
|
||||||
|
"reference": "8097948a89f6ec782839b3e958432f427cac37fd",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"laravel/serializable-closure": "^1.0",
|
||||||
|
"php": ">=8.0",
|
||||||
|
"php-di/invoker": "^2.0",
|
||||||
|
"psr/container": "^1.1 || ^2.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/container-implementation": "^1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^3",
|
||||||
|
"friendsofphp/proxy-manager-lts": "^1",
|
||||||
|
"mnapoli/phpunit-easymock": "^1.3",
|
||||||
|
"phpunit/phpunit": "^9.5",
|
||||||
|
"vimeo/psalm": "^4.6"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"friendsofphp/proxy-manager-lts": "Install it if you want to use lazy injection (version ^1)"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/functions.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"DI\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "The dependency injection container for humans",
|
||||||
|
"homepage": "https://php-di.org/",
|
||||||
|
"keywords": [
|
||||||
|
"PSR-11",
|
||||||
|
"container",
|
||||||
|
"container-interop",
|
||||||
|
"dependency injection",
|
||||||
|
"di",
|
||||||
|
"ioc",
|
||||||
|
"psr11"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/PHP-DI/PHP-DI/issues",
|
||||||
|
"source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.6"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/mnapoli",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/php-di/php-di",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-11-02T10:04:50+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "phpoption/phpoption",
|
"name": "phpoption/phpoption",
|
||||||
"version": "1.9.2",
|
"version": "1.9.2",
|
||||||
@ -1471,16 +1659,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/console",
|
"name": "symfony/console",
|
||||||
"version": "v6.4.1",
|
"version": "v6.4.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/console.git",
|
"url": "https://github.com/symfony/console.git",
|
||||||
"reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd"
|
"reference": "0254811a143e6bc6c8deea08b589a7e68a37f625"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/console/zipball/a550a7c99daeedef3f9d23fb82e3531525ff11fd",
|
"url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625",
|
||||||
"reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd",
|
"reference": "0254811a143e6bc6c8deea08b589a7e68a37f625",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1545,7 +1733,7 @@
|
|||||||
"terminal"
|
"terminal"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/console/tree/v6.4.1"
|
"source": "https://github.com/symfony/console/tree/v6.4.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -1561,7 +1749,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-11-30T10:54:28+00:00"
|
"time": "2023-12-10T16:15:48+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
@ -2045,21 +2233,21 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/service-contracts",
|
"name": "symfony/service-contracts",
|
||||||
"version": "v3.4.0",
|
"version": "v3.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/service-contracts.git",
|
"url": "https://github.com/symfony/service-contracts.git",
|
||||||
"reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838"
|
"reference": "fe07cbc8d837f60caf7018068e350cc5163681a0"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
|
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0",
|
||||||
"reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
|
"reference": "fe07cbc8d837f60caf7018068e350cc5163681a0",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"psr/container": "^2.0"
|
"psr/container": "^1.1|^2.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"ext-psr": "<1.1|>=2"
|
"ext-psr": "<1.1|>=2"
|
||||||
@ -2107,7 +2295,7 @@
|
|||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/service-contracts/tree/v3.4.0"
|
"source": "https://github.com/symfony/service-contracts/tree/v3.4.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2123,20 +2311,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-07-30T20:28:31+00:00"
|
"time": "2023-12-26T14:02:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/string",
|
"name": "symfony/string",
|
||||||
"version": "v6.4.0",
|
"version": "v6.4.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/string.git",
|
"url": "https://github.com/symfony/string.git",
|
||||||
"reference": "b45fcf399ea9c3af543a92edf7172ba21174d809"
|
"reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/string/zipball/b45fcf399ea9c3af543a92edf7172ba21174d809",
|
"url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc",
|
||||||
"reference": "b45fcf399ea9c3af543a92edf7172ba21174d809",
|
"reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2193,7 +2381,7 @@
|
|||||||
"utf8"
|
"utf8"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/string/tree/v6.4.0"
|
"source": "https://github.com/symfony/string/tree/v6.4.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2209,20 +2397,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-11-28T20:41:49+00:00"
|
"time": "2023-12-10T16:15:48+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/translation",
|
"name": "symfony/translation",
|
||||||
"version": "v6.4.0",
|
"version": "v6.4.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/translation.git",
|
"url": "https://github.com/symfony/translation.git",
|
||||||
"reference": "b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37"
|
"reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/translation/zipball/b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37",
|
"url": "https://api.github.com/repos/symfony/translation/zipball/a2ab2ec1a462e53016de8e8d5e8912bfd62ea681",
|
||||||
"reference": "b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37",
|
"reference": "a2ab2ec1a462e53016de8e8d5e8912bfd62ea681",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2288,7 +2476,7 @@
|
|||||||
"description": "Provides tools to internationalize your application",
|
"description": "Provides tools to internationalize your application",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/translation/tree/v6.4.0"
|
"source": "https://github.com/symfony/translation/tree/v6.4.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2304,20 +2492,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-11-29T08:14:36+00:00"
|
"time": "2023-12-18T09:25:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/translation-contracts",
|
"name": "symfony/translation-contracts",
|
||||||
"version": "v3.4.0",
|
"version": "v3.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/translation-contracts.git",
|
"url": "https://github.com/symfony/translation-contracts.git",
|
||||||
"reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5"
|
"reference": "06450585bf65e978026bda220cdebca3f867fde7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dee0c6e5b4c07ce851b462530088e64b255ac9c5",
|
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/06450585bf65e978026bda220cdebca3f867fde7",
|
||||||
"reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5",
|
"reference": "06450585bf65e978026bda220cdebca3f867fde7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2366,7 +2554,7 @@
|
|||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/translation-contracts/tree/v3.4.0"
|
"source": "https://github.com/symfony/translation-contracts/tree/v3.4.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2382,20 +2570,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-07-25T15:08:44+00:00"
|
"time": "2023-12-26T14:02:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/var-dumper",
|
"name": "symfony/var-dumper",
|
||||||
"version": "v6.4.0",
|
"version": "v6.4.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/var-dumper.git",
|
"url": "https://github.com/symfony/var-dumper.git",
|
||||||
"reference": "c40f7d17e91d8b407582ed51a2bbf83c52c367f6"
|
"reference": "68d6573ec98715ddcae5a0a85bee3c1c27a4c33f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c40f7d17e91d8b407582ed51a2bbf83c52c367f6",
|
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/68d6573ec98715ddcae5a0a85bee3c1c27a4c33f",
|
||||||
"reference": "c40f7d17e91d8b407582ed51a2bbf83c52c367f6",
|
"reference": "68d6573ec98715ddcae5a0a85bee3c1c27a4c33f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2451,7 +2639,7 @@
|
|||||||
"dump"
|
"dump"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/var-dumper/tree/v6.4.0"
|
"source": "https://github.com/symfony/var-dumper/tree/v6.4.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2467,7 +2655,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-11-09T08:28:32+00:00"
|
"time": "2023-12-28T19:16:56+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vlucas/phpdotenv",
|
"name": "vlucas/phpdotenv",
|
||||||
@ -2629,23 +2817,24 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "wandoubaba/res",
|
"name": "wandoubaba/res",
|
||||||
"version": "v1.0.4",
|
"version": "v1.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/wandoubaba/res.git",
|
"url": "https://github.com/wandoubaba/res.git",
|
||||||
"reference": "679dfee8fa357bc98fe6c585e12a01994aee0046"
|
"reference": "abcbdb34400cc5f151f689b392901d8ca2b9a275"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/wandoubaba/res/zipball/679dfee8fa357bc98fe6c585e12a01994aee0046",
|
"url": "https://api.github.com/repos/wandoubaba/res/zipball/abcbdb34400cc5f151f689b392901d8ca2b9a275",
|
||||||
"reference": "679dfee8fa357bc98fe6c585e12a01994aee0046",
|
"reference": "abcbdb34400cc5f151f689b392901d8ca2b9a275",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.4"
|
"php": ">=7.4",
|
||||||
|
"php-di/php-di": "^7.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^10.4"
|
"phpunit/phpunit": "^9.6"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -2666,9 +2855,9 @@
|
|||||||
"description": "一个简单的Res模型,包含code、msg、data属性,可用于HTTP接口的返回值",
|
"description": "一个简单的Res模型,包含code、msg、data属性,可用于HTTP接口的返回值",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/wandoubaba/res/issues",
|
"issues": "https://github.com/wandoubaba/res/issues",
|
||||||
"source": "https://github.com/wandoubaba/res/tree/v1.0.4"
|
"source": "https://github.com/wandoubaba/res/tree/v1.1.1"
|
||||||
},
|
},
|
||||||
"time": "2023-10-18T08:08:05+00:00"
|
"time": "2024-01-03T06:48:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "webman/console",
|
"name": "webman/console",
|
||||||
@ -2725,16 +2914,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "workerman/webman-framework",
|
"name": "workerman/webman-framework",
|
||||||
"version": "v1.5.13",
|
"version": "v1.5.14",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/walkor/webman-framework.git",
|
"url": "https://github.com/walkor/webman-framework.git",
|
||||||
"reference": "699c9c9509d472679fa1d8461b9a9bb58fbe79a7"
|
"reference": "d9304dfa142b610f2ce307267a32ddbd0553e474"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/walkor/webman-framework/zipball/699c9c9509d472679fa1d8461b9a9bb58fbe79a7",
|
"url": "https://api.github.com/repos/walkor/webman-framework/zipball/d9304dfa142b610f2ce307267a32ddbd0553e474",
|
||||||
"reference": "699c9c9509d472679fa1d8461b9a9bb58fbe79a7",
|
"reference": "d9304dfa142b610f2ce307267a32ddbd0553e474",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2783,7 +2972,7 @@
|
|||||||
"source": "https://github.com/walkor/webman-framework",
|
"source": "https://github.com/walkor/webman-framework",
|
||||||
"wiki": "https://doc.workerman.net/"
|
"wiki": "https://doc.workerman.net/"
|
||||||
},
|
},
|
||||||
"time": "2023-11-16T04:06:19+00:00"
|
"time": "2024-01-03T07:32:40+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "workerman/workerman",
|
"name": "workerman/workerman",
|
||||||
|
@ -12,4 +12,10 @@
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return new Webman\Container;
|
// return new Webman\Container;
|
||||||
|
|
||||||
|
$builder = new \DI\ContainerBuilder();
|
||||||
|
$builder->addDefinitions(config('dependence', []));
|
||||||
|
$builder->useAutowiring(true);
|
||||||
|
$builder->useAttributes(true);
|
||||||
|
return $builder->build();
|
@ -12,4 +12,7 @@
|
|||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [];
|
return [
|
||||||
|
// 注入自定义错误码和错误提示
|
||||||
|
'code_messages' => app\biz\ResCode::CODE_MESSAGES,
|
||||||
|
];
|
@ -380,7 +380,7 @@ function copy_dir(string $source, string $dest, bool $overwrite = false)
|
|||||||
$files = scandir($source);
|
$files = scandir($source);
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if ($file !== "." && $file !== "..") {
|
if ($file !== "." && $file !== "..") {
|
||||||
copy_dir("$source/$file", "$dest/$file");
|
copy_dir("$source/$file", "$dest/$file", $overwrite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (file_exists($source) && ($overwrite || !file_exists($dest))) {
|
} else if (file_exists($source) && ($overwrite || !file_exists($dest))) {
|
||||||
@ -515,3 +515,14 @@ function cpu_count(): int
|
|||||||
}
|
}
|
||||||
return $count > 0 ? $count : 4;
|
return $count > 0 ? $count : 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get GET or POST 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
|
||||||
|
* @return mixed|null
|
||||||
|
*/
|
||||||
|
function input(string $param = null, string $default = null)
|
||||||
|
{
|
||||||
|
return is_null($param) ? request()->all() : request()->input($param, $default);
|
||||||
|
}
|
||||||
|
@ -61,6 +61,7 @@ function write_process_file($runtimeProcessPath, $processName, $firm): string
|
|||||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||||
|
|
||||||
use Workerman\Worker;
|
use Workerman\Worker;
|
||||||
|
use Workerman\Connection\TcpConnection;
|
||||||
use Webman\Config;
|
use Webman\Config;
|
||||||
use support\App;
|
use support\App;
|
||||||
|
|
||||||
@ -77,6 +78,7 @@ worker_start('$processParam', $configParam);
|
|||||||
|
|
||||||
if (DIRECTORY_SEPARATOR != "/") {
|
if (DIRECTORY_SEPARATOR != "/") {
|
||||||
Worker::\$logFile = config('server')['log_file'] ?? Worker::\$logFile;
|
Worker::\$logFile = config('server')['log_file'] ?? Worker::\$logFile;
|
||||||
|
TcpConnection::\$defaultMaxPackageSize = config('server')['max_package_size'] ?? 10*1024*1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
Worker::runAll();
|
Worker::runAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user