mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore.git
synced 2026-01-15 05:35:09 +08:00
Compare commits
180 Commits
v0.1.9
...
v1.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68451820b0 | ||
|
|
55da02080e | ||
|
|
0f7b9464c9 | ||
|
|
bf40c6e681 | ||
|
|
9a8575b382 | ||
|
|
c6ab9db698 | ||
|
|
2e0e4feaa5 | ||
|
|
c8b454540d | ||
|
|
bb11a1d8f4 | ||
|
|
b4dcd01e8d | ||
|
|
3b3502f763 | ||
|
|
768f2d79c0 | ||
|
|
225bdedd23 | ||
|
|
aaa4382ff2 | ||
|
|
9a296c56e9 | ||
|
|
2dace65933 | ||
|
|
e8596c9d30 | ||
|
|
b6dd7dd4ac | ||
|
|
0283c7286a | ||
|
|
e4105a285f | ||
|
|
d20718db32 | ||
|
|
d524fb4e89 | ||
|
|
eeab8a258d | ||
|
|
bac22a8ea6 | ||
|
|
44c26b6491 | ||
|
|
f422fb6b31 | ||
|
|
762acbb368 | ||
|
|
2167fd209a | ||
|
|
fc9b41ef78 | ||
|
|
da518799b3 | ||
|
|
4d8a918898 | ||
|
|
cfbb770559 | ||
|
|
01aa833537 | ||
|
|
c02a08ca6b | ||
|
|
a84b812dd0 | ||
|
|
6eacde9970 | ||
|
|
7d6dc7fe9f | ||
|
|
97131d224c | ||
|
|
08d00a785f | ||
|
|
16f69c193c | ||
|
|
b89b218eaa | ||
|
|
14d28deee2 | ||
|
|
cbc59ccf74 | ||
|
|
f34b2c9e21 | ||
|
|
eee68cab8a | ||
|
|
c93ed73f10 | ||
|
|
97848a5e22 | ||
|
|
b7d0dd87c5 | ||
|
|
26b55f1ca5 | ||
|
|
6ca5462195 | ||
|
|
8e4f4d0d29 | ||
|
|
df94317fcf | ||
|
|
43c820c711 | ||
|
|
f1957b5156 | ||
|
|
418f4c47c9 | ||
|
|
635804e117 | ||
|
|
82d9a95691 | ||
|
|
063c1d7ea1 | ||
|
|
9cdbd6a2c8 | ||
|
|
4cc1473d38 | ||
|
|
895b028017 | ||
|
|
094589b87e | ||
|
|
85ae11e295 | ||
|
|
6cb24a84b2 | ||
|
|
118f0b789f | ||
|
|
7dfb3933f6 | ||
|
|
b32afe38b4 | ||
|
|
a46659f62b | ||
|
|
f80da66185 | ||
|
|
4e5b0fdbb4 | ||
|
|
17c0518680 | ||
|
|
37d42c17cc | ||
|
|
12e99604c9 | ||
|
|
217178003a | ||
|
|
359b13e718 | ||
|
|
e9927fafb1 | ||
|
|
02655228ae | ||
|
|
9f7d4effb7 | ||
|
|
5980ea773b | ||
|
|
110679448f | ||
|
|
64f936ab36 | ||
|
|
2afc3ad45b | ||
|
|
cff919a21e | ||
|
|
2d6d12e1c3 | ||
|
|
73420153d3 | ||
|
|
fcb0cd8852 | ||
|
|
7a209e876f | ||
|
|
4032d67f1e | ||
|
|
dbbe278aa6 | ||
|
|
d84855f038 | ||
|
|
2d95fbae9e | ||
|
|
3042ce0054 | ||
|
|
b30c84488b | ||
|
|
c262d38ad0 | ||
|
|
a8ec7d8255 | ||
|
|
f1948ab0fe | ||
|
|
ae8001a595 | ||
|
|
68844a6132 | ||
|
|
fd788a7eb8 | ||
|
|
7ccf36b398 | ||
|
|
3d86b05fff | ||
|
|
722d124e1e | ||
|
|
5702e7f913 | ||
|
|
a6ec6951a9 | ||
|
|
a52fc28901 | ||
|
|
2b0374bcc8 | ||
|
|
8616c5f61c | ||
|
|
aee67d78fc | ||
|
|
8974ee595b | ||
|
|
205554068d | ||
|
|
648fe6c8f3 | ||
|
|
c0aa128dd0 | ||
|
|
c748cbd3e3 | ||
|
|
43ebd0546a | ||
|
|
200a98293a | ||
|
|
be818b7080 | ||
|
|
d22bd3ee58 | ||
|
|
0f9cae0288 | ||
|
|
0247dd415c | ||
|
|
77f3141c56 | ||
|
|
2a59a51f8b | ||
|
|
5e5792b28c | ||
|
|
a6b71dbb03 | ||
|
|
d836186296 | ||
|
|
e69c1494c3 | ||
|
|
11315aa109 | ||
|
|
90a521f90a | ||
|
|
db31689f66 | ||
|
|
7e5cb89dfe | ||
|
|
4ba0cb83f5 | ||
|
|
c25e6eed52 | ||
|
|
2ee20984ce | ||
|
|
859a1a1f2a | ||
|
|
78b56a6aa9 | ||
|
|
c991c31260 | ||
|
|
1e4158639f | ||
|
|
70ad3078b1 | ||
|
|
afec642454 | ||
|
|
b2debf9c13 | ||
|
|
d7c902d697 | ||
|
|
de96e288c3 | ||
|
|
7c1efe1a1f | ||
|
|
e33c115938 | ||
|
|
b8c3d6d068 | ||
|
|
2d2148f3ec | ||
|
|
2d2a535fd2 | ||
|
|
a618af5ab3 | ||
|
|
28e0ceed11 | ||
|
|
c8f9b793ee | ||
|
|
bf0dc896e4 | ||
|
|
a729270fac | ||
|
|
099ab60103 | ||
|
|
e41847a234 | ||
|
|
9026a3e0f0 | ||
|
|
5151787982 | ||
|
|
b65818bfb6 | ||
|
|
1dbad8e5a6 | ||
|
|
5a1a2a89bd | ||
|
|
8757908f3f | ||
|
|
73401d7cb1 | ||
|
|
d1bae3e623 | ||
|
|
3d092074b3 | ||
|
|
427ba4b322 | ||
|
|
aeddb55988 | ||
|
|
0705d1bef3 | ||
|
|
922c780c49 | ||
|
|
cdb193778f | ||
|
|
9633fa6b8d | ||
|
|
08c1f6609c | ||
|
|
3a1f2695fe | ||
|
|
50885c57e2 | ||
|
|
9f9ff31a83 | ||
|
|
990c247cf6 | ||
|
|
3989f5913e | ||
|
|
ab44630db8 | ||
|
|
3bc4e275a7 | ||
|
|
82e257f7b4 | ||
|
|
480f406ccc | ||
|
|
91db3c731f | ||
|
|
9fedbb40f4 |
49
.devcontainer/devcontainer.json
Normal file
49
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "Hyperf Development Kit Core Dev Container",
|
||||
"image": "harbor.luxcreo.cn/library/hyperf:8.1-swoole",
|
||||
// 基础配置
|
||||
"workspaceFolder": "/srv/www", // 对应 --workdir
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/srv/www,type=bind", // 主工作区挂载
|
||||
// 附加挂载
|
||||
"mounts": [
|
||||
"source=${env:HOME}/.ssh,target=/root/.ssh,type=bind", // SSH 密钥挂载
|
||||
"source=${env:HOME}/.gitconfig,target=/root/.gitconfig,type=bind" // SSH 密钥挂载
|
||||
],
|
||||
// 容器生命周期
|
||||
"shutdownAction": "stopContainer", // 类似 --rm 的清理行为
|
||||
"updateRemoteUserUID": true, // 确保用户 ID 同步
|
||||
// 保留的必要 runArgs
|
||||
"runArgs": [
|
||||
"--pull=always", // 强制拉取最新镜像
|
||||
"--name=hdk-core" // 容器命名(需保持唯一性)
|
||||
],
|
||||
// 初始化命令
|
||||
"postCreateCommand": "echo 'Container initialized!'",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"rid9.datetime",
|
||||
"MS-CEINTL.vscode-language-pack-zh-hans",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"janisdd.vscode-edit-csv",
|
||||
"onecentlin.laravel-blade",
|
||||
"DavidWang.ini-for-vscode",
|
||||
"bmewburn.vscode-intelephense-client",
|
||||
"mechatroner.rainbow-csv",
|
||||
"Alibaba-Cloud.tongyi-lingma",
|
||||
"atommaterial.a-file-icon-vscode",
|
||||
"ParthR2031.colorful-comments",
|
||||
"vincaslt.highlight-matching-tag",
|
||||
"xabikos.JavaScriptSnippets",
|
||||
"shufo.vscode-blade-formatter",
|
||||
"dansysanalyst.pest-snippets",
|
||||
"m1guelpf.better-pest",
|
||||
"xoronic.pestfile",
|
||||
"xdebug.php-debug",
|
||||
"golang.go",
|
||||
"cweijan.vscode-typora",
|
||||
"ciceroisback.loam"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
28
.gitea/workflows/publish_on_tagged.yml
Normal file
28
.gitea/workflows/publish_on_tagged.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Release development version to registry
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**.**'
|
||||
|
||||
jobs:
|
||||
Publish on Tagged:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||
- name: List files in the repository
|
||||
run: |
|
||||
ls ${{ gitea.workspace }}
|
||||
- name: Zip files in the repository
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install zip
|
||||
zip -r hdk-core.dist.zip *
|
||||
- name: Publish to registry
|
||||
run: |
|
||||
curl --user ch4o5:4fd300672472e666014314c1c94c604c634165a9 \
|
||||
--upload-file ./hdk-core.dist.zip \
|
||||
https://nest.doylee.cn/api/packages/HDK/composer?version=${{ gitea.ref_name }}-alpha
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
vendor/
|
||||
.phpunit.result.cache
|
||||
.php-cs-fixer.cache
|
||||
.php-cs-fixer.cache
|
||||
runtime/
|
||||
299
.idea/HDK-Core.iml
generated
299
.idea/HDK-Core.iml
generated
@@ -2,147 +2,194 @@
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="Singularity\HDK\Core\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Singularity\HDK\Test\Core\" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-xml" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/runtime" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/credentials" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/darabonba-openapi" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/endpoint-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/gateway-spi" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/openapi-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-utils" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/gateway-spi" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/endpoint-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/credentials" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/justinrainbow/json-schema" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-xml" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fig/http-message-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lmc/http-constants" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-handler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-middleware" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/phar-utils" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/jsonlint" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/signal-handler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/fast-route" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/promise" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/roave/dont" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/database" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/contract" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/di" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/context" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/logger" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-server" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/translation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/framework" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/config" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/redis" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/constants" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/server" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/utils" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-message" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/exception-handler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/macroable" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/paginator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/event" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/validation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/session" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/teapot/status-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ergebnis/http-method" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fig/http-message-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/firebase/php-jwt" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofphp/php-cs-fixer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/code-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/codec" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/collection" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/conditionable" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/config" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/constants" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/context" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/contract" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/coordinator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/coroutine" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/crontab" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/database" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/db" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/di" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/engine-contract" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/event" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/exception-handler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/framework" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/guzzle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-message" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/http-server" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/logger" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/macroable" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/paginator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pipeline" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/pool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/redis" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/serializer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/server" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/session" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/stringable" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/support" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/tappable" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/translation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/utils" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/validation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jetbrains/phpstorm-attributes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/justinrainbow/json-schema" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/laminas/laminas-mime" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/laminas/laminas-stdlib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php73" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php81" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/annotations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ergebnis/http-method" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/firebase/php-jwt" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jetbrains/phpstorm-attributes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lizhichao/one-sm" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/swoole/ide-helper" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lmc/http-constants" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/fast-route" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stopwatch" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/test-time" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpstan" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest-plugin" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofphp/php-cs-fixer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/facade/ignition-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpstan" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/clock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-handler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-middleware" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/promise" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/roave/dont" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/jsonlint" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/phar-utils" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/seld/signal-handler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/pest-plugin-test-time" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/test-time" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/swoole/ide-helper" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php73" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php81" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php83" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/serializer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stopwatch" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/teapot/status-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/brianium/paratest" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fidry/cpu-core-counter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofhyperf/pest-plugin-hyperf" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/friendsofhyperf/rector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/stdlib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hyperf/testing" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jean85/pretty-package-versions" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/termwind" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/pestphp/pest-plugin-arch" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpdoc-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/rector/rector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/swow/psr7-plus" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ta-tikoma/phpunit-architecture-test" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/carbonphp/carbon-doctrine-types" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php82" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/clue/ndjson-react" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/evenement/evenement" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/child-process" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/dns" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/event-loop" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/socket" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/react/stream" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/php-diff" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/phpspec" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php84" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/yaml" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
3
.idea/inspectionProfiles/Project_Default.xml
generated
3
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,8 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PhpCSFixerValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PhpDocSignatureInspection" enabled="true" level="INFORMATION" enabled_by_default="true" />
|
||||
<inspection_tool class="PhpPropertyOnlyWrittenInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PhpStanGlobal" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
25
.idea/jsonSchemas.xml
generated
Normal file
25
.idea/jsonSchemas.xml
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JsonSchemaMappingsProjectConfiguration">
|
||||
<state>
|
||||
<map>
|
||||
<entry key="composer.json">
|
||||
<value>
|
||||
<SchemaInfo>
|
||||
<option name="name" value="composer.json" />
|
||||
<option name="relativePathToSchema" value="https://getcomposer.org/schema.json" />
|
||||
<option name="applicationDefined" value="true" />
|
||||
<option name="patterns">
|
||||
<list>
|
||||
<Item>
|
||||
<option name="path" value="composer.json" />
|
||||
</Item>
|
||||
</list>
|
||||
</option>
|
||||
</SchemaInfo>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</state>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/pest.xml
generated
Normal file
6
.idea/pest.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PestSettings">
|
||||
<option name="preferredTestFlavor" value="TEST" />
|
||||
</component>
|
||||
</project>
|
||||
24
.idea/php-docker-settings.xml
generated
Normal file
24
.idea/php-docker-settings.xml
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpDockerContainerSettings">
|
||||
<list>
|
||||
<map>
|
||||
<entry key="9fb85f67-19fd-423f-9358-1b155a12eb7d">
|
||||
<value>
|
||||
<DockerContainerSettings>
|
||||
<option name="version" value="1" />
|
||||
<option name="volumeBindings">
|
||||
<list>
|
||||
<DockerVolumeBindingImpl>
|
||||
<option name="containerPath" value="/srv/www" />
|
||||
<option name="hostPath" value="$PROJECT_DIR$" />
|
||||
</DockerVolumeBindingImpl>
|
||||
</list>
|
||||
</option>
|
||||
</DockerContainerSettings>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</list>
|
||||
</component>
|
||||
</project>
|
||||
7
.idea/php-test-framework.xml
generated
7
.idea/php-test-framework.xml
generated
@@ -2,6 +2,13 @@
|
||||
<project version="4">
|
||||
<component name="PhpTestFrameworkSettings">
|
||||
<test_tools>
|
||||
<tool tool_name="PHPSpec">
|
||||
<settings>
|
||||
<configurations>
|
||||
<local_configuration executable_path="$PROJECT_DIR$/vendor/phpspec/phpspec/bin/phpspec" />
|
||||
</configurations>
|
||||
</settings>
|
||||
</tool>
|
||||
<tool tool_name="Pest">
|
||||
<settings>
|
||||
<configurations>
|
||||
|
||||
199
.idea/php.xml
generated
199
.idea/php.xml
generated
@@ -15,38 +15,103 @@
|
||||
<PhpCSFixerConfiguration standards="PSR1;PSR2;Symfony;DoctrineAnnotation;PHP70Migration;PHP71Migration" tool_path="$PROJECT_DIR$/vendor/friendsofphp/php-cs-fixer/php-cs-fixer" />
|
||||
</phpcsfixer_settings>
|
||||
</component>
|
||||
<component name="PhpExternalFormatter">
|
||||
<option name="externalFormatter" value="PHP_CBF" />
|
||||
</component>
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/pool" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/event" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/validation" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/guzzle" />
|
||||
<path value="$PROJECT_DIR$/vendor/ergebnis/http-method" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/session" />
|
||||
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" />
|
||||
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
|
||||
<path value="$PROJECT_DIR$/vendor/jetbrains/phpstorm-attributes" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<path value="$PROJECT_DIR$/vendor/lizhichao/one-sm" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
|
||||
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<path value="$PROJECT_DIR$/vendor/swoole/ide-helper" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
||||
<path value="$PROJECT_DIR$/vendor/teapot/status-code" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
|
||||
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
|
||||
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
|
||||
<path value="$PROJECT_DIR$/vendor/laminas/laminas-mime" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<path value="$PROJECT_DIR$/vendor/laminas/laminas-stdlib" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
|
||||
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
|
||||
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/type" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpstan/phpstan" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
|
||||
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
|
||||
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-xml" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/darabonba-openapi" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/serializer" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/openapi-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-utils" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/gateway-spi" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/endpoint-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/dysmsapi-20170525" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/alibabacloud/credentials" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
|
||||
<path value="$PROJECT_DIR$/vendor/friendsofphp/php-cs-fixer" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
|
||||
<path value="$PROJECT_DIR$/vendor/justinrainbow/json-schema" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/filesystem" />
|
||||
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/string" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/process" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/console" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/fig/http-message-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/lmc/http-constants" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/cache" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-server-handler" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-server-middleware" />
|
||||
@@ -54,6 +119,7 @@
|
||||
<path value="$PROJECT_DIR$/vendor/psr/container" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/log" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
|
||||
<path value="$PROJECT_DIR$/vendor/seld/phar-utils" />
|
||||
<path value="$PROJECT_DIR$/vendor/seld/jsonlint" />
|
||||
@@ -63,104 +129,83 @@
|
||||
<path value="$PROJECT_DIR$/vendor/react/promise" />
|
||||
<path value="$PROJECT_DIR$/vendor/roave/dont" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/database" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/pipeline" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/contract" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/collection" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/coordinator" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/serializer" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/di" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/context" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/logger" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/tappable" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/http-server" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/coroutine" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/translation" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/framework" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/config" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/redis" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/constants" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/codec" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/crontab" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/dispatcher" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/server" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/utils" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/http-message" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/exception-handler" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/code-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/conditionable" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/engine-contract" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/support" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/macroable" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/db" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/resource" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/paginator" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/engine" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/pool" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/event" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/validation" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/session" />
|
||||
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<path value="$PROJECT_DIR$/vendor/teapot/status-code" />
|
||||
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
|
||||
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
|
||||
<path value="$PROJECT_DIR$/vendor/laminas/laminas-mime" />
|
||||
<path value="$PROJECT_DIR$/vendor/laminas/laminas-stdlib" />
|
||||
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
|
||||
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
|
||||
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/filesystem" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/string" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/process" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/console" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
|
||||
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/stringable" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/annotations" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
|
||||
<path value="$PROJECT_DIR$/vendor/ergebnis/http-method" />
|
||||
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" />
|
||||
<path value="$PROJECT_DIR$/vendor/jetbrains/phpstorm-attributes" />
|
||||
<path value="$PROJECT_DIR$/vendor/lizhichao/one-sm" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
|
||||
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
|
||||
<path value="$PROJECT_DIR$/vendor/swoole/ide-helper" />
|
||||
<path value="$PROJECT_DIR$/vendor/pestphp/pest" />
|
||||
<path value="$PROJECT_DIR$/vendor/swow/psr7-plus" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/stdlib" />
|
||||
<path value="$PROJECT_DIR$/vendor/hyperf/testing" />
|
||||
<path value="$PROJECT_DIR$/vendor/pestphp/pest-plugin" />
|
||||
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
|
||||
<path value="$PROJECT_DIR$/vendor/pestphp/pest" />
|
||||
<path value="$PROJECT_DIR$/vendor/pestphp/pest-plugin-arch" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpstan/phpdoc-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
|
||||
<path value="$PROJECT_DIR$/vendor/brianium/paratest" />
|
||||
<path value="$PROJECT_DIR$/vendor/fidry/cpu-core-counter" />
|
||||
<path value="$PROJECT_DIR$/vendor/nunomaduro/termwind" />
|
||||
<path value="$PROJECT_DIR$/vendor/nunomaduro/collision" />
|
||||
<path value="$PROJECT_DIR$/vendor/facade/ignition-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
|
||||
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
|
||||
<path value="$PROJECT_DIR$/vendor/ta-tikoma/phpunit-architecture-test" />
|
||||
<path value="$PROJECT_DIR$/vendor/jean85/pretty-package-versions" />
|
||||
<path value="$PROJECT_DIR$/vendor/friendsofhyperf/pest-plugin-hyperf" />
|
||||
<path value="$PROJECT_DIR$/vendor/rector/rector" />
|
||||
<path value="$PROJECT_DIR$/vendor/friendsofhyperf/rector" />
|
||||
<path value="$PROJECT_DIR$/vendor/spatie/test-time" />
|
||||
<path value="$PROJECT_DIR$/vendor/spatie/pest-plugin-test-time" />
|
||||
<path value="$PROJECT_DIR$/vendor/friendsofphp/php-cs-fixer" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpstan/phpstan" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
|
||||
<path value="$PROJECT_DIR$/vendor/carbonphp/carbon-doctrine-types" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php82" />
|
||||
<path value="$PROJECT_DIR$/vendor/cooper/hyperf-pest" />
|
||||
<path value="$PROJECT_DIR$/vendor/clue/ndjson-react" />
|
||||
<path value="$PROJECT_DIR$/vendor/evenement/evenement" />
|
||||
<path value="$PROJECT_DIR$/vendor/react/child-process" />
|
||||
<path value="$PROJECT_DIR$/vendor/react/cache" />
|
||||
<path value="$PROJECT_DIR$/vendor/react/dns" />
|
||||
<path value="$PROJECT_DIR$/vendor/react/stream" />
|
||||
<path value="$PROJECT_DIR$/vendor/react/event-loop" />
|
||||
<path value="$PROJECT_DIR$/vendor/react/socket" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php84" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpspec/phpspec" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpspec/php-diff" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpspec/prophecy" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />
|
||||
<component name="PhpStan">
|
||||
<PhpStan_settings>
|
||||
<PhpStanConfiguration tool_path="$PROJECT_DIR$/vendor/bin/phpstan" />
|
||||
|
||||
10
.idea/phpspec.xml
generated
Normal file
10
.idea/phpspec.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PHPSpec">
|
||||
<suites>
|
||||
<PhpSpecSuiteConfiguration>
|
||||
<option name="myPath" value="$PROJECT_DIR$" />
|
||||
</PhpSpecSuiteConfiguration>
|
||||
</suites>
|
||||
</component>
|
||||
</project>
|
||||
@@ -30,6 +30,10 @@
|
||||
"type": "perf",
|
||||
"section": "⚡ Performance Improvements | 性能优化"
|
||||
},
|
||||
{
|
||||
"type": "tests",
|
||||
"section": "✅ Tests | 测试"
|
||||
},
|
||||
{
|
||||
"type": "test",
|
||||
"section": "✅ Tests | 测试"
|
||||
@@ -53,7 +57,7 @@
|
||||
],
|
||||
"bumpFiles": [
|
||||
{
|
||||
"filename": "MY_VERSION_TRACKER.txt",
|
||||
"filename": "VERSION_TRACKER.txt",
|
||||
"type": "plain-text"
|
||||
},
|
||||
{
|
||||
|
||||
630
CHANGELOG.md
Normal file
630
CHANGELOG.md
Normal file
@@ -0,0 +1,630 @@
|
||||
# 版本更新日志
|
||||
## [1.0.0-beta.12](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2025-08-08)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **exception:** 新增业务错误处理和 API 迁移支持 ([55da020](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/55da02080efa5bd6978b7d0a0e3bbcb1cde41027))
|
||||
|
||||
## [1.0.0-beta.11](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2025-07-11)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* 新增SP相关配置的枚举 ([bf40c6e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/bf40c6e681cb1ff37a8fc331a3cd0cdb495e6ff1))
|
||||
|
||||
## [1.0.0-beta.10](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2025-07-09)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **core:** 添加 X-SP-ID 解析中间件 ([c6ab9db](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/c6ab9db69810bcd395c52cc304dffa54978d6e84))
|
||||
|
||||
## [1.0.0-beta.9](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2025-07-07)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **deps:** 更新依赖并添加 PHPSpec 支持 ([c8b4545](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/c8b454540d2c4371c72f6cb79b5f65b97e7b92f2))
|
||||
|
||||
## [1.0.0-beta.8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2025-03-04)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **email:** 添加邮件附件功能 ([3b3502f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/3b3502f7634b48c31c3e7689cdcfe1f4b504b968))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** Update Dependencies ([b4dcd01](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b4dcd01e8d1fcd2c1fa211ef2a54512593500780))
|
||||
|
||||
## [1.0.0-beta.7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2025-03-03)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **devcontainer:** 添加 Hyperf 开发套件核心配置文件 ([aaa4382](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/aaa4382ff2c5105bc362777f62156b8383b67ed8))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **EmailService:** 添加邮件附件功能并更新单元测试 ([225bded](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/225bdedd23b1655d5fb7260838fc8c60db5d8f9f))
|
||||
|
||||
## [1.0.0-beta.6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2024-12-06)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **exceptions:** 处理 HTTP 客户端和服务器异常 ([2dace65](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2dace65933d7361c1124f8c5c125a507894584fb))
|
||||
|
||||
## [1.0.0-beta.5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2024-09-12)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([0283c72](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/0283c7286a58104c0ea649820fdab2dc781053c9))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **email:** 对发送邮件增加密送,增加单独定制发件人的方法 ([b6dd7dd](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b6dd7dd4ace2623a4631d22fc4e6394e9d2ddda7))
|
||||
|
||||
## [1.0.0-beta.4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2024-06-23)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **core-middleware:** 修复 JsonResource 不走响应格式化的问题 ([d524fb4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/d524fb4e890dd06da8c4fe2f0853e34944cd0e28))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([d20718d](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/d20718db32a9dc05535ff66598475186e8016167))
|
||||
|
||||
## [1.0.0-beta.3](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2024-05-17)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **i18n:** 在没有配置项目默认语言,且传入意料之外的语言时,默认为英文 ([44c26b6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/44c26b64918702062f28499d566eaa54d8aff491))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([bac22a8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/bac22a8ea683c42f597e070e1395881b46b2bd83))
|
||||
|
||||
## [1.0.0-beta.2](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-01-18)
|
||||
|
||||
|
||||
### ⚡ Performance Improvements | 性能优化
|
||||
|
||||
* **exception:** 取消了必须是 apifox/postman 的设计 ([2167fd2](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2167fd209a3cc46ea77fc64909ff8adf71ec6ef0))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **CoreMiddleware:** 修复如果直接输出 ResponseInterface 实例会报错的问题 ([762acbb](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/762acbb368d6a901478fe3d6b2a3e30793f2c57c))
|
||||
|
||||
## [1.0.0-beta.1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-beta.0...v1.0.0-beta.1) (2023-12-15)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **bin:** 更新了迁移脚本的目录 ([da51879](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/da518799b3b4301302217af1faa452adbcacf02b))
|
||||
|
||||
## [1.0.0-beta.0](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.19...v1.0.0-beta.0) (2023-12-15)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **bin:** 更新了迁移脚本的目录 ([01aa833](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/01aa8335371fce4f7663eb1c16e4ef7f108e2bc5))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **release:** 将版本号改为 beta ([cfbb770](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/cfbb770559e748c77d52e7d913398b1d2a1d8edd))
|
||||
|
||||
## [1.0.0-alpha.19](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2023-12-15)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **bin:** 增加了迁移到最新版本的脚本 ([a84b812](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a84b812dd0577186379e2df19493cb0fcf9b4fd9))
|
||||
|
||||
## [1.0.0-alpha.18](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2023-12-14)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 清理 composer 配置 ([08d00a7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/08d00a785f3be1846333777edae94e0ae237c8a2))
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* 迁移到 hyperf3.1 的写法 ([97131d2](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/97131d224cfb601ba075ff1af1c4ca333680b459))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **bin:** 增加了迁移到最新版本的脚本 ([7d6dc7f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7d6dc7fe9f9bc637755768852518420e98176d56))
|
||||
|
||||
## [1.0.0-alpha.17](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2023-12-14)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **CoreMiddleware:** 修复参数类型过少的问题 ([14d28de](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/14d28deee2ec97991b7effe99a37cc03b19a291c))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖,增加 php8.2/8.3的 polyfill ([b89b218](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b89b218eaa211d0262e2f1dff4d61f2a79eacda6))
|
||||
* **ide:** 增加了docker 映射 ([cbc59cc](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/cbc59ccf74dafcedca1e4369e647ba1c003efe39))
|
||||
|
||||
## [1.0.0-alpha.16](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2023-12-04)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* 迁移到 hyperf3.1和 pestphp2 ([eee68ca](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/eee68cab8a06833114ae19dc2c746dcd50206cb4))
|
||||
|
||||
## [1.0.0-alpha.15](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2023-10-30)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([26b55f1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/26b55f1ca5acb8b1bac3d4c23c7154a33ba1b5e6))
|
||||
|
||||
|
||||
### ✅ Tests | 测试
|
||||
|
||||
* **request:** 修复了无法使用的测试用例 ([b7d0dd8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b7d0dd87c5ef110c581df74ff9e1e8987a3fdc6b))
|
||||
* **utils:** 增加了无极分类的测试用例 ([97848a5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/97848a5e2299d33b46ded328ea03ac76e19c5cd0))
|
||||
|
||||
## [1.0.0-alpha.14](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2023-10-23)
|
||||
|
||||
|
||||
### 👷 Continuous Integration | CI 配置
|
||||
|
||||
* **GiteaActions:** 修复没有内容的问题 ([8e4f4d0](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/8e4f4d0d290212174d153cea7f97bc886e7194da))
|
||||
|
||||
## [1.0.0-alpha.13](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2023-10-23)
|
||||
|
||||
|
||||
### 👷 Continuous Integration | CI 配置
|
||||
|
||||
* **GiteaActions:** 现在只会根据 tag确定是否发布 ([43c820c](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/43c820c711f09425a57097e36d01199007e3ed8f))
|
||||
|
||||
## [1.0.0-alpha.12](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2023-10-23)
|
||||
|
||||
|
||||
### 👷 Continuous Integration | CI 配置
|
||||
|
||||
* **GiteaActions:** 不切换分支 ([4cc1473](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/4cc1473d386cf92bead68b59b123f34b25cc875b))
|
||||
* **GiteaActions:** 使用密钥推送包 ([82d9a95](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/82d9a956915f2d66c5c531bab8cebb7e49e1e3fe))
|
||||
* **GiteaActions:** 修复推送的组织名错误问题 ([635804e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/635804e1176565e56e34b5ceb05225e7b4d5f318))
|
||||
* **GiteaActions:** 修复错误的action 写法 ([9cdbd6a](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/9cdbd6a2c8859d20740df949bff208331887d3f6))
|
||||
* **GiteaActions:** 修复镜像不包含 zip 的问题 ([895b028](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/895b0280174f96e00404bc3a0278bc318f0c119a))
|
||||
* **GiteaActions:** 修复镜像不包含 zip 的问题 ([094589b](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/094589b87e52f716485b21bb737cecadcad33c12))
|
||||
* **GiteaActions:** 修复镜像不包含 zip 的问题 ([85ae11e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/85ae11e295326bbe39150cc7578cd47662b8de35))
|
||||
* **GiteaActions:** 修复镜像不包含 zip 的问题 ([118f0b7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/118f0b789f2932503af8e3e7810be805308f5429))
|
||||
* **GiteaActions:** 修改触发条件 ([6cb24a8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/6cb24a84b2dc23b3d5cc5e2682e81bc7a992140e))
|
||||
* **GiteaActions:** 增加了 actions ([b32afe3](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b32afe38b4b26660581f7ab91039ce64bff6eb60))
|
||||
* **GiteaActions:** 安装 zip ([063c1d7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/063c1d7ea190676d02d099fb9e3445982be3d4e8))
|
||||
* **GiteaActions:** 尝试增加推送触发的 actions ([7dfb393](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7dfb3933f600558f71ce295b23d950058ece5e73))
|
||||
* **GiteaActions:** 现在只会根据 tag确定是否发布 ([418f4c4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/418f4c47c9e027eb806e4321f3ec23eb04de8c0f))
|
||||
|
||||
## [1.0.0-alpha.11](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2023-10-17)
|
||||
|
||||
|
||||
### 👷 Continuous Integration | CI 配置
|
||||
|
||||
* **docker:** 兼容 ext-redis:6.0 ([f80da66](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/f80da661859333acff005241d2abcfd7c9f09c71))
|
||||
|
||||
## [1.0.0-alpha.10](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2023-10-16)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([37d42c1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/37d42c17cc8707b17f1dd0fd8e0df5b8f4048bd2))
|
||||
* **script:** root 用户可以使用 composer ([12e9960](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/12e99604c99fee38aa82aa1fbc865201be09127f))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **rest:** 增加多表关联的兼容 ([17c0518](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/17c051868026981031abf3e88e86f7475ce06807))
|
||||
|
||||
## [1.0.0-alpha.9](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2023-10-13)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([e9927fa](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/e9927fafb1630e759d3a55c0143b48db91ffdcae))
|
||||
* **config:** 更新了默认的发件邮箱 ([359b13e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/359b13e71803c87854ec6e54b119cb3bbd65ef3f))
|
||||
|
||||
## [1.0.0-alpha.8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2023-10-08)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **email:** 增加了对邮件优先级的兼容 ([9f7d4ef](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/9f7d4effb7e39500d0f65d35788551cc4e7a91f1))
|
||||
|
||||
## [1.0.0-alpha.7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2023-09-28)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **rest:** 修复不存在的具名参数 ([1106794](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/110679448f310e1d4e25f370b74f2901ca9425d0))
|
||||
|
||||
## [1.0.0-alpha.6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2023-09-28)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **i18n:** 修复了无法正确无视大小写导致无法识别的问题 ([cff919a](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/cff919a21e6d50e396a0d5ceaeefbe3b7c0e3095))
|
||||
* **rest:** 修复没有返回值的问题 ([2afc3ad](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2afc3ad45b97e3df97827efdd9d16d6dedb3238a))
|
||||
|
||||
## [1.0.0-alpha.5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2023-09-26)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **i18n:** 修复了无法正确无视大小写导致无法识别的问题 ([7342015](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/73420153d3791bff38ddd57b5a17120a4ed3cd08))
|
||||
|
||||
## [1.0.0-alpha.4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-09-26)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 引入 pest 并升级到 php8.1 ([dbbe278](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/dbbe278aa6c96634ed5792b5782825770c5cabe8))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **i18n:** 增加枚举值,更新中间件调用方式 ([4032d67](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/4032d67f1e56b8ce29fbfa5bd77ead2636a6ffd3))
|
||||
|
||||
|
||||
### ✅ Tests | 测试
|
||||
|
||||
* **http:** 完成并通过了 http 请求的测试 ([7a209e8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7a209e876f8b4301b7bc78f05b68798eb65e77f7))
|
||||
|
||||
## [1.0.0-alpha.3](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2023-08-30)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **http:** 整理了 Http 请求服务 ([2d95fba](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2d95fbae9e926788402c24266ab0d232732a7754))
|
||||
|
||||
## [1.0.0-alpha.2](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2023-07-21)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **controller:** 修复方法访问级别不足以继承的问题 ([b30c844](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b30c84488b7f85447bd802df77c9decbf315ed85))
|
||||
|
||||
## [1.0.0-alpha.1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2023-07-21)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([a8ec7d8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a8ec7d82556c2fb8fbe1e356eb6d1936401c810a))
|
||||
* **release:** 增加 alpha 标识,准备正式版 ([f1948ab](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/f1948ab0fe4594140eede8e52f113963d98a8338))
|
||||
|
||||
## [1.0.0-alpha.0](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.23...v1.0.0-alpha.0) (2023-07-21)
|
||||
|
||||
|
||||
### ✏️ Documentation | 文档
|
||||
|
||||
* **utils:** 移除了导致编辑器出错的注解 ([7ccf36b](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7ccf36b398f86a31c7d8dde6ff24f0d9828cfb80))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **controller:** 增加了一个 Rest 风格的 trait ([68844a6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/68844a6132059da89f69a34ba59229c40e5bcace))
|
||||
* **trait:** 增加了分页响应的统一处理方法 ([fd788a7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/fd788a7eb804b7fe085346d817123c04c8bd0d01))
|
||||
|
||||
### [0.2.23](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.22...v0.2.23) (2023-07-07)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **i18n:** 修复获取偏好语言失败的问题 ([722d124](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/722d124e1ed87c493dfb8841212b408717444d98))
|
||||
|
||||
### [0.2.22](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.21...v0.2.22) (2023-07-06)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **service:** 修复 http 请求类中无效的 query ([a6ec695](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a6ec6951a9a68a4c5144aee97638486826d6af84))
|
||||
|
||||
### [0.2.21](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.20...v0.2.21) (2023-07-05)
|
||||
|
||||
|
||||
### ⚡ Performance Improvements | 性能优化
|
||||
|
||||
* 适配已弃用的命名空间 ([8616c5f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/8616c5f61cc8e69c9d61f42f5dc5d18e7c79fd7b))
|
||||
|
||||
|
||||
### 🚀 Chore | 构建/工程依赖/工具
|
||||
|
||||
* **deprecated:** 声明弃用了 SessionMiddleware ([2b0374b](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2b0374bcc83a5534358a7fce34b723e3bd38dceb))
|
||||
|
||||
### [0.2.20](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.19...v0.2.20) (2023-06-19)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **handler:** 增加了 restful 的支持 ([8974ee5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/8974ee595b3411bac086c3046eb24ba44087ecc7))
|
||||
|
||||
### [0.2.19](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.18...v0.2.19) (2023-06-02)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([648fe6c](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/648fe6c8f32e2511f0c1a79dbafff8e889c1da7b))
|
||||
|
||||
### [0.2.18](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.17...v0.2.18) (2023-06-02)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* 修复 http 请求失效的问题 ([43ebd05](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/43ebd0546abb25446e83522fd0c069dd0e6880c7))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* 更新被弃用的写法 ([c748cbd](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/c748cbd3e322b5a926996fc2ee958b2e2a911d7c))
|
||||
|
||||
### [0.2.17](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.16...v0.2.17) (2023-05-06)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([d22bd3e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/d22bd3ee587f7799b33a28015c148e50afe79107))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **xml:** 实现了解析xml的方法 ([be818b7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/be818b708011bb05a65752380248c8307938d110))
|
||||
|
||||
### [0.2.16](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.15...v0.2.16) (2023-04-25)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **extend:** 修复未传入 extends 不存在缺省值的问题 ([77f3141](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/77f3141c56a09905e0c357c1b183c1c8831c9acd))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **handler:** 补全了各种错误的状态码 ([0247dd4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/0247dd415c2a62c21b5a6fbb15ab1e6ce3d1a316))
|
||||
|
||||
### [0.2.15](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.14...v0.2.15) (2023-04-13)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **coreMiddleware:** 修复restful 无法分页的问题 ([a6b71db](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a6b71dbb037624ac69eddc1e5b1d671ab45b06ae))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* 默认绑定 CoreMiddleware 的映射关系 ([5e5792b](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/5e5792b28ca13cc8833280ba3d26ec588c445350))
|
||||
|
||||
### [0.2.14](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.13...v0.2.14) (2023-04-12)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **handler:** 补充 restful 响应的状态码 ([e69c149](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/e69c1494c3ec0a8d26341f1891d7d067511e8baf))
|
||||
|
||||
### [0.2.13](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.12...v0.2.13) (2023-04-11)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **xml:** 增加了 xml 生成的方法及测试用例 ([90a521f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/90a521f90acee7fd6efe6f0a554e749c16fadc1c))
|
||||
|
||||
### [0.2.12](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.11...v0.2.12) (2023-04-10)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖以兼容 nano ([7e5cb89](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7e5cb89dfe1c09390e78cdd527c60151f2cd0418))
|
||||
* **phpstan:** fix ([c25e6ee](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/c25e6eed52e83d2ca62fc3d0cf83f508a1045c5a))
|
||||
* **scripts:** 更新脚本 ([4ba0cb8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/4ba0cb83f5dc88817260cb2b2dfde491c6b5ba75))
|
||||
|
||||
### [0.2.11](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.10...v0.2.11) (2023-04-03)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 更新依赖 ([78b56a6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/78b56a6aa9038743be7df9a17787b94771e226c3))
|
||||
* **composer:** 更新依赖 ([c991c31](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/c991c312609e7501c7adad28ec8229efad717db0))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **i18n:** 引入了 symfony 的 Accept-Language 机制 ([859a1a1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/859a1a1f2aa683f9f026652952d1a03ba5d7be02))
|
||||
|
||||
### [0.2.10](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.9...v0.2.10) (2023-03-21)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **composer:** 只留下了腾讯源,更新依赖 ([afec642](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/afec6424545daa3b3f2a4b91e97e359b4a840a19))
|
||||
* **composer:** 只留下了腾讯源,更新依赖 ([b2debf9](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b2debf9c135554a15639c299f183c43f3682545b))
|
||||
* **composer:** 更新依赖 ([70ad307](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/70ad3078b1ddeeeb0179dd44770e959ecf072fed))
|
||||
|
||||
### [0.2.9](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.8...v0.2.9) (2023-03-15)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* 修复了一处大小写错误 ([2d2a535](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2d2a535fd2c1ae13195f13498864540b503edd1e))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* 增加了inArray、hasExtends方法 ([de96e28](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/de96e288c3429c58deed15ea667a5e15a34fb81f))
|
||||
* 增加了对 session 中间件配置 cookie 方式的补充 ([a618af5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a618af5ab353f478dd4bcce18a7b84f611fd0c7a))
|
||||
* 增加默认api风格参数 ([e33c115](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/e33c1159388efa3590e81f484c01a66d21f8b574))
|
||||
* 实现了通过中间件设置是否 restful 的逻辑 ([2d2148f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/2d2148f3ecabef09801a225632430bf103dbf218))
|
||||
* 添加了 http 请求服务 ([7c1efe1](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/7c1efe1a1f18f082ed7b7b6383112034982e2893))
|
||||
* **api:** 增加了可以使用中间件定制是否 restful 的逻辑 ([b8c3d6d](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b8c3d6d06810fb920df200a4d75746b49e2fbd07))
|
||||
|
||||
### [0.2.8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.7...v0.2.8) (2023-02-03)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **commonHandler:** 修复了一处兼容问题 ([c8f9b79](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/c8f9b793ee7c2ba4d77a2779b6825211dcf52636))
|
||||
|
||||
### [0.2.7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.6...v0.2.7) (2023-02-02)
|
||||
|
||||
|
||||
### ⚡ Performance Improvements | 性能优化
|
||||
|
||||
* **Sms:** 修改抛出的异常类型,追加方法注释 ([5a1a2a8](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/5a1a2a89bd7d706a6e8d1ef567c59969d8d63554))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **Email:** 实现了邮件发送的事件机制 ([8757908](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/8757908f3f8a6dff5516bd6e449c8dd3952ec2cd))
|
||||
* **Listener:** 添加了一个抽象监听器类,预先注入了一些属性 ([1dbad8e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/1dbad8e5a65d299b9a56b6a5c4759be5c3736707))
|
||||
* **Sms:** 实现了短信发送的事件机制 ([5151787](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/51517879820de832395efc40bb308a736f33f131))
|
||||
|
||||
|
||||
### ✏️ Documentation | 文档
|
||||
|
||||
* **README:** 修复一直报错的文件名 ([135db1b](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/135db1bf6aeeedbb0d59405567bb4837f3221e49))
|
||||
* **Sms:** 补充所抛出异常的注释 ([b65818b](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b65818bfb6d8368514d517c31dd6b6696b2d08be))
|
||||
|
||||
|
||||
### ✅ Tests | 测试
|
||||
|
||||
* **extend:** 补充测试用例 ([e41847a](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/e41847a2340916de24726f8266dca8b514b4edd3))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **extend:** 修复了解析不到为空不为数组的问题 ([099ab60](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/099ab601030caef52806f5b9ec4d62fb27b08e72))
|
||||
|
||||
|
||||
### 💄 Styles | 风格
|
||||
|
||||
* **cs-fixer:** prettier ([a729270](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a729270fac57cd617e8f166bb59f9ccffe33358b))
|
||||
|
||||
### [0.2.6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.5...v0.2.6) (2023-01-16)
|
||||
|
||||
|
||||
### 💄 Styles | 风格
|
||||
|
||||
* 移除冗余的注释 ([3d09207](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/3d092074b3784b120cabb1561a9d6b9af5c3c428))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **configure:** 修复配置文件和实际应用的字段名不统一 ([d1bae3e](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/d1bae3e623dde3839acb44d4a7905c7dab78e8ce))
|
||||
|
||||
### [0.2.5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.4...v0.2.5) (2023-01-13)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **CoreMiddleware:** 增加restful场景下的分页响应处理 ([aeddb55](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/aeddb55988e714e53b7458ead8668dee6ebec63e))
|
||||
|
||||
### [0.2.4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.3...v0.2.4) (2023-01-13)
|
||||
|
||||
|
||||
### ⏪ Revert | 回退
|
||||
|
||||
* **constant:** 移除冗余的http头authentication的枚举类型 ([cdb1937](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/cdb193778fb888851682bb1671bc55dd8f0e3423))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **oss:** 修复了oss的配置缺失和错误 ([922c780](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/922c780c49edc2cddbce3e66e6b9dfde7be364f8))
|
||||
|
||||
### [0.2.3](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.2...v0.2.3) (2023-01-13)
|
||||
|
||||
|
||||
### ✏️ Documentation | 文档
|
||||
|
||||
* **link:** 增加错误码对应的语雀文档 ([3a1f269](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/3a1f2695fef03840d9afe3578f3e7ed33da45926))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **constant:** 增加http头authentication的枚举类型 ([08c1f66](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/08c1f6609c3035dd7d7f39e8389b66a8ba2e34a5))
|
||||
|
||||
### [0.2.2](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/compare/v0.2.1...v0.2.2) (2023-01-13)
|
||||
|
||||
|
||||
### ⚡ Performance Improvements | 性能优化
|
||||
|
||||
* **exceptions.handler:** 优化trace显示格式 ([9f9ff31](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/9f9ff31a83ea5662500c688471b78f02ff67eb15))
|
||||
|
||||
### 0.2.1 (2023-01-13)
|
||||
|
||||
|
||||
### 🎉 Init | 初始化
|
||||
|
||||
* **core:** 初始化代码 ([f564d01](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/f564d01766f52fc57f07aa05bd995a5662c2ae45))
|
||||
* 初始化项目 ([a13779a](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a13779ab3fb617189227b9d2c0462588be8ceee5))
|
||||
|
||||
|
||||
### ✅ Tests | 测试
|
||||
|
||||
* **oss:** 增加 oss 票据生成的测试文件 ([b5970d5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/b5970d543435495706502c5b67897ff1cfd5fb85))
|
||||
* **service:** 添加了base64Wrapper的测试 ([69ce665](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/69ce66561f19e44d35b134c6d032ff69f48201a3))
|
||||
* **service:** 添加了发送邮件的测试 ([65e3485](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/65e34857e2978a9952ee89df71b1e0c9101ec69c))
|
||||
* **service:** 添加了解析 extends 的测试 ([da1d6c6](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/da1d6c68d21b2739c8bb1701243e6419eae14975))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **utils:** 重写了构造URL的方法,增加对应的单元测试 ([9f79d14](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/9f79d1465ba6ed4b4c0d0c30e23ffa34bbeece65))
|
||||
* 迁移到了 Core 命名空间下 ([a8a582f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/a8a582f3aa0948c982e31bf8938b6f3331d8dc6d))
|
||||
|
||||
|
||||
### ✏️ Documentation | 文档
|
||||
|
||||
* **core:** 添加作者信息 ([096d4e5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/096d4e56ed30c23de1338bb6f057a91e629c6ea5))
|
||||
* **README:** 增加说明文件 ([4cf16ae](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/4cf16ae0cdcf6f7a1eb99fde95a6c3ef01bd7b2b))
|
||||
|
||||
|
||||
### ⚡ Performance Improvements | 性能优化
|
||||
|
||||
* **utils:** 获取真实IP方法,增加apache的处理 ([47e522c](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/47e522c67bf595282df7671f1d045e44593022bf))
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **migrate:** 迁移注解以支持hyperf3 ([480f406](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/480f406cccde21f5fb39ba431b6f633c562e5f96))
|
||||
* **migrate:** 迁移注解以支持hyperf3 ([91db3c7](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/91db3c731f651e178f830953bf97958c5ddc973d))
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **ci:** 完善 style-fix/syntax-check/unit-test ([52ff5cc](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/52ff5ccb048d41d003b7e044c446c2f04a013bdb))
|
||||
* **ci:** 完善 style-fix/syntax-check/unit-test ([4b7f118](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/4b7f1189d33e8871091d05d330ed16fa98048dd9))
|
||||
* **composer:** update dependencies ([e004ab4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/e004ab402df9185ead225a3398077f3e39dffe92))
|
||||
* **composer:** 更新依赖 ([1e4fbe5](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/1e4fbe59276ed2913aa21973f9502505115d2628))
|
||||
* **composer:** 添加依赖到开发环境 ([9f5699f](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/9f5699f39cd7a89c37e9365322c6082a97a973f4))
|
||||
* **version:** 添加changelog配置 ([4deffe0](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/4deffe055ebe8586a183103d84dcd5b97969ca7d))
|
||||
* **version:** 添加changelog配置及脚本 ([3bc4e27](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/3bc4e275a761bf71bb0ca227770b82c3d5ec76bb))
|
||||
* 迁移到hyperf3 ([9fedbb4](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/9fedbb40f4c9f3221a97986dc7063d049c914728))
|
||||
|
||||
|
||||
### 🚀 Chore | 构建/工程依赖/工具
|
||||
|
||||
* **release:** 0.2.1-0 ([ab44630](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/ab44630db8c2d05c21bccdf0899569f911b01473))
|
||||
* 移除调试用的打印语句 ([37ed1ce](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/37ed1cef77d094f6cd78dd1c97f5d2e3cf6376a3))
|
||||
* **tests:** 移除了示例测试文件 ([e705bed](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/e705bedd5d3e72887e9e5fac35926237db844116))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **composer:** 修复ConfigProvider命名空间 ([3989f59](http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore/commit/3989f5913ea56cba8751afc225c19b8f6730d2c3))
|
||||
1
VERSION_TRACKER.txt
Normal file
1
VERSION_TRACKER.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.0-beta.12
|
||||
19
bin/hdk-migrate-core.sh
Normal file
19
bin/hdk-migrate-core.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2039
|
||||
|
||||
LIB_HOME_DIR="$(pwd)/vendor/singularity/hdk-core"
|
||||
LATEST_VERSION=$(cat "${LIB_HOME_DIR}/VERSION_TRACKER.txt")
|
||||
|
||||
echo -e '\033[44;34;5m=============================\033[0m'
|
||||
echo ''
|
||||
|
||||
$(pwd)/vendor/bin/rector \
|
||||
process \
|
||||
--autoload-file=vendor/autoload.php \
|
||||
--config="${LIB_HOME_DIR}/hyperf31_rector.php"
|
||||
|
||||
echo ''
|
||||
echo -e '\033[44;34;5m=============================\033[0m'
|
||||
echo -e '\033[;31;1m🎉Congratulations!\033[0m'
|
||||
echo "Now you have been migrated to HDK-Core v${LATEST_VERSION}!"
|
||||
echo ''
|
||||
124
composer.json
124
composer.json
@@ -5,7 +5,7 @@
|
||||
"description": "Common Hyperf Development Kit",
|
||||
"extra": {
|
||||
"hyperf": {
|
||||
"config": "Singularity\\HDK\\ConfigProvider"
|
||||
"config": "Singularity\\HDK\\Core\\ConfigProvider"
|
||||
}
|
||||
},
|
||||
"authors": [
|
||||
@@ -14,56 +14,77 @@
|
||||
"email": "dongyun.li@luxcreo.ai"
|
||||
}
|
||||
],
|
||||
"bin": [
|
||||
"bin/hdk-migrate-core.sh"
|
||||
],
|
||||
"require": {
|
||||
"php": "~8.0",
|
||||
"ext-redis": "^5.3",
|
||||
"php": ">=8.1",
|
||||
"ext-dom": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-redis": "^5.3|^6.0",
|
||||
"ext-swoole": "*",
|
||||
"composer/composer": ">=2.0",
|
||||
"ergebnis/http-method": "^2.2",
|
||||
"hyperf/config": "^2.2",
|
||||
"hyperf/constants": "^2.2",
|
||||
"hyperf/context": "^2.2",
|
||||
"hyperf/database": "^2.2",
|
||||
"hyperf/di": "^2.2",
|
||||
"hyperf/framework": "^2.2",
|
||||
"hyperf/http-server": "^2.2",
|
||||
"hyperf/logger": "^2.2",
|
||||
"hyperf/redis": "^2.2",
|
||||
"hyperf/resource": "^2.2",
|
||||
"hyperf/translation": "^2.2",
|
||||
"ergebnis/http-method": "^2.5",
|
||||
"friendsofhyperf/rector": "^0.1.5",
|
||||
"hyperf/config": "3.1.*",
|
||||
"hyperf/constants": "3.1.*",
|
||||
"hyperf/context": "3.1.*",
|
||||
"hyperf/di": "3.1.*",
|
||||
"hyperf/framework": "3.1.*",
|
||||
"hyperf/logger": "3.1.*",
|
||||
"hyperf/redis": "3.1.*",
|
||||
"hyperf/resource": "3.1.*",
|
||||
"hyperf/translation": "3.1.*",
|
||||
"jetbrains/phpstorm-attributes": "^1.0",
|
||||
"lmc/http-constants": "^1.2",
|
||||
"myclabs/php-enum": "^1.8",
|
||||
"roave/dont": "^1.5",
|
||||
"symfony/polyfill-php81": "^1.26",
|
||||
"teapot/status-code": "^1.1"
|
||||
"lmc/http-constants": "^1.2.0",
|
||||
"myclabs/php-enum": "^1.8.4",
|
||||
"roave/dont": "^1.6.0",
|
||||
"symfony/http-foundation": "^6.4",
|
||||
"symfony/polyfill-php81": "^1.28",
|
||||
"symfony/polyfill-php82": "^1.28",
|
||||
"symfony/polyfill-php83": "^1.28",
|
||||
"symfony/polyfill-php84": "^1.28",
|
||||
"teapot/status-code": "^1.1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"alibabacloud/dysmsapi-20170525": "^2.0",
|
||||
"firebase/php-jwt": "^6.1",
|
||||
"friendsofphp/php-cs-fixer": "^3.13",
|
||||
"guzzlehttp/guzzle": "^7.5",
|
||||
"hyperf/session": "^2.2",
|
||||
"hyperf/validation": "^2.2",
|
||||
"pestphp/pest": "^1.22",
|
||||
"phpstan/phpstan": "^1.9",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"firebase/php-jwt": "^6.9",
|
||||
"friendsofhyperf/pest-plugin-hyperf": "3.1.*",
|
||||
"friendsofphp/php-cs-fixer": "^3.41.1",
|
||||
"guzzlehttp/guzzle": "^7.8",
|
||||
"hyperf/crontab": "3.1.*",
|
||||
"hyperf/database": "3.1.*",
|
||||
"hyperf/db": "3.1.*",
|
||||
"hyperf/guzzle": "3.1.*",
|
||||
"hyperf/session": "3.1.*",
|
||||
"hyperf/testing": "^3.1",
|
||||
"hyperf/validation": "3.1.*",
|
||||
"pestphp/pest": "^2.23",
|
||||
"phpspec/phpspec": "^7.5",
|
||||
"phpstan/phpstan": "^1.10.49",
|
||||
"rector/rector": "*",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"spatie/pest-plugin-test-time": "^1.1",
|
||||
"spatie/pest-plugin-test-time": "^2.0",
|
||||
"swoole/ide-helper": "*",
|
||||
"symfony/mailer": "^6.0"
|
||||
"symfony/mailer": "^6.4.0",
|
||||
"symfony/serializer": "^6.4.1"
|
||||
},
|
||||
"suggest": {
|
||||
"firebase/php-jwt": "JWT 鉴权必需",
|
||||
"hyperf/session": "Session 鉴权必需",
|
||||
"hyperf/session": "3.1.*",
|
||||
"symfony/mailer": "用于发送电子邮件",
|
||||
"guzzlehttp/guzzle": "需要发起 http 请求时必需",
|
||||
"symfony/serializer": "处理 XML 必需",
|
||||
"ext-dom": "处理 XML 必需",
|
||||
"ext-libxml": "处理 XML 必需",
|
||||
"hyperf/guzzle": "3.1.*",
|
||||
"alibabacloud/dysmsapi-20170525": "阿里云短信服务必需"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true,
|
||||
"secure-http": false
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -75,36 +96,45 @@
|
||||
"Singularity\\HDK\\Test\\Core\\": "tests/"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"archive": {
|
||||
"exclude": [
|
||||
".idea",
|
||||
"tests",
|
||||
"scripts",
|
||||
"Dockerfile",
|
||||
".gitignore",
|
||||
".php-cs-fixer.*",
|
||||
".phpunit.result.cache",
|
||||
"phpstan.dist.neon",
|
||||
"phpunit.xml"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "beta",
|
||||
"prefer-stable": true,
|
||||
"scripts": {
|
||||
"post-root-package-install": [],
|
||||
"test": "vendor/bin/pest $1",
|
||||
"test": [
|
||||
"rm -rf runtime",
|
||||
"pest --coroutine --prepend tests/bootstrap.php --colors=always"
|
||||
],
|
||||
"cs-fix": "vendor/bin/php-cs-fixer fix $1 --rules=@PSR12 --allow-risky=yes",
|
||||
"analyse": "vendor/bin/phpstan analyse $1",
|
||||
"ci": [
|
||||
"@analyse publish/ src/ tests/",
|
||||
"@cs-fix",
|
||||
"@test --ci",
|
||||
"@test",
|
||||
"echo CI Success"
|
||||
]
|
||||
},
|
||||
"repositories": {
|
||||
"lux-map": {
|
||||
"nest": {
|
||||
"type": "composer",
|
||||
"url": "https://satis.luxcreo.cn/"
|
||||
"url": "https://nest.doylee.cn/api/packages/HDK/composer"
|
||||
},
|
||||
"packagist": {
|
||||
"type": "composer",
|
||||
"url": "https://mirrors.aliyun.com/composer/"
|
||||
},
|
||||
"packagist-tx": {
|
||||
"type": "composer",
|
||||
"url": "https://mirrors.cloud.tencent.com/composer/"
|
||||
},
|
||||
"packagist-hw": {
|
||||
"type": "composer",
|
||||
"url": "https://repo.huaweicloud.com/repository/php/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"version": "1.0.0-beta.12"
|
||||
}
|
||||
|
||||
11881
composer.lock
generated
11881
composer.lock
generated
File diff suppressed because it is too large
Load Diff
76
docs/Email.md
Normal file
76
docs/Email.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Email | 邮件
|
||||
提供一套通用 Service 用于定制需求,和一套现成的事件/监听器用于异步发送。
|
||||
|
||||
## 服务类
|
||||
[\Singularity\HDK\Core\Service\EmailService](../src/Service/EmailService.php)
|
||||
* 发送纯文本邮件的 `\Singularity\HDK\Core\Service\EmailService::sendText()`
|
||||
* 发送 Html 富文本邮件的 `\Singularity\HDK\Core\Service\EmailService::sendHtml()`
|
||||
|
||||
## 事件机制
|
||||
> 这种方式无法监听邮件发送的结果!
|
||||
>
|
||||
> 如果你需要根据邮件发送的结果进行处理,
|
||||
> 请使用服务类进行自定义
|
||||
|
||||
更好的方法可能是在事件发生后触发异步队列,
|
||||
但如果将异步队列封装在本包中,
|
||||
相当于强制引用本库的项目使用异步队列机制,
|
||||
这是我们不愿意看到的。
|
||||
所以这里的监听器只是集成了同步发送的操作。
|
||||
|
||||
如果你想要定义更好的设计,
|
||||
你可以直接使用提供的 Service 类进行定制。
|
||||
> 或许这里还有优化空间😄
|
||||
|
||||
### 事件
|
||||
[\Singularity\HDK\Core\Events\EmailWillSent](../src/Events/EmailWillSent.php)
|
||||
### 监听器
|
||||
[\Singularity\HDK\Core\Listener\EmailWillSentListener](../src/Listener/EmailWillSentListener.php)
|
||||
### 使用方法
|
||||
监听器已经通过 [ConfigProvider](../src/ConfigProvider.php) 机制注册,
|
||||
所以你只需要在要发送邮件的地方调度这个事件即可。
|
||||
> 这也就意味着,你无法调用这个事件,但不触发这个监听器。
|
||||
> 如果你有这样做的必要,请创建一个自己的事件。
|
||||
> 这也是为了保证功能的完整性和原子性。
|
||||
|
||||
具体使用方法,如下代码所示:
|
||||
|
||||
```php
|
||||
<?php
|
||||
namespace App\Service;
|
||||
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||
use App\Event\UserRegistered;use Singularity\HDK\Core\Events\EmailWillSent;
|
||||
|
||||
class UserService
|
||||
{
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private $eventDispatcher;
|
||||
|
||||
public function register()
|
||||
{
|
||||
// 我们假设存在 User 这个实体
|
||||
$user = new User();
|
||||
$result = $user->save();
|
||||
|
||||
// ↓
|
||||
// 这里 dispatch(object $event) 会逐个运行监听该事件的监听器
|
||||
$this->eventDispatcher->dispatch(new EmailWillSent(
|
||||
target: $user->mobile,
|
||||
subject: '注册成功通知',
|
||||
type: 'html', // 默认 text 可以不传
|
||||
content: <<<HTML
|
||||
<h1>恭喜你,注册成功!</h1>
|
||||
HTML,
|
||||
));
|
||||
// ↑
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
26
docs/Http 请求.md
Normal file
26
docs/Http 请求.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Http 请求
|
||||
|
||||
## 1 组成
|
||||
|
||||
* 单例类
|
||||
* \Singularity\HDK\Core\Http\RequestService
|
||||
* 工厂类
|
||||
* \Singularity\HDK\Core\Http\RequestServiceFactory
|
||||
|
||||
## 2 初始化服务
|
||||
|
||||
创建一个请求服务的方法有两种,效果是一致的:
|
||||
|
||||
* 工厂模式
|
||||
* `\Singularity\HDK\Core\Http\RequestServiceFactory::make($options)`
|
||||
* `\Singularity\HDK\Core\Http\RequestServiceFactory::make()->setOptions($options)`
|
||||
* 单例模式
|
||||
* `new \Singularity\HDK\Core\Http\RequestService($options)`
|
||||
* `(new \Singularity\HDK\Core\Http\RequestService())->setOptions($options)`
|
||||
|
||||
这两个方法都回返回一个 `\Singularity\HDK\Core\Http\RequestService` 实例
|
||||
|
||||
## 3 规范
|
||||
|
||||
每个通过本包提供的 Http 请求服务创建的服务,都应该在构建方法中实例化一个 RequestService 服务,
|
||||
之后该服务中使用的所有请求都基于该服务,这样可以避免共用单例模式导致的 options 污染
|
||||
12
docs/REST 控制器.md
Normal file
12
docs/REST 控制器.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# REST 资源控制器支持
|
||||
|
||||
## 列表的筛选、排序
|
||||
|
||||
* [**RestfulList**](../src/Traits/RestfulList.php)
|
||||
|
||||
### RestfulList
|
||||
在 AbstractController 中已经默认进行了集成
|
||||
|
||||
- parseParameters 用来解析请求
|
||||
- responseFormatter 用来将 builder 转化成响应
|
||||
- restSelect 额外的语法糖,调用了上面的两个方法
|
||||
75
docs/Sms.md
Normal file
75
docs/Sms.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# SMS | 短信
|
||||
提供一套通用 Service 用于定制需求,和一套现成的事件/监听器用于异步发送。
|
||||
|
||||
## 服务类
|
||||
[\Singularity\HDK\Core\Service\SmsService](../src/Service/SmsService.php)
|
||||
* 发送国内短信的 `\Singularity\HDK\Core\Service\SmsService::sendSmsCountryside()`
|
||||
|
||||
## 事件机制
|
||||
> 这种方式无法监听短信发送的结果!
|
||||
>
|
||||
> 如果你需要根据短信发送的结果进行处理,
|
||||
> 请使用服务类进行自定义
|
||||
|
||||
更好的方法可能是在事件发生后触发异步队列,
|
||||
但如果将异步队列封装在本包中,
|
||||
相当于强制引用本库的项目使用异步队列机制,
|
||||
这是我们不愿意看到的。
|
||||
所以这里的监听器只是集成了同步发送的操作。
|
||||
|
||||
如果你想要定义更好的设计,
|
||||
你可以直接使用提供的 Service 类进行定制。
|
||||
> 或许这里还有优化空间😄
|
||||
|
||||
### 事件
|
||||
[\Singularity\HDK\Core\Events\SmsWillSent](../src/Events/SmsWillSent.php)
|
||||
### 监听器
|
||||
[\Singularity\HDK\Core\Listener\SmsWillSentListener](../src/Listener/SmsWillSentListener.php)
|
||||
### 使用方法
|
||||
监听器已经通过 [ConfigProvider](../src/ConfigProvider.php) 机制注册,
|
||||
所以你只需要在要发送短信的地方调度这个事件即可。
|
||||
> 这也就意味着,你无法调用这个事件,但不触发这个监听器。
|
||||
> 如果你有这样做的必要,请创建一个自己的事件。
|
||||
> 这也是为了保证功能的完整性和原子性。
|
||||
|
||||
具体使用方法,如下代码所示:
|
||||
|
||||
```php
|
||||
<?php
|
||||
namespace App\Service;
|
||||
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||
use App\Event\UserRegistered;use Singularity\HDK\Core\Events\EmailWillSent;
|
||||
|
||||
class UserService
|
||||
{
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private $eventDispatcher;
|
||||
|
||||
public function register()
|
||||
{
|
||||
// 我们假设存在 User 这个实体
|
||||
$user = new User();
|
||||
$result = $user->save();
|
||||
|
||||
// ↓
|
||||
// 这里 dispatch(object $event) 会逐个运行监听该事件的监听器
|
||||
$this->eventDispatcher->dispatch(new EmailWillSent(
|
||||
target: $user->mobile,
|
||||
subject: '注册成功通知',
|
||||
type: 'html', // 默认 text 可以不传
|
||||
content: <<<HTML
|
||||
<h1>恭喜你,注册成功!</h1>
|
||||
HTML,
|
||||
));
|
||||
// ↑
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
198
hyperf31_rector.php
Normal file
198
hyperf31_rector.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* hyperf31_rector.php@LuxLink
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/12/14
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Renaming\Rector\Name\RenameClassRector;
|
||||
use Rector\Renaming\ValueObject\MethodCallRename;
|
||||
|
||||
return static function (RectorConfig $rectorConfig): void {
|
||||
defined('BASE_PATH') || define('BASE_PATH', dirname(__DIR__, 3));
|
||||
$rectorConfig->importNames(true, false);
|
||||
|
||||
$rectorConfig->paths([
|
||||
BASE_PATH . '/app',
|
||||
BASE_PATH . '/config',
|
||||
BASE_PATH . '/tests',
|
||||
]);
|
||||
|
||||
$rectorConfig
|
||||
->ruleWithConfiguration(RenameClassRector::class, [
|
||||
// AsyncQueue
|
||||
'Hyperf\AsyncQueue\Message' => 'Hyperf\AsyncQueue\JobMessage',
|
||||
|
||||
// DbConnection
|
||||
'Hyperf\DbConnection\Listener\CreatingListener' => 'Hyperf\DbConnection\Listener\InitUidOnCreatingListener',
|
||||
|
||||
// HttpMessage
|
||||
'Hyperf\HttpMessage\Server\ConnectionInterface' => 'Hyperf\Engine\Contract\Http\Writable',
|
||||
'Hyperf\HttpMessage\Server\Connection\SwooleConnection' => 'Hyperf\Engine\Http\WritableConnection',
|
||||
|
||||
// Redis
|
||||
'Hyperf\Redis\ScanCaller' => 'Hyperf\Redis\Traits\ScanCaller',
|
||||
|
||||
// Channel
|
||||
'Hyperf\Utils\Channel\Caller' => 'Hyperf\Coroutine\Channel\Caller',
|
||||
'Hyperf\Utils\Channel\ChannelManager' => 'Hyperf\Coroutine\Channel\Manager',
|
||||
|
||||
// Codec
|
||||
'Hyperf\Utils\Codec\Base62' => 'Hyperf\Codec\Base62',
|
||||
'Hyperf\Utils\Codec\Json' => 'Hyperf\Codec\Json',
|
||||
'Hyperf\Utils\Codec\Xml' => 'Hyperf\Codec\Xml',
|
||||
|
||||
// CodeGen
|
||||
'Hyperf\Utils\CodeGen\Package' => 'Hyperf\CodeParser\Package',
|
||||
'Hyperf\Utils\CodeGen\PhpDocReader' => 'Hyperf\CodeParser\PhpDocReader',
|
||||
'Hyperf\Utils\CodeGen\PhpDocReaderManager' => 'Hyperf\CodeParser\PhpDocReaderManager',
|
||||
'Hyperf\Utils\CodeGen\PhpParser' => 'Hyperf\CodeParser\PhpParser',
|
||||
'Hyperf\Utils\CodeGen\Project' => 'Hyperf\CodeParser\Project',
|
||||
|
||||
// Command
|
||||
'Hyperf\Command\ConfirmableTrait' => 'Hyperf\Command\Concerns\Confirmable',
|
||||
'Hyperf\Command\DisableEventDispatcher' => 'Hyperf\Command\Concerns\DisableEventDispatcher',
|
||||
'Hyperf\Command\NullDisableEventDispatcher' => 'Hyperf\Command\Concerns\NullDisableEventDispatcher',
|
||||
|
||||
// Contracts
|
||||
'Hyperf\Utils\Contracts\Arrayable' => 'Hyperf\Contract\Arrayable',
|
||||
'Hyperf\Utils\Contracts\Jsonable' => 'Hyperf\Contract\Jsonable',
|
||||
'Hyperf\Utils\Contracts\MessageBag' => 'Hyperf\Contract\MessageBag',
|
||||
'Hyperf\Utils\Contracts\MessageProvider' => 'Hyperf\Contract\MessageProvider',
|
||||
'Hyperf\Utils\Contracts\Xmlable' => 'Hyperf\Contract\Xmlable',
|
||||
|
||||
// Coordinator
|
||||
'Hyperf\Utils\Coordinator\Constants' => 'Hyperf\Coordinator\Constants',
|
||||
'Hyperf\Utils\Coordinator\Coordinator' => 'Hyperf\Coordinator\Coordinator',
|
||||
'Hyperf\Utils\Coordinator\CoordinatorManager' => 'Hyperf\Coordinator\CoordinatorManager',
|
||||
|
||||
// Coroutine
|
||||
'Hyperf\Utils\Coroutine\Concurrent' => 'Hyperf\Coroutine\Concurrent',
|
||||
'Hyperf\Utils\Coroutine\Locker' => 'Hyperf\Coroutine\Locker',
|
||||
|
||||
// Exception
|
||||
'Hyperf\Utils\Exception\ChannelClosedException' => 'Hyperf\Coroutine\Exception\ChannelClosedException',
|
||||
'Hyperf\Utils\Exception\ExceptionThrower' => 'Hyperf\Support\Exception\ExceptionThrower',
|
||||
'Hyperf\Utils\Exception\InvalidArgumentException' => 'Hyperf\Support\Exception\InvalidArgumentException',
|
||||
'Hyperf\Utils\Exception\IPReadFailedException' => 'Hyperf\Support\Exception\IPReadFailedException',
|
||||
'Hyperf\Utils\Exception\ParallelExecutionException' => 'Hyperf\Coroutine\Exception\ParallelExecutionException',
|
||||
'Hyperf\Utils\Exception\TimeoutException' => 'Hyperf\Coroutine\Exception\TimeoutException',
|
||||
'Hyperf\Utils\Exception\WaitTimeoutException' => 'Hyperf\Coroutine\Exception\WaitTimeoutException',
|
||||
|
||||
// Filesystem
|
||||
'Hyperf\Utils\Filesystem\FileNotFoundException' => 'Hyperf\Support\Filesystem\FileNotFoundException',
|
||||
'Hyperf\Utils\Filesystem\Filesystem' => 'Hyperf\Support\Filesystem\Filesystem',
|
||||
|
||||
// Packer
|
||||
'Hyperf\Utils\Packer\JsonPacker' => 'Hyperf\Codec\Packer\JsonPacker',
|
||||
'Hyperf\Utils\Packer\PhpSerializerPacker' => 'Hyperf\Codec\Packer\PhpSerializerPacker',
|
||||
|
||||
// Reflection
|
||||
'Hyperf\Utils\Reflection\ClassInvoker' => 'Hyperf\Support\Reflection\ClassInvoker',
|
||||
|
||||
// Serializer
|
||||
'Hyperf\Utils\Serializer\ExceptionNormalizer' => 'Hyperf\Serializer\ExceptionNormalizer',
|
||||
'Hyperf\Utils\Serializer\JsonDeNormalizer' => 'Hyperf\Serializer\JsonDeNormalizer',
|
||||
'Hyperf\Utils\Serializer\ScalarNormalizer' => 'Hyperf\Serializer\ScalarNormalizer',
|
||||
'Hyperf\Utils\Serializer\Serializer' => 'Hyperf\Serializer\Serializer',
|
||||
'Hyperf\Utils\Serializer\SerializerFactory' => 'Hyperf\Serializer\SerializerFactory',
|
||||
'Hyperf\Utils\Serializer\SimpleNormalizer' => 'Hyperf\Serializer\SimpleNormalizer',
|
||||
'Hyperf\Utils\Serializer\SymfonyNormalizer' => 'Hyperf\Serializer\SymfonyNormalizer',
|
||||
|
||||
// Traits
|
||||
'Hyperf\Utils\Traits\Conditionable' => 'Hyperf\Conditionable\Conditionable',
|
||||
'Hyperf\Utils\Traits\Container' => 'Hyperf\Support\Traits\Container',
|
||||
'Hyperf\Utils\Traits\CoroutineProxy' => 'Hyperf\Context\Traits\CoroutineProxy',
|
||||
'Hyperf\Utils\Traits\ForwardsCalls' => 'Hyperf\Support\Traits\ForwardsCalls',
|
||||
'Hyperf\Utils\Traits\StaticInstance' => 'Hyperf\Support\Traits\StaticInstance',
|
||||
'Hyperf\Utils\Traits\Tappable' => 'Hyperf\Tappable\Tappable',
|
||||
|
||||
// Utils
|
||||
'Hyperf\Utils\ApplicationContext' => 'Hyperf\Context\ApplicationContext',
|
||||
'Hyperf\Utils\Arr' => 'Hyperf\Collection\Arr',
|
||||
'Hyperf\Utils\Backoff' => 'Hyperf\Support\Backoff',
|
||||
'Hyperf\Utils\ChannelPool' => 'Hyperf\Coroutine\Channel\Pool',
|
||||
'Hyperf\Utils\ClearStatCache' => 'Hyperf\Support\ClearStatCache',
|
||||
'Hyperf\Utils\Collection' => 'Hyperf\Collection\Collection',
|
||||
'Hyperf\Utils\Composer' => 'Hyperf\Support\Composer',
|
||||
'Hyperf\Utils\Coroutine' => 'Hyperf\Coroutine\Coroutine',
|
||||
'Hyperf\Utils\Fluent' => 'Hyperf\Support\Fluent',
|
||||
'Hyperf\Utils\HigherOrderCollectionProxy' => 'Hyperf\Collection\HigherOrderCollectionProxy',
|
||||
'Hyperf\Utils\HigherOrderTapProxy' => 'Hyperf\Tappable\HigherOrderTapProxy',
|
||||
'Hyperf\Utils\InteractsWithTime' => 'Hyperf\Support\Traits\InteractsWithTime',
|
||||
'Hyperf\Utils\IPReader' => 'Hyperf\Support\IPReader',
|
||||
'Hyperf\Utils\MessageBag' => 'Hyperf\Support\MessageBag',
|
||||
'Hyperf\Utils\MimeTypeExtensionGuesser' => 'Hyperf\Support\MimeTypeExtensionGuesser',
|
||||
'Hyperf\Utils\Network' => 'Hyperf\Support\Network',
|
||||
'Hyperf\Utils\Optional' => 'Hyperf\Support\Optional',
|
||||
'Hyperf\Utils\Parallel' => 'Hyperf\Coroutine\Parallel',
|
||||
'Hyperf\Utils\Pipeline' => 'Hyperf\Pipeline\Pipeline',
|
||||
'Hyperf\Utils\Pluralizer' => 'Hyperf\Support\Pluralizer',
|
||||
'Hyperf\Utils\ResourceGenerator' => 'Hyperf\Support\ResourceGenerator',
|
||||
'Hyperf\Utils\SafeCaller' => 'Hyperf\Support\SafeCaller',
|
||||
'Hyperf\Utils\Str' => 'Hyperf\Stringable\Str',
|
||||
'Hyperf\Utils\Stringable' => 'Hyperf\Stringable\Stringable',
|
||||
'Hyperf\Utils\System' => 'Hyperf\Support\System',
|
||||
'Hyperf\Utils\Waiter' => 'Hyperf\Coroutine\Waiter',
|
||||
'Hyperf\Utils\WaitGroup' => 'Hyperf\Coroutine\WaitGroup',
|
||||
]);
|
||||
|
||||
$rectorConfig
|
||||
->ruleWithConfiguration(RenameFunctionRector::class, [
|
||||
// hyperf/config
|
||||
'config' => 'Hyperf\Config\config',
|
||||
|
||||
// hyperf/collection
|
||||
'collect' => 'Hyperf\Collection\collect',
|
||||
'data_fill' => 'Hyperf\Collection\data_fill',
|
||||
'data_get' => 'Hyperf\Collection\data_get',
|
||||
'data_set' => 'Hyperf\Collection\data_set',
|
||||
'head' => 'Hyperf\Collection\head',
|
||||
'last' => 'Hyperf\Collection\last',
|
||||
|
||||
// hyperf/continue
|
||||
'co' => 'Hyperf\Coroutine\co',
|
||||
'defer' => 'Hyperf\Coroutine\defer',
|
||||
'go' => 'Hyperf\Coroutine\go',
|
||||
'parallel' => 'Hyperf\Coroutine\parallel',
|
||||
'run' => 'Hyperf\Coroutine\run',
|
||||
'wait' => 'Hyperf\Coroutine\wait',
|
||||
|
||||
// hyperf/tappable
|
||||
'tap' => 'Hyperf\Tappable\tap',
|
||||
|
||||
// hyperf/translation
|
||||
'__' => 'Hyperf\Translation\__',
|
||||
'trans' => 'Hyperf\Translation\trans',
|
||||
'trans_choice' => 'Hyperf\Translation\trans_choice',
|
||||
|
||||
// hyperf/utils
|
||||
'value' => 'Hyperf\Support\value',
|
||||
'env' => 'Hyperf\Support\env',
|
||||
'retry' => 'Hyperf\Support\retry',
|
||||
'with' => 'Hyperf\Support\with',
|
||||
'call' => 'Hyperf\Support\call',
|
||||
'class_basename' => 'Hyperf\Support\class_basename',
|
||||
'trait_uses_recursive' => 'Hyperf\Support\trait_uses_recursive',
|
||||
'class_uses_recursive' => 'Hyperf\Support\class_uses_recursive',
|
||||
'setter' => 'Hyperf\Support\setter',
|
||||
'getter' => 'Hyperf\Support\getter',
|
||||
'make' => 'Hyperf\Support\make',
|
||||
'swoole_hook_flags' => 'Hyperf\Support\swoole_hook_flags',
|
||||
'optional' => 'Hyperf\Support\optional',
|
||||
]);
|
||||
|
||||
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
|
||||
new MethodCallRename('Hyperf\Dag\Dag', 'checkCircularDependences', 'checkCircularDependencies'),
|
||||
// new MethodCallRename('Hyperf\DbConnection\Connection', 'isTransaction', 'transactionLevel'),
|
||||
new MethodCallRename('Hyperf\Testing\Client', 'init', 'initRequest'),
|
||||
new MethodCallRename('Hyperf\Cache\CacheListenerCollector', 'getListner', 'getListener'),
|
||||
]);
|
||||
};
|
||||
@@ -1,9 +1,14 @@
|
||||
parameters:
|
||||
level: 6
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
checkGenericClassInNonGenericObjectType: false
|
||||
paths:
|
||||
- publish
|
||||
- src
|
||||
- tests
|
||||
ignoreErrors:
|
||||
- '#Constant BASE_PATH not found#'
|
||||
- '#Property [a-zA-Z0-9\\_]+::\$[a-zA-Z0-9]+ is never written, only read.#'
|
||||
- '#Unknown parameter \$[a-zA-Z0-9]+ in call to callable Closure\.#'
|
||||
- '#Property [a-zA-Z0-9\\_]+::\$[a-zA-Z0-9]+ is never written, only read\.#'
|
||||
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) is unused\.#'
|
||||
- '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) has parameter \$response with no value type specified in iterable type array\.#'
|
||||
|
||||
18
phpunit.xml
18
phpunit.xml
@@ -1,10 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php"
|
||||
colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
bootstrap="./tests/bootstrap.php"
|
||||
colors="true"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
|
||||
cacheDirectory=".phpunit.cache"
|
||||
>
|
||||
<coverage/>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory>./tests/Unit/</directory>
|
||||
<testsuite name="Tests">
|
||||
<directory>./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<source>
|
||||
<include>
|
||||
<directory>./app</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
// 响应
|
||||
'response' => [
|
||||
@@ -60,15 +62,15 @@ return [
|
||||
// 第三方服务
|
||||
'third_party' => [
|
||||
'email' => [
|
||||
'dsn' => 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465',
|
||||
'mailer_sender' => 'account@luxcreo.ai', // 发件邮箱
|
||||
'dsn' => 'smtp://noreply@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465',
|
||||
'mailer_sender' => 'noreply@luxcreo.ai', // 发件邮箱
|
||||
'mailer_sender_name' => 'LuxCreo', // 发件人名称
|
||||
],
|
||||
'sms' => [
|
||||
'aliyun' => [
|
||||
'access_key_id' => env('ACCESS_KEY_ID', ''),
|
||||
'access_key_secret' => env('ACCESS_KEY_SECRET', ''),
|
||||
'sign' => '', // 短信签名名称
|
||||
'sign_name' => '', // 短信签名名称
|
||||
'template_code' => '', // 短信模板CODE
|
||||
],
|
||||
],
|
||||
@@ -76,6 +78,8 @@ return [
|
||||
'oss' => [
|
||||
'access_key_id' => env('ACCESS_KEY_ID', ''),
|
||||
'access_key_secret' => env('ACCESS_KEY_SECRET', ''),
|
||||
'oss_host' => env('OSS_HOST', ''),
|
||||
'oss_callback' => env('OSS_CALLBACK'), // 可选
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
@@ -163,4 +163,11 @@ return [
|
||||
'default' => 'DOC deleted',
|
||||
],
|
||||
],
|
||||
|
||||
// 业务错误
|
||||
'business' => [
|
||||
'default' => 'Business Error',
|
||||
'old_version' => 'This feature is not available in the current version.',
|
||||
'not_implemented' => 'This feature is not implemented yet.',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -172,4 +172,11 @@ return [
|
||||
'default' => '文档已删除',
|
||||
],
|
||||
],
|
||||
|
||||
// 业务错误
|
||||
'business' => [
|
||||
'default' => '业务错误',
|
||||
'old_version' => '当前版本过低,请升级到最新版本',
|
||||
'not_implemented' => '该功能尚未实现',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
docker login harbor.luxcreo.cn -u php -p fTr6oVvqqdzVlYgnZhRPPAP54u7SmqGA
|
||||
|
||||
image_name=harbor.luxcreo.cn/php/composer-template
|
||||
docker build --tag $image_name .
|
||||
|
||||
#docker push $image_name
|
||||
#docker push ${image_name}-dev
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
docker run \
|
||||
--pull always \
|
||||
-ti --rm --name "hyperf-development-kit" \
|
||||
-ti --rm --name "hdk-core" \
|
||||
-w "/srv/www" \
|
||||
-v "$(pwd)":/srv/www \
|
||||
-v ~/.ssh:/root/.ssh \
|
||||
harbor.luxcreo.cn/library/hyperf:8.0-swoole /bin/ash
|
||||
-v ~/.gitconfig:/root/.gitconfig \
|
||||
harbor.luxcreo.cn/library/hyperf:8.1-swoole /bin/ash
|
||||
|
||||
5
scripts/release.sh
Executable file
5
scripts/release.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
docker run --rm -it \
|
||||
-v $(pwd):/app -e "GIT_AUTHOR_NAME=$(git config user.name)" -e "EMAIL=$(git config user.email)" \
|
||||
detouched/standard-version:latest -p=beta $1
|
||||
@@ -14,17 +14,21 @@ namespace Singularity\HDK\Core;
|
||||
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Framework\Logger\StdoutLogger;
|
||||
use Hyperf\HttpServer\Contract\CoreMiddlewareInterface;
|
||||
use Singularity\HDK\Core\Listener\EmailWillSentListener;
|
||||
use Singularity\HDK\Core\Listener\SmsWillSentListener;
|
||||
use Singularity\HDK\Core\Middleware\CommonCoreMiddleware;
|
||||
|
||||
class ConfigProvider
|
||||
{
|
||||
/** @phpstan-ignore-next-line */
|
||||
public function __invoke(): array
|
||||
{
|
||||
/** @noinspection PhpUndefinedConstantInspection */
|
||||
return [
|
||||
// 合并到 config/autoload/dependencies.php 文件
|
||||
'dependencies' => [
|
||||
StdoutLoggerInterface::class => StdoutLogger::class,
|
||||
CoreMiddlewareInterface::class => CommonCoreMiddleware::class
|
||||
],
|
||||
// 合并到 config/autoload/annotations.php 文件
|
||||
'annotations' => [
|
||||
@@ -38,7 +42,10 @@ class ConfigProvider
|
||||
'commands' => [
|
||||
],
|
||||
// 与 commands 类似
|
||||
'listeners' => [],
|
||||
'listeners' => [
|
||||
EmailWillSentListener::class,
|
||||
SmsWillSentListener::class
|
||||
],
|
||||
// 组件默认配置文件,即执行命令后会把 source 的对应的文件复制为 destination 对应的的文件
|
||||
'publish' => [
|
||||
[
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CommonErrorCode.php@hyperf-development-kit
|
||||
*
|
||||
@@ -11,386 +12,323 @@ namespace Singularity\HDK\Core\Constants;
|
||||
|
||||
use Hyperf\Constants\AbstractConstants;
|
||||
use Hyperf\Constants\Annotation\Constants;
|
||||
use Hyperf\Constants\Annotation\Message;
|
||||
|
||||
/**
|
||||
* @Constants
|
||||
* Singularity\HyperfDevelopmentKit\Utils\Constants\CommonErrorCode@hyperf-development-kit
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/4/25
|
||||
*
|
||||
* @see https://lux-software.yuque.com/htnx76/vcm2oc/pkzgpv
|
||||
*/
|
||||
#[Constants]
|
||||
class CommonErrorCode extends AbstractConstants
|
||||
{
|
||||
// =============== 9 服务器异常 =================
|
||||
|
||||
/**
|
||||
* @Message("common_error.server_common_error")
|
||||
*/
|
||||
public const SERVER_ERROR = 9000000;
|
||||
|
||||
/**
|
||||
* @Message("common_error.program.default")
|
||||
*/
|
||||
public const PROGRAM_ERROR = 9000000;
|
||||
|
||||
// 901 逻辑错误
|
||||
|
||||
/**
|
||||
* @Message("common_error.program.syntax.default")
|
||||
*/
|
||||
public const PROGRAM_SYNTAX_ERROR = 9010001;
|
||||
|
||||
// 902 SQL 错误
|
||||
|
||||
/**
|
||||
* @Message("common_error.program.sql.default")
|
||||
*/
|
||||
public const PROGRAM_SQL_ERROR = 9020001;
|
||||
|
||||
/**
|
||||
* @Message("common_error.program.sql.update")
|
||||
*/
|
||||
public const PROGRAM_SQL_UPDATE_ERROR = 9020101;
|
||||
|
||||
// 90201 字段不存在
|
||||
|
||||
/**
|
||||
* @Message("common_error.program.sql.column_not_found")
|
||||
*/
|
||||
public const PROGRAM_SQL_COLUMN_NOT_FOUND = 9020101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.program.sql.insert")
|
||||
*/
|
||||
public const PROGRAM_SQL_INSERT_ERROR = 9020201;
|
||||
|
||||
// =============== 1 请求错误 =================
|
||||
// 101 请求方式有误
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.method.default")
|
||||
*/
|
||||
public const REQUEST_METHOD_ERROR = 1010001;
|
||||
|
||||
// 102 参数非法
|
||||
|
||||
/**
|
||||
* 参数非法.
|
||||
* @Message("common_error.params.format_error")
|
||||
*/
|
||||
public const FORMATTER_ERROR = 1020001;
|
||||
|
||||
/**
|
||||
* 缺少参数.
|
||||
* @Message("common_error.params.error.default")
|
||||
*/
|
||||
public const REQUEST_PARAMS_MISS = 1020002;
|
||||
|
||||
/**
|
||||
* 签名非法.
|
||||
* @Message("common_error.params.error.default")
|
||||
*/
|
||||
public const REQUEST_SIGN_ERROR = 1020003;
|
||||
|
||||
|
||||
// 103 参数错误
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.default")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR = 1030001;
|
||||
|
||||
// 10301 用户信息错误
|
||||
/**
|
||||
* @Message("common_error.params.error.user.default")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER = 1030101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sign_up.default")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_REGISTERED = 1030102;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.username.unique")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_USERNAME_UNIQUE = 1030111;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sec_phone.unique")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_SEC_PHONE_UNIQUE = 1030121;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sec_phone.required")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_SEC_PHONE_REQUIRED = 1030122;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sec_phone.undefined")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_SEC_PHONE_UNDEFINED = 1030123;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sec_email.unique")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_SEC_EMAIL_UNIQUE = 1030131;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sec_email.required")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_SEC_EMAIL_REQUIRED = 1030132;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.sec_email.undefined")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_SEC_EMAIL_UNDEFINED = 1030133;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.user.action.error")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_USER_ACTION_ERROR = 1030141;
|
||||
|
||||
// 10302 验证码错误
|
||||
/**
|
||||
* @Message("common_error.params.error.code.error")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_CODE_ERROR = 1030201;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.code.timeout")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_CODE_TIMEOUT = 1030202;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.code.limit.minute")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_CODE_MAX_TIMES_MINUTE = 1030301;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.code.limit.hour")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_CODE_MAX_TIMES_HOUR = 1030302;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.code.limit.day")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_CODE_MAX_TIMES_DAY = 1030303;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.target.format")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_TARGET_FORMAT = 1030401;
|
||||
|
||||
/**
|
||||
* @Message("common_error.params.error.target.missing")
|
||||
*/
|
||||
public const REQUEST_PARAMS_ERROR_TARGET_MISSING = 1030402;
|
||||
|
||||
// =============== 2 鉴权问题 =================
|
||||
// 201 JWT 鉴权失败
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.default")
|
||||
*/
|
||||
public const UNAUTHORIZED = 200000;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.jwt.default")
|
||||
*/
|
||||
public const AUTH_JWT_ERROR = 201000;
|
||||
|
||||
// 20101 验证
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.jwt.iat")
|
||||
*/
|
||||
public const AUTH_JWT_IAT_ERROR = 2010101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.jwt.nbf")
|
||||
*/
|
||||
public const AUTH_JWT_NBF_ERROR = 2010102;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.jwt.exp")
|
||||
*/
|
||||
public const AUTH_JWT_EXP_TIMEOUT = 2010103;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.jwt.iss")
|
||||
*/
|
||||
public const AUTH_JWT_ISS_ERROR = 2010104;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.jwt.uid")
|
||||
*/
|
||||
public const AUTH_JWT_UID_ERROR = 2010105;
|
||||
|
||||
// 202 Session 鉴权
|
||||
/**
|
||||
* @Message("common_error.auth.session.default")
|
||||
*/
|
||||
public const AUTH_SESSION_ERROR = 202000;
|
||||
|
||||
// 20201 验证
|
||||
/**
|
||||
* @Message("common_error.auth.session.uid")
|
||||
*/
|
||||
public const AUTH_SESSION_UID_ERROR = 2020101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.session.created_at")
|
||||
*/
|
||||
public const AUTH_SESSION_CREATED_AT_ERROR = 2020102;
|
||||
|
||||
|
||||
// 203 SAML 鉴权
|
||||
/**
|
||||
* @Message("common_error.auth.saml.default")
|
||||
*/
|
||||
public const AUTH_SAML_ERROR = 203000;
|
||||
|
||||
// 20301 验证
|
||||
/**
|
||||
* @Message("common_error.auth.saml.params.default")
|
||||
*/
|
||||
public const AUTH_SAML_REQUEST_PARAMS_ERROR = 2030100;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.saml.params.saml_request")
|
||||
*/
|
||||
public const AUTH_SAML_REQUEST_PARAMS_SAML_REQUEST = 2030101;
|
||||
|
||||
|
||||
// 204 无权访问
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.default")
|
||||
*/
|
||||
public const FORBIDDEN = 204000;
|
||||
|
||||
// 20401 无权访问
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.read.default")
|
||||
*/
|
||||
public const FORBIDDEN_READ_ERROR = 2040101;
|
||||
|
||||
// 20402 无权修改
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.update.default")
|
||||
*/
|
||||
public const FORBIDDEN_UPDATE_ERROR = 2040201;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.update.address.unique")
|
||||
*/
|
||||
public const FORBIDDEN_UPDATE_ADDRESS_DEFAULT_UNIQUE_ERROR = 2040211;
|
||||
|
||||
// 20403 无权创建
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.create.default")
|
||||
*/
|
||||
public const FORBIDDEN_CREATE_ERROR = 2040301;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.create.wechat.redundant")
|
||||
*/
|
||||
public const FORBIDDEN_CREATE_WECHAT_REDUNDANT_ERROR = 2040311;
|
||||
|
||||
// 20404 无权删除
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.delete.default")
|
||||
*/
|
||||
public const FORBIDDEN_DELETE_ERROR = 2040401;
|
||||
|
||||
/**
|
||||
* @Message("common_error.auth.forbidden.delete.wechat.only")
|
||||
*/
|
||||
public const FORBIDDEN_DELETE_ONLY_USERNAME_WITH_WECHAT = 2040411;
|
||||
|
||||
// 205 App 鉴权
|
||||
/**
|
||||
* @Message("common_error.auth.app.default")
|
||||
*/
|
||||
public const AUTH_APP_ERROR = 205000;
|
||||
|
||||
// ============== 3 依赖服务出错 ===============
|
||||
// 303 缓存异常
|
||||
// 30301 Redis 异常
|
||||
|
||||
/**
|
||||
* @Message("common_error.server.cache.redis.default")
|
||||
*/
|
||||
public const SERVER_CACHE_REDIS_ERROR = 3030101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.server.cache.redis.refused")
|
||||
*/
|
||||
public const SERVER_CACHE_REDIS_REFUSED_ERROR = 3030110;
|
||||
|
||||
// 30302 SMS 异常
|
||||
/**
|
||||
* @Message("common_error.server.dependency_sms_common_error")
|
||||
*/
|
||||
public const SERVER_DEPENDENCY_SMS_ERROR = 3030201;
|
||||
|
||||
// 30303 微信错误
|
||||
/**
|
||||
* @Message("common_error.server.dependency.wechat.default")
|
||||
*/
|
||||
public const SERVER_DEPENDENCY_WECHAT_ERROR = 3030301;
|
||||
|
||||
/**
|
||||
* @Message("common_error.server.dependency.wechat.code")
|
||||
*/
|
||||
public const SERVER_DEPENDENCY_WECHAT_CODE_ERROR = 3030302;
|
||||
|
||||
/**
|
||||
* @Message("common_error.server.dependency.wechat.timeout")
|
||||
*/
|
||||
public const SERVER_DEPENDENCY_WECHAT_CODE_TIMEOUT_ERROR = 3030311;
|
||||
|
||||
// 306 消息异常
|
||||
// 30601 自建邮箱发件服务异常
|
||||
/**
|
||||
* @Message("common_error.server.message.email.default")
|
||||
*/
|
||||
public const SERVER_MESSAGE_EMAIL_ERROR = 3060101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.server.message.email.not_found")
|
||||
*/
|
||||
public const SERVER_MESSAGE_EMAIL_NOT_FOUND = 3060102;
|
||||
|
||||
// =============== 4 资源不存在 ================
|
||||
// 401 路由不存在
|
||||
/**
|
||||
* @Message("common_error.not_found.route.default")
|
||||
*/
|
||||
public const ROUTE_NOT_FOUND = 4010001;
|
||||
|
||||
// 402 模型不存在
|
||||
/**
|
||||
* @Message("common_error.model.not_found")
|
||||
*/
|
||||
public const MODEL_NOT_FOUND = 4020001;
|
||||
|
||||
// 40201 用户不存在
|
||||
/**
|
||||
* @Message("common_error.model.user.default")
|
||||
* @note !!!这个码一定不要改,前端根据这个做判断了!!!!
|
||||
*/
|
||||
public const USER_NOT_FOUND = 4020101;
|
||||
|
||||
/**
|
||||
* @Message("common_error.model.user.not_valid")
|
||||
*/
|
||||
public const USER_NOT_VALID = 4020102;
|
||||
|
||||
/**
|
||||
* @Message("common_error.model.document.default")
|
||||
*/
|
||||
public const DOCUMENT_NOT_EXISTS = 4020201;
|
||||
|
||||
// 500 业务错误
|
||||
|
||||
#[Message('common_error.business.defaul')]
|
||||
public const BUSINESS_ERROR = 500001;
|
||||
// 501 版本问题
|
||||
#[Message('common_error.business.old_version')]
|
||||
public const BUSINESS_FLAT_OLD_VERSION = 501001;
|
||||
|
||||
#[Message('common_error.business.not_implemented')]
|
||||
public const BUSINESS_NOT_IMPLEMENTED = 501002;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AbstractController.php@hyperf-development-kit
|
||||
*
|
||||
@@ -20,8 +21,8 @@ use Dont\DontToString;
|
||||
use Hyperf\Contract\ContainerInterface;
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||
use Hyperf\HttpServer\Contract\ResponseInterface;
|
||||
use Singularity\HDK\Core\Traits\RestfulList;
|
||||
|
||||
/**
|
||||
* 抽象控制器基类
|
||||
@@ -41,28 +42,14 @@ abstract class AbstractController
|
||||
use DontSerialise;
|
||||
use DontDeserialise;
|
||||
use DontToString;
|
||||
use RestfulList;
|
||||
|
||||
/**
|
||||
* @Inject
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
#[Inject]
|
||||
protected ContainerInterface $container;
|
||||
|
||||
/**
|
||||
* @Inject
|
||||
* @var RequestInterface
|
||||
*/
|
||||
protected RequestInterface $request;
|
||||
|
||||
/**
|
||||
* @Inject
|
||||
* @var ResponseInterface
|
||||
*/
|
||||
#[Inject]
|
||||
protected ResponseInterface $response;
|
||||
|
||||
/**
|
||||
* @Inject
|
||||
* @var \Hyperf\Contract\StdoutLoggerInterface
|
||||
*/
|
||||
#[Inject]
|
||||
protected StdoutLoggerInterface $stdoutLogger;
|
||||
}
|
||||
|
||||
16
src/Enumerations/Sp/EnvConfiguration.php
Normal file
16
src/Enumerations/Sp/EnvConfiguration.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* EnvConfiguration.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/7/11
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Enumerations\Sp;
|
||||
|
||||
interface EnvConfiguration
|
||||
{
|
||||
public const DEVELOPMENT = 'development';
|
||||
public const PRODUCTION = 'production';
|
||||
}
|
||||
12
src/Enumerations/Sp/ServiceProviderConfiguration.php
Normal file
12
src/Enumerations/Sp/ServiceProviderConfiguration.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* ServiceProviderConfiguration.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/7/11
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Enumerations\Sp;
|
||||
|
||||
interface ServiceProviderConfiguration extends EnvConfiguration, SiteConfiguration {}
|
||||
16
src/Enumerations/Sp/SiteConfiguration.php
Normal file
16
src/Enumerations/Sp/SiteConfiguration.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* SiteConfigration.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/7/11
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Enumerations\Sp;
|
||||
|
||||
interface SiteConfiguration
|
||||
{
|
||||
public const CN = 'CN';
|
||||
public const NA = 'NA';
|
||||
}
|
||||
86
src/Events/EmailWillSent.php
Normal file
86
src/Events/EmailWillSent.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* EmailWillSent.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Events;
|
||||
|
||||
use Singularity\HDK\Core\Service\EmailService;
|
||||
use Symfony\Component\Mime\Address;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Events\EmailWillSent@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*
|
||||
* @link ../../docs/Email.md
|
||||
*/
|
||||
class EmailWillSent
|
||||
{
|
||||
public function __construct(
|
||||
/**
|
||||
* @var Address|string|string[]|Address[] $target
|
||||
*/
|
||||
public Address|string|array $target,
|
||||
|
||||
/**
|
||||
* @var non-empty-string $subject
|
||||
*/
|
||||
public string $subject,
|
||||
|
||||
/**
|
||||
* @var non-empty-string $content
|
||||
*/
|
||||
public string $content,
|
||||
|
||||
/**
|
||||
* 抄送
|
||||
*
|
||||
* @var string[] $cc
|
||||
*/
|
||||
public array $cc = [],
|
||||
|
||||
/**
|
||||
* 密送
|
||||
*
|
||||
* @var string[] $bcc
|
||||
*/
|
||||
public array $bcc = [],
|
||||
|
||||
/**
|
||||
* @var 'text'|'html' $type
|
||||
*/
|
||||
public string $type = 'text',
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @see Email::priority()
|
||||
*/
|
||||
public int $priority = Email::PRIORITY_NORMAL,
|
||||
|
||||
/**
|
||||
* @var EmailService|null
|
||||
*/
|
||||
public ?EmailService $sender = null,
|
||||
|
||||
/**
|
||||
* 附件路径集合、含附件路径、文件名、文件类型的数组集合
|
||||
* @var string[]|array{'path': string, 'name': string, 'mimeType': string}[] $attachmentPaths
|
||||
*/
|
||||
public array $attachmentPaths = [],
|
||||
|
||||
/**
|
||||
* 附件内容集合、含附件内容、文件名、文件类型的数组集合
|
||||
* @var string[]|array{'content': string, 'name': string, 'mimeType': string}[] $attachments
|
||||
*/
|
||||
public array $attachments = [],
|
||||
) {}
|
||||
}
|
||||
48
src/Events/SmsWillSent.php
Normal file
48
src/Events/SmsWillSent.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* SmsWillSent.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Events;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Events\SmsWillSent@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*
|
||||
* @link ../../docs/SMS.md
|
||||
*/
|
||||
class SmsWillSent
|
||||
{
|
||||
public function __construct(
|
||||
/**
|
||||
* @var non-empty-string $phone 目标手机号
|
||||
* @example +8613700000001
|
||||
* @example 8613700000001
|
||||
* @example 13700000001
|
||||
*/
|
||||
public string $phone,
|
||||
|
||||
/**
|
||||
* @var array<literal-string, literal-string|int>|null $templateParam 模板变量
|
||||
*/
|
||||
public ?array $templateParam = null,
|
||||
|
||||
/**
|
||||
* @var literal-string|null $templateCode 模板代码
|
||||
*/
|
||||
public ?string $templateCode = null,
|
||||
|
||||
/**
|
||||
* @var literal-string|null $signName 模板签名
|
||||
*/
|
||||
public ?string $signName = null,
|
||||
) {
|
||||
}
|
||||
}
|
||||
34
src/Exceptions/ApiMigrated.php
Normal file
34
src/Exceptions/ApiMigrated.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* DomainOrderNotSupportException.php@LuxDesign
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/1
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Core\Exceptions;
|
||||
|
||||
use Hyperf\HttpMessage\Exception\HttpException;
|
||||
use Singularity\HDK\Core\Constants\CommonErrorCode;
|
||||
use Teapot\StatusCode\RFC\RFC7231;
|
||||
use Throwable;
|
||||
|
||||
final class ApiMigrated extends HttpException
|
||||
{
|
||||
public function __construct(
|
||||
public string $apiPath,
|
||||
int $code = CommonErrorCode::BUSINESS_FLAT_OLD_VERSION,
|
||||
?string $message = null,
|
||||
Throwable $previous = null,
|
||||
) {
|
||||
parent::__construct(RFC7231::SEE_OTHER, $message, $code, $previous);
|
||||
}
|
||||
|
||||
public function getNewPath(): string
|
||||
{
|
||||
return $this->apiPath;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ use Singularity\HDK\Core\Constants\CommonErrorCode;
|
||||
use Teapot\StatusCode\RFC\RFC7231;
|
||||
use Throwable;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
/**
|
||||
* 用户无权访问
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Core\Exceptions\Handler;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use GuzzleHttp\Exception\ServerException;
|
||||
use Hyperf\Codec\Json;
|
||||
use Hyperf\Database\Exception\QueryException;
|
||||
use Hyperf\Database\Model\ModelNotFoundException;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
@@ -23,17 +27,23 @@ use Hyperf\HttpMessage\Exception\MethodNotAllowedHttpException;
|
||||
use Hyperf\HttpMessage\Exception\NotFoundHttpException;
|
||||
use Hyperf\HttpMessage\Stream\SwooleStream;
|
||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||
use Hyperf\Utils\Codec\Json;
|
||||
use Hyperf\Validation\ValidationException;
|
||||
use Lmc\HttpConstants\Header;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use RedisException;
|
||||
use Singularity\HDK\Core\Constants\CommonErrorCode;
|
||||
use Singularity\HDK\Core\Exceptions\ApiMigrated;
|
||||
use Singularity\HDK\Core\Exceptions\NotImplementedException;
|
||||
use Singularity\HDK\Core\Exceptions\ValidateException;
|
||||
use Singularity\HDK\Core\Service\ApiStyleService;
|
||||
use Symfony\Component\Mailer\Exception\TransportException;
|
||||
use Teapot\StatusCode\RFC\RFC4918;
|
||||
use Teapot\StatusCode\RFC\RFC7231;
|
||||
use Throwable;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
use function Hyperf\Translation\__;
|
||||
|
||||
/**
|
||||
* 通用异常处理
|
||||
* Singularity\HDK\Utils\Exceptions\Handler\CommonHandler@hyperf-development-kit
|
||||
@@ -44,69 +54,69 @@ use Throwable;
|
||||
*/
|
||||
class CommonHandler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* @Inject(required=false)
|
||||
*
|
||||
* @var RequestInterface|null
|
||||
*/
|
||||
#[Inject(required: false)]
|
||||
private ?RequestInterface $request;
|
||||
|
||||
/**
|
||||
* @Inject
|
||||
* @var StdoutLogger
|
||||
*/
|
||||
#[Inject]
|
||||
private StdoutLogger $logger;
|
||||
|
||||
#[Inject]
|
||||
private ApiStyleService $apiStyleService;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function handle(
|
||||
Throwable $throwable,
|
||||
ResponseInterface $response
|
||||
): ResponseInterface {
|
||||
public function handle(Throwable $throwable, ResponseInterface $response): ResponseInterface
|
||||
{
|
||||
// 阻止异常冒泡
|
||||
$this->stopPropagation();
|
||||
|
||||
$restful = config('common.response.restful');
|
||||
$restful = $this->apiStyleService->get();
|
||||
// $restful = config('common.response.restful');
|
||||
$code_name = config('common.response.code_name');
|
||||
$message_name = config('common.response.message_name');
|
||||
|
||||
$is_testing = config('app_status') === true;
|
||||
$this->request?->url();
|
||||
|
||||
$is_debug = $this->request?->hasHeader('Postman-Token')
|
||||
|| str_starts_with($this->request?->header('User-Agent'), 'apifox');
|
||||
|
||||
$is_debug = $is_testing;
|
||||
$error_type = $throwable::class;
|
||||
$request_time = date('Y-m-d H:i:s');
|
||||
$request_time = Carbon::now()->toDateTimeString();
|
||||
$request_data = Json::encode($this->request?->getParsedBody());
|
||||
$request_headers = Json::encode($this->request?->getHeaders());
|
||||
|
||||
// 901 程序语法错误
|
||||
|
||||
// 902 SQL 语法错误
|
||||
if ($throwable instanceof QueryException) {
|
||||
$code = match ($throwable->getCode()) {
|
||||
'42S22' => CommonErrorCode::PROGRAM_SQL_COLUMN_NOT_FOUND,
|
||||
default => CommonErrorCode::PROGRAM_SQL_ERROR
|
||||
default => CommonErrorCode::PROGRAM_SQL_ERROR,
|
||||
};
|
||||
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => CommonErrorCode::getMessage(
|
||||
$is_testing
|
||||
? $code
|
||||
: CommonErrorCode::PROGRAM_SQL_ERROR
|
||||
),
|
||||
$message_name => CommonErrorCode::getMessage($is_testing ? $code : CommonErrorCode::PROGRAM_SQL_ERROR),
|
||||
];
|
||||
if ($is_testing) {
|
||||
$data['details'] = [
|
||||
'sql' => $throwable->getSql(),
|
||||
'error' => $throwable->getMessage(),
|
||||
];
|
||||
$data['details'] = ['sql' => $throwable->getSql(), 'error' => $throwable->getMessage()];
|
||||
}
|
||||
}
|
||||
if ($throwable instanceof ClientException) {
|
||||
$content = $throwable->getResponse()->getBody()->getContents();
|
||||
|
||||
['errorCode' => $code, 'errorMsg' => $msg] = Json::decode($content);
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => $msg,
|
||||
];
|
||||
$status_code = 400;
|
||||
}
|
||||
if ($throwable instanceof ServerException) {
|
||||
$content = $throwable->getResponse()->getBody()->getContents();
|
||||
|
||||
['errorCode' => $code, 'errorMsg' => $msg] = Json::decode($content);
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => $msg,
|
||||
];
|
||||
$status_code = 500;
|
||||
}
|
||||
// 101 请求方式错误
|
||||
if ($throwable instanceof MethodNotAllowedHttpException) {
|
||||
$message = explode(': ', $throwable->getMessage());
|
||||
@@ -114,73 +124,67 @@ class CommonHandler extends ExceptionHandler
|
||||
$code = CommonErrorCode::REQUEST_METHOD_ERROR;
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => CommonErrorCode::getMessage($code, [
|
||||
'methods' => join(', ', $allow_method),
|
||||
]),
|
||||
$message_name => CommonErrorCode::getMessage($code, ['methods' => join(', ', $allow_method)]),
|
||||
'currentMethod' => $this->request?->getMethod(),
|
||||
'allowedMethod' => $allow_method,
|
||||
];
|
||||
$status_code = RFC7231::METHOD_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
// 验证失败
|
||||
if ($throwable instanceof BadRequestHttpException) {
|
||||
$data = [
|
||||
$code_name => CommonErrorCode::REQUEST_PARAMS_ERROR,
|
||||
$message_name => $is_testing
|
||||
? $throwable->getMessage()
|
||||
: CommonErrorCode::getMessage(CommonErrorCode::SERVER_ERROR),
|
||||
$message_name => $is_testing ? $throwable->getMessage() : CommonErrorCode::getMessage(
|
||||
CommonErrorCode::SERVER_ERROR,
|
||||
),
|
||||
];
|
||||
$status_code = RFC4918::UNPROCESSABLE_ENTITY;
|
||||
}
|
||||
|
||||
if ($throwable instanceof ValidationException) {
|
||||
$data = $throwable->validator->errors()->first();
|
||||
|
||||
if (is_numeric($data)) {
|
||||
$code = (int)$data;
|
||||
$data = CommonErrorCode::getMessage($code);
|
||||
}
|
||||
$data = [
|
||||
$code_name => $code ?? CommonErrorCode::REQUEST_PARAMS_ERROR,
|
||||
$message_name => $data,
|
||||
];
|
||||
$data = [$code_name => $code ?? CommonErrorCode::REQUEST_PARAMS_ERROR, $message_name => $data];
|
||||
$status_code = RFC4918::UNPROCESSABLE_ENTITY;
|
||||
}
|
||||
if ($throwable instanceof ValidateException) {
|
||||
$status_code = RFC4918::UNPROCESSABLE_ENTITY;
|
||||
$code = $throwable->getCode();
|
||||
$message = $throwable->getMessage();
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => empty($message) ? CommonErrorCode::getMessage($code, [
|
||||
'param' => $throwable->getFieldName(),
|
||||
]) : $message,
|
||||
$message_name => empty($message)
|
||||
? CommonErrorCode::getMessage(
|
||||
$code,
|
||||
[
|
||||
'param' => $throwable->getFieldName(),
|
||||
],
|
||||
)
|
||||
: $message,
|
||||
];
|
||||
if ($is_debug) {
|
||||
$data['currentValue'] = $throwable->getCurrentValue();
|
||||
$data['availableValue'] = $throwable->getAvailableValue();
|
||||
}
|
||||
}
|
||||
|
||||
// 路由不存在
|
||||
if ($throwable instanceof NotFoundHttpException) {
|
||||
$code = CommonErrorCode::ROUTE_NOT_FOUND;
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => CommonErrorCode::getMessage($code),
|
||||
];
|
||||
$status_code = 404;
|
||||
$data = [$code_name => $code, $message_name => CommonErrorCode::getMessage($code)];
|
||||
$status_code = RFC7231::NOT_FOUND;
|
||||
}
|
||||
// 模型不存在
|
||||
if ($throwable instanceof ModelNotFoundException) {
|
||||
$code = empty($throwable->getCode()) ? CommonErrorCode::MODEL_NOT_FOUND : $throwable->getCode();
|
||||
$message = empty($throwable->getCode()) ? CommonErrorCode::getMessage($code, [
|
||||
'resource' => '资源',
|
||||
]) : $throwable->getMessage();
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => $message,
|
||||
];
|
||||
$status_code = 404;
|
||||
$message = empty($throwable->getCode()) ? CommonErrorCode::getMessage(
|
||||
$code,
|
||||
['resource' => '资源'],
|
||||
) : $throwable->getMessage();
|
||||
$data = [$code_name => $code, $message_name => $message];
|
||||
$status_code = RFC7231::NOT_FOUND;
|
||||
}
|
||||
|
||||
// 300 服务出错
|
||||
// 303 缓存异常
|
||||
if ($throwable instanceof RedisException) {
|
||||
@@ -191,13 +195,10 @@ class CommonHandler extends ExceptionHandler
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => CommonErrorCode::getMessage(
|
||||
$is_testing
|
||||
? $code
|
||||
: CommonErrorCode::SERVER_CACHE_REDIS_ERROR
|
||||
$is_testing ? $code : CommonErrorCode::SERVER_CACHE_REDIS_ERROR,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
// 306 消息异常
|
||||
// 30601 邮箱发件异常
|
||||
if ($throwable instanceof TransportException) {
|
||||
@@ -208,60 +209,68 @@ class CommonHandler extends ExceptionHandler
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => CommonErrorCode::getMessage(
|
||||
$is_testing
|
||||
? $code
|
||||
: CommonErrorCode::SERVER_MESSAGE_EMAIL_ERROR
|
||||
$is_testing ? $code : CommonErrorCode::SERVER_MESSAGE_EMAIL_ERROR,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
// 500 业务错误
|
||||
if ($throwable instanceof ApiMigrated) {
|
||||
$code = $throwable->getCode();
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => $throwable->getMessage(),
|
||||
];
|
||||
$headers = [
|
||||
'Location' => $throwable->getNewPath(),
|
||||
];
|
||||
}
|
||||
if ($throwable instanceof NotImplementedException || $throwable instanceof \Hyperf\Framework\Exception\NotImplementedException) {
|
||||
$code = $throwable->getCode();
|
||||
if ($code === 0) {
|
||||
$code = CommonErrorCode::BUSINESS_NOT_IMPLEMENTED;
|
||||
}
|
||||
$message = $throwable->getMessage() ?? CommonErrorCode::getMessage($code);
|
||||
$data = [
|
||||
$code_name => $code,
|
||||
$message_name => $message,
|
||||
];
|
||||
}
|
||||
if (empty($data)) {
|
||||
// 其他情况
|
||||
$data = [
|
||||
$code_name => $is_testing
|
||||
? ($throwable->getCode() == 0
|
||||
? CommonErrorCode::SERVER_ERROR
|
||||
: $throwable->getCode())
|
||||
: CommonErrorCode::SERVER_ERROR,
|
||||
$code_name => $is_testing ? $throwable->getCode(
|
||||
) == 0 ? CommonErrorCode::SERVER_ERROR : $throwable->getCode() : CommonErrorCode::SERVER_ERROR,
|
||||
$message_name => $is_testing ? $throwable->getMessage() : __(
|
||||
CommonErrorCode::getMessage(CommonErrorCode::SERVER_ERROR)
|
||||
CommonErrorCode::getMessage(CommonErrorCode::SERVER_ERROR),
|
||||
),
|
||||
];
|
||||
|
||||
// 其他错误
|
||||
if ($throwable instanceof HttpException) {
|
||||
$data = [
|
||||
$code_name => $throwable->getCode() ?: $throwable->getStatusCode(),
|
||||
$message_name => $throwable->getMessage(),
|
||||
];
|
||||
$status_code = $throwable->getStatusCode();
|
||||
}
|
||||
}
|
||||
|
||||
$response = $response->withHeader(
|
||||
Header::CONTENT_TYPE,
|
||||
'application/json; charset=utf-8'
|
||||
);
|
||||
|
||||
$response = $response->withHeader(Header::CONTENT_TYPE, 'application/json; charset=utf-8');
|
||||
if ($is_debug && $is_testing) {
|
||||
$data['trace'] = [
|
||||
'errorType' => $error_type,
|
||||
'errorTrack' => $throwable->getTrace(),
|
||||
];
|
||||
$data += ['errorType' => $error_type, 'errorTrack' => $throwable->getTrace()];
|
||||
}
|
||||
$cookies = json_encode($this->request->getCookieParams(), JSON_UNESCAPED_UNICODE);
|
||||
$this->logger->error(
|
||||
<<<ERROR_LOG
|
||||
TYPE: $error_type
|
||||
TYPE: {$error_type}
|
||||
[$data[$code_name]] $data[$message_name]
|
||||
{$throwable->getMessage()}
|
||||
-------------------------------
|
||||
REQUEST_TIME: $request_time
|
||||
REQUEST_TIME: {$request_time}
|
||||
-------------------------------
|
||||
REQUEST_HEADERS:
|
||||
$request_headers
|
||||
{$request_headers}
|
||||
-------------------------------
|
||||
REQUEST_COOKIES:
|
||||
$cookies
|
||||
{$cookies}
|
||||
-------------------------------
|
||||
REQUEST_METHOD:
|
||||
{$this->request?->getMethod()}
|
||||
@@ -273,28 +282,23 @@ REQUEST_QUERY:
|
||||
{$this->request?->getQueryString()}
|
||||
-------------------------------
|
||||
REQUEST_DATA:
|
||||
$request_data
|
||||
{$request_data}
|
||||
-------------------------------
|
||||
TRACE:
|
||||
{$throwable->getTraceAsString()}
|
||||
===============================
|
||||
|
||||
ERROR_LOG
|
||||
ERROR_LOG,
|
||||
);
|
||||
$data = Json::encode($data);
|
||||
|
||||
if ($restful) {
|
||||
if ($restful === ApiStyleService::RESTFUL) {
|
||||
$response = $response->withStatus(
|
||||
$status_code ??
|
||||
$throwable->status ??
|
||||
$throwable->statusCode ??
|
||||
RFC7231::INTERNAL_SERVER_ERROR
|
||||
$status_code ?? $throwable->status ?? $throwable->statusCode ?? RFC7231::INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
return $response
|
||||
->withBody(
|
||||
new SwooleStream($data)
|
||||
);
|
||||
foreach ($headers ?? [] as $header => $value) {
|
||||
$response->withHeader($header, $value);
|
||||
}
|
||||
return $response->withBody(new SwooleStream($data));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
29
src/Exceptions/NotImplementedException.php
Normal file
29
src/Exceptions/NotImplementedException.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NotImplementedException.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/2
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Core\Exceptions;
|
||||
|
||||
use Hyperf\HttpMessage\Exception\HttpException;
|
||||
use Singularity\HDK\Core\Constants\CommonErrorCode;
|
||||
use Teapot\StatusCode\RFC\RFC7231;
|
||||
use Throwable;
|
||||
|
||||
final class NotImplementedException extends HttpException
|
||||
{
|
||||
public function __construct(
|
||||
int $code = CommonErrorCode::BUSINESS_NOT_IMPLEMENTED,
|
||||
?string $message = null,
|
||||
Throwable $previous = null,
|
||||
) {
|
||||
$message ??= CommonErrorCode::getMessage($code);
|
||||
parent::__construct(RFC7231::NOT_IMPLEMENTED, $message, $code, $previous);
|
||||
}
|
||||
}
|
||||
207
src/Http/RequestService.php
Normal file
207
src/Http/RequestService.php
Normal file
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Core\Http;
|
||||
|
||||
use Ergebnis\Http\Method\Rfc\Rfc5789;
|
||||
use Ergebnis\Http\Method\Rfc\Rfc7231;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Utils;
|
||||
use Hyperf\Codec\Json;
|
||||
use Hyperf\Guzzle\ClientFactory;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Singularity\HDK\Core\Service\AbstractSingleton;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Service\Http\RequestService@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/8/30
|
||||
*
|
||||
* @template Options of array<literal-string, mixed>
|
||||
*/
|
||||
final class RequestService extends AbstractSingleton
|
||||
{
|
||||
// public const TIMEOUT = 20;
|
||||
|
||||
private ClientFactory $client;
|
||||
|
||||
/**
|
||||
* @var Options
|
||||
*/
|
||||
private array $options = [];
|
||||
|
||||
/**
|
||||
* @param Options $options
|
||||
*/
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
$this->setOptions($options);
|
||||
/** @var ClientFactory $client */
|
||||
$client = make(ClientFactory::class);
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定制 options
|
||||
*
|
||||
* @param Options $options
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions(array $options): self
|
||||
{
|
||||
$this->options = array_replace_recursive($this->options, $options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, string|int> $params
|
||||
* @param array<string, mixed> $data
|
||||
* @param Options $options
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestGet(
|
||||
string $url,
|
||||
array $params = [],
|
||||
array $data = [],
|
||||
array $options = []
|
||||
): ResponseInterface {
|
||||
$request = new Request(
|
||||
method: Rfc7231::GET,
|
||||
uri: $url
|
||||
);
|
||||
return $this->getClient($options)->send($request, ['query' => $params, 'json' => $data,]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工厂模式初始化请求
|
||||
*
|
||||
* @param Options $options
|
||||
*
|
||||
* @return Client
|
||||
*/
|
||||
private function getClient(array $options): Client
|
||||
{
|
||||
$options = array_replace_recursive($this->options, $options);
|
||||
return $this->client->create($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, string|int> $params
|
||||
* @param array<string, mixed> $data
|
||||
* @param Options $options
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestPost(
|
||||
string $url,
|
||||
array $params = [],
|
||||
array $data = [],
|
||||
array $options = []
|
||||
): ResponseInterface {
|
||||
$data = Json::encode($data);
|
||||
$request = new Request(
|
||||
method: Rfc7231::POST,
|
||||
uri: $url,
|
||||
headers: ['Content-Type' => 'application/json'],
|
||||
body: Utils::streamFor($data),
|
||||
);
|
||||
return $this->getClient($options)->send($request, ['query' => $params,]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, mixed> $data
|
||||
* @param array<string, string|int> $params
|
||||
* @param Options $options
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestPut(
|
||||
string $url,
|
||||
array $params = [],
|
||||
array $data = [],
|
||||
array $options = []
|
||||
): ResponseInterface {
|
||||
$data = Json::encode($data);
|
||||
$request = new Request(
|
||||
method: Rfc7231::PUT,
|
||||
uri: $url,
|
||||
headers: ['Content-Type' => 'application/json'],
|
||||
body: Utils::streamFor($data)
|
||||
);
|
||||
return $this->getClient($options)->send(
|
||||
$request,
|
||||
['query' => $params,]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, mixed> $data
|
||||
* @param array<string, string|int> $params
|
||||
* @param Options $options
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestPatch(
|
||||
string $url,
|
||||
array $params = [],
|
||||
array $data = [],
|
||||
array $options = []
|
||||
): ResponseInterface {
|
||||
$data = Json::encode($data);
|
||||
$request = new Request(
|
||||
method: Rfc5789::PATCH,
|
||||
uri: $url,
|
||||
headers: ['Content-Type' => 'application/json'],
|
||||
body: Utils::streamFor($data)
|
||||
);
|
||||
return $this->getClient($options)->send(
|
||||
$request,
|
||||
['query' => $params,]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, mixed> $data
|
||||
* @param array<string, string|int> $params
|
||||
* @param Options $options
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestDelete(
|
||||
string $url,
|
||||
array $params = [],
|
||||
array $data = [],
|
||||
array $options = []
|
||||
): ResponseInterface {
|
||||
$data = Json::encode($data);
|
||||
$request = new Request(
|
||||
method: Rfc7231::DELETE,
|
||||
uri: $url,
|
||||
headers: ['Content-Type' => 'application/json'],
|
||||
body: Utils::streamFor($data)
|
||||
);
|
||||
return $this->getClient($options)->send(
|
||||
$request,
|
||||
['query' => $params,]
|
||||
);
|
||||
}
|
||||
}
|
||||
27
src/Http/RequestServiceFactory.php
Normal file
27
src/Http/RequestServiceFactory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* RequestFactory.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/8/30
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Http;
|
||||
|
||||
use Singularity\HDK\Core\Service\AbstractFactory;
|
||||
|
||||
final class RequestServiceFactory extends AbstractFactory
|
||||
{
|
||||
/**
|
||||
* @param array<string,mixed> $options
|
||||
*
|
||||
* @return RequestService
|
||||
*/
|
||||
public static function make(array $options = []): RequestService
|
||||
{
|
||||
return new RequestService($options);
|
||||
}
|
||||
}
|
||||
28
src/I18n/Enum/Languages.php
Normal file
28
src/I18n/Enum/Languages.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Languages.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/9/26
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\I18n\Enum;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
enum Languages: string
|
||||
{
|
||||
case ZH_CN = 'zh_CN';
|
||||
|
||||
case EN = 'en';
|
||||
|
||||
public static function getLanguage(string $language): Languages
|
||||
{
|
||||
return match (mb_strtolower($language)) {
|
||||
'en', 'en_us', 'en-us', 'en-uk', 'en_uk' => self::EN,
|
||||
'zh', 'zh_cn', 'zh-cn' => self::ZH_CN,
|
||||
default => self::from(config('translation.locale') ?? 'en'),
|
||||
};
|
||||
}
|
||||
}
|
||||
34
src/Listener/AbstractListener.php
Normal file
34
src/Listener/AbstractListener.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* AbstractListener.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Listener;
|
||||
|
||||
use Hyperf\Contract\ContainerInterface;
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\Event\Contract\ListenerInterface;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
abstract class AbstractListener implements ListenerInterface
|
||||
{
|
||||
#[Inject]
|
||||
protected ContainerInterface $container;
|
||||
|
||||
protected StdoutLoggerInterface $stdoutLogger;
|
||||
|
||||
/**
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->stdoutLogger = $this->container->get(StdoutLoggerInterface::class);
|
||||
}
|
||||
}
|
||||
105
src/Listener/EmailWillSentListener.php
Normal file
105
src/Listener/EmailWillSentListener.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* EmailWillSentListener.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Listener;
|
||||
|
||||
use Hyperf\Contract\ContainerInterface;
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\Event\Contract\ListenerInterface;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Singularity\HDK\Core\Constants\CommonErrorCode;
|
||||
use Singularity\HDK\Core\Events\EmailWillSent;
|
||||
use Singularity\HDK\Core\Service\EmailService;
|
||||
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Listener\EmailWillSentListener@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*
|
||||
* @link ../../docs/Email.md
|
||||
*/
|
||||
class EmailWillSentListener implements ListenerInterface
|
||||
{
|
||||
#[Inject]
|
||||
private ContainerInterface $container;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function listen(): array
|
||||
{
|
||||
return [
|
||||
EmailWillSent::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EmailWillSent $event
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
#[NoReturn]
|
||||
public function process(object $event): void
|
||||
{
|
||||
$stdoutLogger = $this->container->get(StdoutLoggerInterface::class);
|
||||
// $emailService = $this->container->get(EmailService::class);
|
||||
$emailService = $event->sender ?? EmailService::make();
|
||||
try {
|
||||
$event->type === 'html'
|
||||
? $emailService->sendHtml(
|
||||
target: $event->target,
|
||||
subject: $event->subject,
|
||||
html: $event->content,
|
||||
cc: $event->cc,
|
||||
bcc: $event->bcc,
|
||||
attachmentPaths: $event->attachmentPaths,
|
||||
attachments: $event->attachments,
|
||||
priority: $event->priority
|
||||
)
|
||||
: $emailService->sendText(
|
||||
target: $event->target,
|
||||
subject: $event->subject,
|
||||
text: $event->content,
|
||||
cc: $event->cc,
|
||||
bcc: $event->bcc,
|
||||
attachmentPaths: $event->attachmentPaths,
|
||||
attachments: $event->attachments,
|
||||
priority: $event->priority
|
||||
);
|
||||
|
||||
$stdoutLogger->info('邮件发送成功!');
|
||||
$stdoutLogger->info("To: $event->target");
|
||||
$stdoutLogger->info("Subject: $event->subject");
|
||||
$stdoutLogger->info("Priority: $event->priority");
|
||||
$stdoutLogger->debug('Content: ');
|
||||
$stdoutLogger->debug($event->content);
|
||||
} catch (TransportExceptionInterface $e) {
|
||||
$code = CommonErrorCode::SERVER_MESSAGE_EMAIL_ERROR;
|
||||
$msg = $e->getMessage();
|
||||
if (strpos($msg, '500 Error: bad syntax')) {
|
||||
$code = CommonErrorCode::SERVER_MESSAGE_EMAIL_NOT_FOUND;
|
||||
$msg = CommonErrorCode::getMessage($code);
|
||||
}
|
||||
$stdoutLogger->alert('邮件发送失败!');
|
||||
$stdoutLogger->error(
|
||||
<<<ERROR_LOG
|
||||
[$code] $msg
|
||||
ERROR_LOG
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/Listener/SmsWillSentListener.php
Normal file
60
src/Listener/SmsWillSentListener.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* SmsWillSentListener.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Listener;
|
||||
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Singularity\HDK\Core\Events\SmsWillSent;
|
||||
use Singularity\HDK\Core\Service\SmsService;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Listener\SmsWillSentListener@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/16
|
||||
*/
|
||||
class SmsWillSentListener extends AbstractListener
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function listen(): array
|
||||
{
|
||||
return [
|
||||
SmsWillSent::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SmsWillSent $event
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function process(object $event): void
|
||||
{
|
||||
$smsService = $this->container->get(SmsService::class);
|
||||
try {
|
||||
$smsService->sendSmsCountryside(
|
||||
phone: $event->phone,
|
||||
templateCode: $event->templateCode,
|
||||
templateParam: $event->templateParam,
|
||||
signName: $event->signName
|
||||
);
|
||||
} catch (Throwable $throwable) {
|
||||
$code = $throwable->getCode();
|
||||
$message = $throwable->getMessage();
|
||||
$this->stdoutLogger->alert('短信发送失败!');
|
||||
$this->stdoutLogger->error(sprintf("[%u] %s", $code, $message));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ClassicCoreMiddleware.php@hyperf-development-kit
|
||||
*
|
||||
@@ -9,17 +10,20 @@
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Hyperf\Codec\Json;
|
||||
use Hyperf\Contract\Arrayable;
|
||||
use Hyperf\Contract\Jsonable;
|
||||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpMessage\Server\ResponsePlusProxy;
|
||||
use Hyperf\HttpMessage\Stream\SwooleStream;
|
||||
use Hyperf\HttpServer\CoreMiddleware;
|
||||
use Hyperf\Utils\Codec\Json;
|
||||
use Hyperf\Utils\Contracts\Arrayable;
|
||||
use Hyperf\Utils\Contracts\Jsonable;
|
||||
use Lmc\HttpConstants\Header;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Singularity\HDK\Core\Service\UtilsService;
|
||||
use Swow\Psr7\Message\ResponsePlusInterface;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Utils\Middleware\ClassicCoreMiddleware@hyperf-development-kit
|
||||
@@ -27,35 +31,54 @@ use Singularity\HDK\Core\Service\UtilsService;
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/4/29
|
||||
*
|
||||
* @deprecated
|
||||
* @see CommonCoreMiddleware
|
||||
*/
|
||||
class ClassicCoreMiddleware extends CoreMiddleware
|
||||
{
|
||||
/**
|
||||
* @Inject()
|
||||
* @var \Singularity\HDK\Core\Service\UtilsService
|
||||
*/
|
||||
#[Inject]
|
||||
private UtilsService $utilsService;
|
||||
|
||||
/**
|
||||
* Transfer the non-standard response content to a standard response object.
|
||||
* @template TKey of array-key
|
||||
* @template TValue
|
||||
*
|
||||
* @param null|array<string, mixed>|Arrayable<string, mixed>|Jsonable|string $response
|
||||
* @param null|array<TKey, TValue>|Arrayable<TKey, TValue>|Jsonable|string $response
|
||||
*/
|
||||
protected function transferToResponse($response, ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
protected function transferToResponse(
|
||||
$response,
|
||||
ServerRequestInterface $request
|
||||
): ResponsePlusInterface {
|
||||
$code_name = config('common.response.code_name');
|
||||
$message_name = config('common.response.message_name');
|
||||
$data_name = config('common.response.data_name');
|
||||
|
||||
// 分页数据
|
||||
if ($response instanceof LengthAwarePaginatorInterface) {
|
||||
$paginator = $response;
|
||||
$fact_response = $this->response()->withHeader('Per-Page', (string)$paginator->perPage())
|
||||
->withHeader('Total', (string)$paginator->total())
|
||||
->withHeader('Current-Page', (string)$paginator->currentPage())
|
||||
->withHeader('Total-Pages', (string)$paginator->hasPages());
|
||||
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $paginator->nextPageUrl(), 'next');
|
||||
$fact_response = $this->response()
|
||||
->withHeader(
|
||||
'Per-Page',
|
||||
(string)$paginator->perPage()
|
||||
)
|
||||
->withHeader(
|
||||
'Total',
|
||||
(string)$paginator->total()
|
||||
)
|
||||
->withHeader(
|
||||
'Current-Page',
|
||||
(string)$paginator->currentPage()
|
||||
)
|
||||
->withHeader(
|
||||
'Total-Pages',
|
||||
(string)$paginator->hasPages()
|
||||
);
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$paginator->nextPageUrl(),
|
||||
'next'
|
||||
);
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$paginator->url($paginator->lastPage()),
|
||||
@@ -67,53 +90,45 @@ class ClassicCoreMiddleware extends CoreMiddleware
|
||||
$paginator->previousPageUrl(),
|
||||
'prev'
|
||||
);
|
||||
return $fact_response
|
||||
$resp = $fact_response
|
||||
->withAddedHeader(Header::CONTENT_TYPE, 'application/json')
|
||||
->withBody(
|
||||
new SwooleStream(
|
||||
Json::encode([
|
||||
$code_name => 200,
|
||||
$message_name => 'ok',
|
||||
$data_name => $response->items(),
|
||||
'meta' => [
|
||||
'currentPage' => $paginator->currentPage(),
|
||||
'lastPage' => $paginator->lastPage(),
|
||||
'perPage' => $paginator->perPage(),
|
||||
'total' => $paginator->total(),
|
||||
],
|
||||
])
|
||||
Json::encode(
|
||||
[
|
||||
$code_name => 200,
|
||||
$message_name => 'ok',
|
||||
$data_name => $response->items(),
|
||||
'meta' => [
|
||||
'currentPage' => $paginator->currentPage(),
|
||||
'lastPage' => $paginator->lastPage(),
|
||||
'perPage' => $paginator->perPage(),
|
||||
'total' => $paginator->total(),
|
||||
],
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
// 可 Json 化的数据结构
|
||||
if ($response instanceof Jsonable && $response instanceof Arrayable) {
|
||||
$response = [
|
||||
$code_name => 200,
|
||||
$message_name => 'ok',
|
||||
$data_name => $response->toArray(),
|
||||
];
|
||||
return $this->response()
|
||||
->withAddedHeader(Header::CONTENT_TYPE, 'application/json')
|
||||
->withBody(new SwooleStream(Json::encode($response)));
|
||||
}
|
||||
|
||||
return new ResponsePlusProxy($resp);
|
||||
}
|
||||
// 普通数组
|
||||
if (is_array($response) || $response instanceof Arrayable) {
|
||||
$response = [
|
||||
$code_name => 200,
|
||||
$message_name => 'ok',
|
||||
$data_name => $response,
|
||||
];
|
||||
return $this->response()
|
||||
->withAddedHeader(Header::CONTENT_TYPE, 'application/json')
|
||||
->withBody(new SwooleStream(Json::encode($response)));
|
||||
}
|
||||
|
||||
// 其他默认按字符串处理
|
||||
return $this->response()
|
||||
->withAddedHeader(Header::CONTENT_TYPE, 'text/plain')
|
||||
->withBody(
|
||||
new SwooleStream((string)$response)
|
||||
$response = [$code_name => 200, $message_name => 'ok', $data_name => $response];
|
||||
return $this->response()->withAddedHeader(Header::CONTENT_TYPE, 'application/json')->withBody(
|
||||
new SwooleStream(Json::encode($response))
|
||||
);
|
||||
}
|
||||
// 可 Json 化的数据结构
|
||||
if ($response instanceof Jsonable) {
|
||||
$response = [$code_name => 200, $message_name => 'ok', $data_name => Json::decode((string)$response)];
|
||||
return $this->response()->withAddedHeader(Header::CONTENT_TYPE, 'application/json')->withBody(
|
||||
new SwooleStream(Json::encode($response))
|
||||
);
|
||||
}
|
||||
// 其他默认按字符串处理
|
||||
return $this->response()->withAddedHeader(Header::CONTENT_TYPE, 'text/plain')->withBody(
|
||||
new SwooleStream((string)$response)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
32
src/Middleware/ClassicStyleMiddleware.php
Normal file
32
src/Middleware/ClassicStyleMiddleware.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* ClassicStyleMiddleware.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/3/10
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use Singularity\HDK\Core\Service\ApiStyleService;
|
||||
|
||||
class ClassicStyleMiddleware implements MiddlewareInterface
|
||||
{
|
||||
public function __construct(protected ApiStyleService $apiStyleService)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$this->apiStyleService->set(ApiStyleService::CLASSIC);
|
||||
return $handler->handle($request);
|
||||
}
|
||||
}
|
||||
174
src/Middleware/CommonCoreMiddleware.php
Normal file
174
src/Middleware/CommonCoreMiddleware.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ClassicCoreMiddleware.php@hyperf-development-kit
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/4/29
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Hyperf\Codec\Json;
|
||||
use Hyperf\Contract\Arrayable;
|
||||
use Hyperf\Contract\Jsonable;
|
||||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpMessage\Server\ResponsePlusProxy;
|
||||
use Hyperf\HttpMessage\Stream\SwooleStream;
|
||||
use Hyperf\HttpServer\CoreMiddleware;
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Lmc\HttpConstants\Header;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Singularity\HDK\Core\Service\ApiStyleService;
|
||||
use Singularity\HDK\Core\Service\UtilsService;
|
||||
use Swow\Psr7\Message\ResponsePlusInterface;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Middleware\CommonCoreMiddleware@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/3/10
|
||||
*/
|
||||
class CommonCoreMiddleware extends CoreMiddleware
|
||||
{
|
||||
#[Inject]
|
||||
private UtilsService $utilsService;
|
||||
|
||||
#[Inject]
|
||||
private ApiStyleService $apiStyleService;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function transferToResponse(
|
||||
$response,
|
||||
ServerRequestInterface $request,
|
||||
): ResponsePlusInterface {
|
||||
$style = $this->apiStyleService->get();
|
||||
|
||||
if (!($response instanceof ResponseInterface) || $response instanceof JsonResource) {
|
||||
$response = $style === ApiStyleService::RESTFUL
|
||||
? $this->transferToRestfulResponse($response, $request)
|
||||
: $this->transferToClassicResponse($response, $request);
|
||||
}
|
||||
|
||||
return new ResponsePlusProxy($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array|Arrayable|Jsonable|ResponseInterface|string $response
|
||||
* @param ServerRequestInterface $request
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
protected function transferToRestfulResponse(
|
||||
null|array|Arrayable|Jsonable|ResponseInterface|string $response,
|
||||
ServerRequestInterface $request,
|
||||
): ResponseInterface {
|
||||
// 分页数据
|
||||
if ($response instanceof LengthAwarePaginatorInterface) {
|
||||
$fact_response = $this->response()
|
||||
->withHeader('Per-Page', (string)$response->perPage())
|
||||
->withHeader('Total', (string)$response->total())
|
||||
->withHeader('Current-Page', (string)$response->currentPage())
|
||||
->withHeader('Total-Pages', (string)$response->hasPages());
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $response->nextPageUrl(), 'next');
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$response->url($response->lastPage()),
|
||||
'last'
|
||||
);
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $response->url(1), 'first');
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$response->previousPageUrl(),
|
||||
'prev'
|
||||
);
|
||||
return $fact_response->withBody(new SwooleStream(Json::encode($response->items())));
|
||||
}
|
||||
|
||||
return parent::transferToResponse($response, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array|Arrayable|Jsonable|ResponseInterface|string $response
|
||||
* @param ServerRequestInterface $request
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
protected function transferToClassicResponse(
|
||||
null|array|Arrayable|Jsonable|ResponseInterface|string $response,
|
||||
ServerRequestInterface $request,
|
||||
): ResponseInterface {
|
||||
$code_name = config('common.response.code_name');
|
||||
$message_name = config('common.response.message_name');
|
||||
$data_name = config('common.response.data_name');
|
||||
// 分页数据
|
||||
if ($response instanceof LengthAwarePaginatorInterface) {
|
||||
$paginator = $response;
|
||||
$fact_response = $this->response()->withHeader('Per-Page', (string)$paginator->perPage())->withHeader(
|
||||
'Total',
|
||||
(string)$paginator->total()
|
||||
)->withHeader('Current-Page', (string)$paginator->currentPage())->withHeader(
|
||||
'Total-Pages',
|
||||
(string)$paginator->hasPages()
|
||||
);
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $paginator->nextPageUrl(), 'next');
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$paginator->url($paginator->lastPage()),
|
||||
'last'
|
||||
);
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $paginator->url(1), 'first');
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$paginator->previousPageUrl(),
|
||||
'prev'
|
||||
);
|
||||
return $fact_response->withAddedHeader(Header::CONTENT_TYPE, 'application/json')->withBody(
|
||||
new SwooleStream(
|
||||
Json::encode(
|
||||
[
|
||||
$code_name => 200,
|
||||
$message_name => 'ok',
|
||||
$data_name => $response->items(),
|
||||
'meta' => [
|
||||
'currentPage' => $paginator->currentPage(),
|
||||
'lastPage' => $paginator->lastPage(),
|
||||
'perPage' => $paginator->perPage(),
|
||||
'total' => $paginator->total(),
|
||||
],
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
// 普通数组
|
||||
if (is_array($response) || $response instanceof Arrayable) {
|
||||
$response = [$code_name => 200, $message_name => 'ok', $data_name => $response];
|
||||
return $this->response()->withAddedHeader(Header::CONTENT_TYPE, 'application/json')->withBody(
|
||||
new SwooleStream(Json::encode($response))
|
||||
);
|
||||
}
|
||||
// 可 Json 化的数据结构
|
||||
if ($response instanceof Jsonable) {
|
||||
$response = [$code_name => 200, $message_name => 'ok', $data_name => Json::decode((string)$response)];
|
||||
return $this->response()->withAddedHeader(Header::CONTENT_TYPE, 'application/json')->withBody(
|
||||
new SwooleStream(Json::encode($response))
|
||||
);
|
||||
}
|
||||
if ($response instanceof ResponseInterface) {
|
||||
return $response;
|
||||
}
|
||||
// 其他默认按字符串处理
|
||||
return $this->response()->withAddedHeader(Header::CONTENT_TYPE, 'text/plain')->withBody(
|
||||
new SwooleStream((string)$response)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -15,20 +15,16 @@ use Singularity\HDK\Core\Service\ExtendService;
|
||||
class ExtendsMiddleware implements MiddlewareInterface
|
||||
{
|
||||
/**
|
||||
* @Inject
|
||||
* @var \Singularity\HDK\Core\Service\ExtendService
|
||||
*/
|
||||
#[Inject]
|
||||
private ExtendService $service;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function process(
|
||||
ServerRequestInterface $request,
|
||||
RequestHandlerInterface $handler
|
||||
): ResponseInterface {
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$this->service->parse($request);
|
||||
|
||||
return $handler->handle($request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,13 @@ namespace Singularity\HDK\Core\Middleware;
|
||||
use Hyperf\Context\Context;
|
||||
use Hyperf\Contract\TranslatorInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Lmc\HttpConstants\Header;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use Singularity\HDK\Core\I18n\Enum\Languages;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Utils\Middleware\InternationalizationMiddleware@HDK
|
||||
@@ -22,9 +25,9 @@ use Psr\Http\Server\RequestHandlerInterface;
|
||||
class InternationalizationMiddleware implements MiddlewareInterface
|
||||
{
|
||||
/**
|
||||
* @Inject
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
/**
|
||||
@@ -32,19 +35,20 @@ class InternationalizationMiddleware implements MiddlewareInterface
|
||||
*/
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$response = Context::get(ResponseInterface::class);
|
||||
$language = $request->getHeaderLine('Accept-Language');
|
||||
if (!empty($language)) {
|
||||
$language = match (strtolower($language)) {
|
||||
'en', 'en_us', 'en-us', 'en-uk', 'en_uk' => 'en',
|
||||
'zh', 'zh_cn', 'zh-cn' => 'zh_CN',
|
||||
default => config('translation.locale')
|
||||
};
|
||||
$this->translator->setLocale($language);
|
||||
$req = (new Request());
|
||||
$req->headers->set(Header::ACCEPT_LANGUAGE, $request->getHeaderLine(Header::ACCEPT_LANGUAGE));
|
||||
|
||||
$response = $response->withAddedHeader('Content-Language', strtr($this->translator->getLocale(), '_', '-'));
|
||||
Context::set(ResponseInterface::class, $response);
|
||||
$language = $req->getPreferredLanguage();
|
||||
if (!empty($language)) {
|
||||
$language = Languages::getLanguage($language);
|
||||
$this->translator->setLocale($language->value);
|
||||
}
|
||||
$response = Context::get(ResponseInterface::class);
|
||||
$response = $response->withAddedHeader(
|
||||
Header::CONTENT_LANGUAGE,
|
||||
strtr($this->translator->getLocale(), '_', '-')
|
||||
);
|
||||
Context::set(ResponseInterface::class, $response);
|
||||
|
||||
return $handler->handle($request);
|
||||
}
|
||||
|
||||
32
src/Middleware/RestStyleMiddleware.php
Normal file
32
src/Middleware/RestStyleMiddleware.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* ClassicStyleMiddleware.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/3/10
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use Singularity\HDK\Core\Service\ApiStyleService;
|
||||
|
||||
class RestStyleMiddleware implements MiddlewareInterface
|
||||
{
|
||||
public function __construct(protected ApiStyleService $apiStyleService)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$this->apiStyleService->set(ApiStyleService::RESTFUL);
|
||||
return $handler->handle($request);
|
||||
}
|
||||
}
|
||||
73
src/Middleware/RestfulCoreMiddleware.php
Normal file
73
src/Middleware/RestfulCoreMiddleware.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* RestfulCoreMiddleware.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/14
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Hyperf\Contract\Arrayable;
|
||||
use Hyperf\Contract\Jsonable;
|
||||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpMessage\Server\ResponsePlusProxy;
|
||||
use Hyperf\HttpServer\CoreMiddleware;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Singularity\HDK\Core\Service\UtilsService;
|
||||
use Swow\Psr7\Message\ResponsePlusInterface;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Middleware\RestfulCoreMiddleware@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/1/14
|
||||
*
|
||||
* @deprecated
|
||||
* @see CommonCoreMiddleware
|
||||
*/
|
||||
class RestfulCoreMiddleware extends CoreMiddleware
|
||||
{
|
||||
#[Inject]
|
||||
private UtilsService $utilsService;
|
||||
|
||||
/**
|
||||
* @template TKey of array-key
|
||||
* @template TValue
|
||||
* @param null|array<TKey, TValue>|Arrayable<TKey, TValue>|Jsonable|string $response
|
||||
* @param ServerRequestInterface $request
|
||||
*
|
||||
* @return ResponsePlusInterface
|
||||
*/
|
||||
protected function transferToResponse(
|
||||
$response,
|
||||
ServerRequestInterface $request
|
||||
): ResponsePlusInterface {
|
||||
// 分页数据
|
||||
if ($response instanceof LengthAwarePaginatorInterface) {
|
||||
$fact_response = $this->response()
|
||||
->withHeader('Per-Page', (string)$response->perPage())
|
||||
->withHeader('Total', (string)$response->total())
|
||||
->withHeader('Current-Page', (string)$response->currentPage())
|
||||
->withHeader('Total-Pages', (string)$response->hasPages());
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $response->nextPageUrl(), 'next');
|
||||
$fact_response = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$response->url($response->lastPage()),
|
||||
'last'
|
||||
);
|
||||
$fact_response = $this->utilsService->extendLinkToHeader($fact_response, $response->url(1), 'first');
|
||||
$resp = $this->utilsService->extendLinkToHeader(
|
||||
$fact_response,
|
||||
$response->previousPageUrl(),
|
||||
'prev'
|
||||
);
|
||||
return new ResponsePlusProxy($resp);
|
||||
}
|
||||
|
||||
return parent::transferToResponse($response, $request);
|
||||
}
|
||||
}
|
||||
162
src/Middleware/SessionMiddleware.php
Normal file
162
src/Middleware/SessionMiddleware.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**
|
||||
* SessionMiddleware.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/3/8
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Contract\ConfigInterface;
|
||||
use Hyperf\Contract\SessionInterface;
|
||||
use Hyperf\HttpMessage\Cookie\Cookie;
|
||||
use Hyperf\HttpMessage\Server\Response;
|
||||
use Hyperf\Session\SessionManager;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Middleware\SessionMiddleware@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/3/8
|
||||
*
|
||||
* @deprecated since 0.2.21, use \Singularity\HDK\Auth\Middleware\SessionMiddleware instead.
|
||||
*/
|
||||
class SessionMiddleware implements MiddlewareInterface
|
||||
{
|
||||
public function __construct(private SessionManager $sessionManager, private ConfigInterface $config)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Process an incoming server request.
|
||||
* Processes an incoming server request in order to produce a response.
|
||||
* If unable to produce the response itself, it may delegate to the provided
|
||||
* request handler to do so.
|
||||
*/
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
if (!$this->isSessionAvailable()) {
|
||||
return $handler->handle($request);
|
||||
}
|
||||
|
||||
$session = $this->sessionManager->start($request);
|
||||
|
||||
try {
|
||||
$response = $handler->handle($request);
|
||||
} finally {
|
||||
$this->storeCurrentUrl($request, $session);
|
||||
$session = $this->sessionManager->getSession();
|
||||
|
||||
/*
|
||||
* 现在的机制,但凡写入 Redis 的数据,
|
||||
* 过期时间就是固定的 gc_maxlifetime
|
||||
*
|
||||
* 而 RedisHandler 只会被依赖注入时加载一次,
|
||||
* 后续无法临时修改 gc_maxlifetime
|
||||
*
|
||||
* 又因为现在没有其他情况用到 session
|
||||
* 只有登录之后才会记下用户信息
|
||||
*
|
||||
* 所以一个妥协的方案,就是只有登录了再写入 Redis
|
||||
*
|
||||
* (除非重写整套 RedisHandler/RedisHandlerFactory/...)
|
||||
*/
|
||||
if (!$this->auth($session)) {
|
||||
$this->sessionManager->end($session);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addCookieToResponse($request, $response, $session);
|
||||
}
|
||||
|
||||
private function isSessionAvailable(): bool
|
||||
{
|
||||
return $this->config->has('session.handler');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the current URL for the request if necessary.
|
||||
*/
|
||||
private function storeCurrentUrl(RequestInterface $request, SessionInterface $session): void
|
||||
{
|
||||
if ($request->getMethod() === 'GET') {
|
||||
$session->setPreviousUrl($this->fullUrl($request));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the session cookie to the response·.
|
||||
*/
|
||||
private function addCookieToResponse(
|
||||
ServerRequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
SessionInterface $session
|
||||
): ResponseInterface {
|
||||
$cookie = new Cookie(
|
||||
name: $session->getName(),
|
||||
value: $session->getId(),
|
||||
expire: $this->getCookieExpirationDate($session),
|
||||
path: $this->config->get('session.options.path', '/'),
|
||||
domain: $this->config->get('session.options.domain', $request->getUri()->getHost()),
|
||||
secure: $this->config->get(
|
||||
'session.options.secure',
|
||||
strtolower($request->getUri()->getScheme()) === 'https'
|
||||
),
|
||||
httpOnly: true,
|
||||
sameSite: $this->config->get('session.options.samesite', Cookie::SAMESITE_LAX)
|
||||
);
|
||||
if (!method_exists($response, 'withCookie')) {
|
||||
return $response->withHeader('Set-Cookie', (string)$cookie);
|
||||
}
|
||||
/* @var Response $response */
|
||||
return $response->withCookie($cookie);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full URL for the request.
|
||||
*/
|
||||
private function fullUrl(RequestInterface $request): string
|
||||
{
|
||||
$uri = $request->getUri();
|
||||
$query = $uri->getQuery();
|
||||
$question = $uri->getHost() . $uri->getPath() == '/' ? '/?' : '?';
|
||||
return $query ? $this->url($request) . $question . $query : $this->url($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the session lifetime in seconds.
|
||||
*/
|
||||
private function getCookieExpirationDate(SessionInterface $session): int
|
||||
{
|
||||
// if ($this->config->get('session.options.expire_on_close')) {
|
||||
if (!$this->auth($session)) {
|
||||
$expirationDate = 0;
|
||||
} else {
|
||||
$expireSeconds = $this->config->get('session.options.cookie_lifetime', 5 * 60 * 60);
|
||||
$expirationDate = Carbon::now()->addSeconds($expireSeconds)->getTimestamp();
|
||||
}
|
||||
return $expirationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL (no query string) for the request.
|
||||
*/
|
||||
private function url(RequestInterface $request): string
|
||||
{
|
||||
return rtrim(preg_replace('/\?.*/', '', (string)$request->getUri()));
|
||||
}
|
||||
|
||||
private function auth(SessionInterface $session): bool
|
||||
{
|
||||
return $session->has('userInfo');
|
||||
}
|
||||
}
|
||||
32
src/Middleware/SpParseMiddleware.php
Normal file
32
src/Middleware/SpParseMiddleware.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SpParseMiddleware.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/7/9
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Core\Middleware;
|
||||
|
||||
use Hyperf\Context\Context;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
|
||||
final class SpParseMiddleware implements MiddlewareInterface
|
||||
{
|
||||
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$sp = $request->getHeaderLine('X-SP-ID');
|
||||
if (!empty($sp)) {
|
||||
Context::set('sp', $sp);
|
||||
}
|
||||
|
||||
return $handler->handle($request);
|
||||
}
|
||||
}
|
||||
31
src/Service/AbstractFactory.php
Normal file
31
src/Service/AbstractFactory.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AbstractFactory.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/8/30
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Service;
|
||||
|
||||
use Dont\DontCall;
|
||||
use Dont\DontInstantiate;
|
||||
use Singularity\HDK\Core\Http\RequestService;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Service\AbstractFactory@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/8/30
|
||||
*/
|
||||
abstract class AbstractFactory
|
||||
{
|
||||
use DontInstantiate;
|
||||
use DontCall;
|
||||
|
||||
abstract public static function make(): RequestService;
|
||||
}
|
||||
26
src/Service/AbstractSingleton.php
Normal file
26
src/Service/AbstractSingleton.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* SingletonInterface.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/8/30
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Service;
|
||||
|
||||
use Dont\DontCallStatic;
|
||||
use Dont\DontClone;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Core\Service\SingletonInterface@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/8/30
|
||||
*/
|
||||
abstract class AbstractSingleton
|
||||
{
|
||||
use DontCallStatic;
|
||||
use DontClone;
|
||||
}
|
||||
42
src/Service/ApiStyleService.php
Normal file
42
src/Service/ApiStyleService.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiStyleService.php@HDK-Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/3/10
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Service;
|
||||
|
||||
use Hyperf\Context\Context;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
class ApiStyleService
|
||||
{
|
||||
public const RESTFUL = 'restful';
|
||||
public const CLASSIC = 'classic';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Context::set(self::class, config('common.response.restful') ? self::RESTFUL : self::CLASSIC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param literal-string $style
|
||||
* @return $this
|
||||
*/
|
||||
public function set(string $style): static
|
||||
{
|
||||
Context::set(self::class, $style === self::RESTFUL ? self::RESTFUL : self::CLASSIC);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get(): string
|
||||
{
|
||||
return Context::get(self::class) ?? (config('common.response.restful')
|
||||
? ApiStyleService::RESTFUL
|
||||
: ApiStyleService::CLASSIC);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,8 @@ use Symfony\Component\Mailer\Transport;
|
||||
use Symfony\Component\Mime\Address;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
/**
|
||||
* 邮箱验证码
|
||||
*/
|
||||
@@ -43,6 +45,18 @@ class EmailService
|
||||
);
|
||||
}
|
||||
|
||||
public static function make(
|
||||
?string $dsn = null,
|
||||
?string $mailSenderName = null,
|
||||
?string $mailSender = null,
|
||||
): static {
|
||||
return new static(
|
||||
dsn: $dsn,
|
||||
mailSenderName: $mailSenderName,
|
||||
mailSender: $mailSender,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
*
|
||||
@@ -65,27 +79,51 @@ class EmailService
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array<string> $target
|
||||
* @param string $subject
|
||||
* @param string $text
|
||||
* @param Address|string|array<string|Address> $target
|
||||
* @param string $subject
|
||||
* @param string $text
|
||||
* @param array<string> $cc
|
||||
* @param array $bcc
|
||||
* @param int $priority
|
||||
*
|
||||
* @return bool
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
public function sendText(
|
||||
string|array $target,
|
||||
Address|string|array $target,
|
||||
string $subject,
|
||||
string $text,
|
||||
array $cc = []
|
||||
array $cc = [],
|
||||
array $bcc = [],
|
||||
array $attachmentPaths = [],
|
||||
array $attachments = [],
|
||||
int $priority = Email::PRIORITY_NORMAL
|
||||
): bool {
|
||||
$email = (new Email())
|
||||
->from(Address::create($this->from))
|
||||
->to(...(is_array($target) ? $target : [$target]))
|
||||
->cc(...$cc)
|
||||
->bcc(...$bcc)
|
||||
->priority($priority)
|
||||
->subject($subject)
|
||||
->text($text);
|
||||
|
||||
foreach ($attachmentPaths as $attachmentPath) {
|
||||
if (is_string($attachmentPath)) {
|
||||
$email = $email->attachFromPath($attachmentPath);
|
||||
} else {
|
||||
$email = $email->attachFromPath($attachmentPath['path'], $attachmentPath['name'] ?? null, $attachmentPath['mimeType'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($attachments as $attachment) {
|
||||
if (is_string($attachment)) {
|
||||
$email = $email->attach($attachment);
|
||||
} else {
|
||||
$email = $email->attach($attachment['content'], $attachment['name'] ?? null, $attachment['mimeType'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
$this->mailer->send($email);
|
||||
|
||||
return true;
|
||||
@@ -94,27 +132,51 @@ class EmailService
|
||||
/**
|
||||
* 以 HTML 格式发送邮件
|
||||
*
|
||||
* @param string|array<string> $target
|
||||
* @param string $subject
|
||||
* @param string $html
|
||||
* @param Address|string|array<string|Address> $target
|
||||
* @param string $subject
|
||||
* @param string $html
|
||||
* @param array<string> $cc
|
||||
* @param array $bcc
|
||||
* @param int $priority
|
||||
*
|
||||
* @return bool
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
public function sendHtml(
|
||||
string|array $target,
|
||||
Address|string|array $target,
|
||||
string $subject,
|
||||
string $html,
|
||||
array $cc = []
|
||||
array $cc = [],
|
||||
array $bcc = [],
|
||||
array $attachmentPaths = [],
|
||||
array $attachments = [],
|
||||
int $priority = Email::PRIORITY_NORMAL
|
||||
): bool {
|
||||
$email = (new Email())
|
||||
->from(Address::create($this->from))
|
||||
->to(...(is_array($target) ? $target : [$target]))
|
||||
->cc(...$cc)
|
||||
->bcc(...$bcc)
|
||||
->priority($priority)
|
||||
->subject($subject)
|
||||
->html($html);
|
||||
|
||||
foreach ($attachmentPaths as $attachmentPath) {
|
||||
if (is_string($attachmentPath)) {
|
||||
$email = $email->attachFromPath($attachmentPath);
|
||||
} else {
|
||||
$email = $email->attachFromPath($attachmentPath['path'], $attachmentPath['name'] ?? null, $attachmentPath['mimeType'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($attachments as $attachment) {
|
||||
if (is_string($attachment)) {
|
||||
$email = $email->attach($attachment);
|
||||
} else {
|
||||
$email = $email->attach($attachment['content'], $attachment['name'] ?? null, $attachment['mimeType'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
$this->mailer->send($email);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -10,6 +10,10 @@ use Psr\Http\Message\ServerRequestInterface;
|
||||
*/
|
||||
class ExtendService
|
||||
{
|
||||
public function __construct(private UtilsService $utils)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface|null $request
|
||||
* @param array<string, string>|null $params
|
||||
@@ -17,18 +21,16 @@ class ExtendService
|
||||
*/
|
||||
public function parse(
|
||||
?ServerRequestInterface $request,
|
||||
?array $params = null
|
||||
array|string|null $params = null
|
||||
): array {
|
||||
$params ??= $request->getQueryParams();
|
||||
$extends = $params['extends'] ?? null;
|
||||
if (!empty($extends)) {
|
||||
$extends = explode(',', $extends);
|
||||
return Context::set(self::class, array_map('trim', $extends));
|
||||
}
|
||||
$params ??= $request?->getQueryParams();
|
||||
$extends = explode(',', $params['extends'] ?? '');
|
||||
$extends = array_map('trim', $extends);
|
||||
|
||||
return [];
|
||||
return Context::set(self::class, array_filter($extends));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
@@ -37,6 +39,12 @@ class ExtendService
|
||||
return Context::get(self::class) ?? [];
|
||||
}
|
||||
|
||||
public function hasExtends(): bool
|
||||
{
|
||||
$extends = Context::get(self::class);
|
||||
return is_array($extends) && count($extends) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否传入了此扩展
|
||||
*
|
||||
@@ -44,8 +52,8 @@ class ExtendService
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasExtends(string $field): bool
|
||||
public function hasExtend(string $field): bool
|
||||
{
|
||||
return Context::has(self::class) && isset(array_flip(Context::get(self::class))[$field]);
|
||||
return $this->utils->inArray($field, Context::get(self::class) ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
108
src/Service/HttpRequestService.php
Normal file
108
src/Service/HttpRequestService.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Core\Service;
|
||||
|
||||
use Ergebnis\Http\Method\Rfc\Rfc7231;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Utils;
|
||||
use Hyperf\Codec\Json;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\Guzzle\ClientFactory;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* 发起 Http 请求的类
|
||||
*
|
||||
* @deprecated since version 1.0-alpha.3, to be removed in 1.0
|
||||
*/
|
||||
class HttpRequestService
|
||||
{
|
||||
// public const TIMEOUT = 20;
|
||||
|
||||
#[Inject]
|
||||
private ClientFactory $client;
|
||||
|
||||
/**
|
||||
* @var array<literal-string, mixed>
|
||||
*/
|
||||
private array $options = [];
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, string|int> $params
|
||||
* @param array<string, mixed> $data
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestGet(string $url, array $params = [], array $data = []): ResponseInterface
|
||||
{
|
||||
$request = new Request(Rfc7231::GET, $url);
|
||||
return $this->getClient()->send($request, [
|
||||
'query' => $params,
|
||||
'json' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
private function getClient(): Client
|
||||
{
|
||||
return $this->client->create($this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, mixed> $data
|
||||
* @param array<string, string|int> $params
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestPost(string $url, array $params = [], array $data = []): ResponseInterface
|
||||
{
|
||||
$data = Json::encode($data);
|
||||
$request = new Request(
|
||||
'post',
|
||||
$url,
|
||||
['Content-Type' => 'application/json'],
|
||||
Utils::streamFor($data),
|
||||
);
|
||||
return $this->getClient()->send($request, [
|
||||
'query' => $params,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param array<string, mixed> $data
|
||||
* @param array<string, string|int> $params
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function requestPut(string $url, array $params = [], array $data = []): ResponseInterface
|
||||
{
|
||||
$data = Json::encode($data);
|
||||
$request = new Request('put', $url, ['Content-Type' => 'application/json'], Utils::streamFor($data));
|
||||
return $this->getClient()->send($request, [
|
||||
'query' => $params,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 定制 options
|
||||
*
|
||||
* @param array<string, mixed> $options
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions(array $options): HttpRequestService
|
||||
{
|
||||
$this->options = array_replace_recursive($this->options, $options);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,9 @@
|
||||
|
||||
namespace Singularity\HDK\Core\Service;
|
||||
|
||||
use Hyperf\Utils\Codec\Json;
|
||||
use Hyperf\Codec\Json;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
class OssService
|
||||
{
|
||||
@@ -29,7 +31,7 @@ class OssService
|
||||
$this->accessKeyId ??= config('common.third_party.storage.oss.access_key_id');
|
||||
$this->accessKeySecret ??= config('common.third_party.storage.oss.access_key_secret');
|
||||
$this->host ??= config('common.third_party.storage.oss.oss_host');
|
||||
$this->callbackUrl ??= config('oss_callback');
|
||||
$this->callbackUrl ??= config('common.third_party.storage.oss.oss_callback') ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +86,7 @@ class OssService
|
||||
$string_to_sign = $base64_policy;
|
||||
$signature = base64_encode(hash_hmac('sha1', $string_to_sign, $this->accessKeySecret, true));
|
||||
|
||||
$callback = Json::encode([
|
||||
$callback = isset($this->callbackUrl) ? Json::encode([
|
||||
'callbackUrl' => $this->callbackUrl,
|
||||
'callbackBody' => $isImage ? <<<'callbackBody'
|
||||
{
|
||||
@@ -115,17 +117,20 @@ callbackBody : <<<'callbackBody'
|
||||
}
|
||||
callbackBody,
|
||||
'callbackBodyType' => 'application/json',
|
||||
]);
|
||||
]) : null;
|
||||
|
||||
return [
|
||||
$result = [
|
||||
'accessid' => $this->accessKeyId,
|
||||
'host' => $this->host,
|
||||
'policy' => $base64_policy,
|
||||
'signature' => $signature,
|
||||
'expire' => $expire_time,
|
||||
'dir' => $dir,
|
||||
'callback' => base64_encode($callback),
|
||||
];
|
||||
if (isset($callback)) {
|
||||
$result += ['callback' => base64_encode($callback),];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,10 +6,13 @@ use AlibabaCloud\SDK\Dysmsapi\V20170525\Dysmsapi;
|
||||
use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\SendSmsRequest;
|
||||
use AlibabaCloud\Tea\Exception\TeaError;
|
||||
use Darabonba\OpenApi\Models\Config;
|
||||
use Hyperf\HttpMessage\Exception\HttpException;
|
||||
use Hyperf\Utils\Codec\Json;
|
||||
use Hyperf\Codec\Json;
|
||||
use Hyperf\HttpMessage\Exception\ServerErrorHttpException;
|
||||
use Singularity\HDK\Core\Constants\CommonErrorCode;
|
||||
use Singularity\HDK\Core\Exceptions\ValidateException;
|
||||
use UnexpectedValueException;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
/**
|
||||
* 短信服务
|
||||
@@ -17,7 +20,7 @@ use Singularity\HDK\Core\Exceptions\ValidateException;
|
||||
class SmsService
|
||||
{
|
||||
/**
|
||||
* @var \AlibabaCloud\SDK\Dysmsapi\V20170525\Dysmsapi
|
||||
* @var Dysmsapi
|
||||
*/
|
||||
private Dysmsapi $client;
|
||||
|
||||
@@ -29,7 +32,7 @@ class SmsService
|
||||
/**
|
||||
* 初始化实例
|
||||
*
|
||||
* @return \AlibabaCloud\SDK\Dysmsapi\V20170525\Dysmsapi
|
||||
* @return Dysmsapi
|
||||
*/
|
||||
private function createClient(): Dysmsapi
|
||||
{
|
||||
@@ -44,13 +47,17 @@ class SmsService
|
||||
/**
|
||||
* 国内短信
|
||||
*
|
||||
* @param string $phone 接收短信的手机号码
|
||||
* @param string|null $templateCode 短信模板CODE
|
||||
* @param array<string, string>|null $templateParam 短信模板变量对应的实际值(不支持空数组)
|
||||
* @param string|null $signName 短信签名名称
|
||||
* @param string $phone 接收短信的手机号码
|
||||
* @param string|null $templateCode 短信模板CODE
|
||||
* @param array<string, string>|null $templateParam 短信模板变量对应的实际值(不支持空数组)
|
||||
* @param string|null $signName 短信签名名称
|
||||
*
|
||||
* @return bool
|
||||
* @throws UnexpectedValueException 参数校验
|
||||
* @throws ValidateException 频率太高
|
||||
* @throws ServerErrorHttpException 阿里云短信服务报错
|
||||
* @link https://help.aliyun.com/document_detail/419273.htm
|
||||
*
|
||||
*/
|
||||
public function sendSmsCountryside(
|
||||
string $phone,
|
||||
@@ -59,7 +66,7 @@ class SmsService
|
||||
?string $signName = null,
|
||||
): bool {
|
||||
if (is_array($templateParam) && count($templateParam) <= 0) {
|
||||
throw new \UnexpectedValueException('不支持空数组,请用 null 代替或不传', CommonErrorCode::FORMATTER_ERROR);
|
||||
throw new UnexpectedValueException('不支持空数组,请用 null 代替或不传', CommonErrorCode::FORMATTER_ERROR);
|
||||
}
|
||||
$phone_number = strtr($phone, ['#' => '']);
|
||||
|
||||
@@ -101,11 +108,10 @@ class SmsService
|
||||
}
|
||||
}
|
||||
|
||||
throw new HttpException(
|
||||
500,
|
||||
$message,
|
||||
CommonErrorCode::SERVER_DEPENDENCY_SMS_ERROR,
|
||||
$error
|
||||
throw new ServerErrorHttpException(
|
||||
message: $message,
|
||||
code: CommonErrorCode::SERVER_DEPENDENCY_SMS_ERROR,
|
||||
previous: $error
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ use Closure;
|
||||
use Exception;
|
||||
use Generator;
|
||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
@@ -25,7 +24,6 @@ class UtilsService
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Pure]
|
||||
public function generateSecureCode(int $length = 4): string
|
||||
{
|
||||
$code = '';
|
||||
@@ -237,7 +235,6 @@ class UtilsService
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[NoReturn]
|
||||
public function unlimitedSubCategoriesQuicklyWithLevel(
|
||||
array &$list,
|
||||
int $level = 1,
|
||||
@@ -329,4 +326,17 @@ class UtilsService
|
||||
'unit' => $unitToUpper ? strtoupper($unit[$i]) : $unit[$i],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更快的判断数组元素方法
|
||||
* @param float|int|string $needle
|
||||
* @param array<int, mixed> $haystack
|
||||
* @return bool
|
||||
*/
|
||||
public function inArray(float|int|string $needle, array $haystack): bool
|
||||
{
|
||||
$list = array_flip($haystack);
|
||||
return isset($list[$needle]);
|
||||
}
|
||||
}
|
||||
|
||||
86
src/Service/XmlService.php
Normal file
86
src/Service/XmlService.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* XmlService.php@LuxOP
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/4/10
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Service;
|
||||
|
||||
use Symfony\Component\Serializer\Encoder\XmlEncoder;
|
||||
|
||||
class XmlService
|
||||
{
|
||||
private XmlEncoder $service;
|
||||
|
||||
public function __construct(XmlEncoder $encoder)
|
||||
{
|
||||
$this->service = $encoder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object|array<string, mixed> $data
|
||||
* @param string $xmlRootNodeName
|
||||
* @param bool $xmlFormatOutput 是否格式化
|
||||
* @param string $xmlVersion
|
||||
* @param string $xmlEncoding
|
||||
* @param bool $xmlStandalone 是否添加声明规范的标签到xml
|
||||
* @param int[] $encoderIgnoredNodeTypes
|
||||
* @param bool $removeEmptyTags
|
||||
* @return false|string
|
||||
* @see https://symfony.com/doc/current/components/serializer.html#the-xmlencoder
|
||||
*/
|
||||
public function encode(
|
||||
object|array $data,
|
||||
string $xmlRootNodeName = 'root',
|
||||
bool $xmlFormatOutput = true,
|
||||
string $xmlVersion = '1.0',
|
||||
string $xmlEncoding = 'utf-8',
|
||||
bool $xmlStandalone = false,
|
||||
array $encoderIgnoredNodeTypes = [],
|
||||
bool $removeEmptyTags = false,
|
||||
): false|string {
|
||||
return $this->service->encode(
|
||||
$data,
|
||||
XmlEncoder::FORMAT,
|
||||
[
|
||||
XmlEncoder::ENCODER_IGNORED_NODE_TYPES => $encoderIgnoredNodeTypes,
|
||||
XmlEncoder::ROOT_NODE_NAME => $xmlRootNodeName,
|
||||
XmlEncoder::FORMAT_OUTPUT => $xmlFormatOutput,
|
||||
XmlEncoder::VERSION => $xmlVersion,
|
||||
XmlEncoder::ENCODING => $xmlEncoding,
|
||||
XmlEncoder::STANDALONE => $xmlStandalone,
|
||||
XmlEncoder::REMOVE_EMPTY_TAGS => $removeEmptyTags,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $xml
|
||||
* @param bool $xmlTypeCastAttributes 是否自动转换类型
|
||||
* @param bool $asCollection 是否全部使用数组
|
||||
* @param int[] $decoderIgnoredNodeTypes
|
||||
* @param int $loadOptions
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function decode(
|
||||
string $xml,
|
||||
bool $xmlTypeCastAttributes = true,
|
||||
bool $asCollection = false,
|
||||
array $decoderIgnoredNodeTypes = [XML_PI_NODE, XML_COMMENT_NODE],
|
||||
int $loadOptions = LIBXML_NONET | LIBXML_NOBLANKS,
|
||||
): array {
|
||||
return $this->service->decode(
|
||||
$xml,
|
||||
XmlEncoder::FORMAT,
|
||||
[
|
||||
XmlEncoder::LOAD_OPTIONS => $loadOptions,
|
||||
XmlEncoder::DECODER_IGNORED_NODE_TYPES => $decoderIgnoredNodeTypes,
|
||||
XmlEncoder::TYPE_CAST_ATTRIBUTES => $xmlTypeCastAttributes,
|
||||
XmlEncoder::AS_COLLECTION => $asCollection,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
88
src/Traits/RestfulList.php
Normal file
88
src/Traits/RestfulList.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Paginatable.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/7/18
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Core\Traits;
|
||||
|
||||
use Closure;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Relations\Relation;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||
use Hyperf\Paginator\AbstractPaginator;
|
||||
use Hyperf\Stringable\Str;
|
||||
use Singularity\HDK\Core\Service\ExtendService;
|
||||
|
||||
trait RestfulList
|
||||
{
|
||||
#[Inject]
|
||||
protected ExtendService $extend;
|
||||
#[Inject]
|
||||
protected RequestInterface $request;
|
||||
|
||||
protected function restSelect(Closure $callback, ?Closure $filter = null): mixed
|
||||
{
|
||||
$parsed_options = [];
|
||||
$result = $this->parseParameters(
|
||||
callback: function ($query, $options) use ($callback, &$parsed_options) {
|
||||
$parsed_options = $options;
|
||||
return $callback($query, $options);
|
||||
}
|
||||
);
|
||||
return $this->responseFormatter($parsed_options, $result, $filter);
|
||||
}
|
||||
|
||||
protected function parseParameters(Closure $callback): mixed
|
||||
{
|
||||
$query = $this->request->getQueryParams();
|
||||
$options = [
|
||||
'size' => $this->request->query('size'),
|
||||
'page' => $this->request->query('page'),
|
||||
'order' => $this->request->query('order', 'created_at'),
|
||||
'sort' => $this->request->query('sort', 'desc'),
|
||||
'group' => $this->request->query('group'),
|
||||
'extends' => $this->extend->getExtends(),
|
||||
];
|
||||
unset($query['sort'], $query['page'], $query['size'], $query['order'], $query['group'], $query['extends']);
|
||||
return $callback(query: $query, options: $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
* @param Builder|Relation $builder
|
||||
* @param Closure|null $filter
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function responseFormatter(
|
||||
array $options,
|
||||
Builder|Relation $builder,
|
||||
?Closure $filter = null
|
||||
): mixed {
|
||||
$perPage = $options['size'] ?? null;
|
||||
$order = $options['order'] ?? 'created_at';
|
||||
$sort = $options['sort'] ?? 'desc';
|
||||
$pagination = !!($options['page'] ?? $perPage ?? false);
|
||||
// $group = $options['group'] ?? null;
|
||||
|
||||
$builder = $builder->orderBy(Str::snake($order), $sort);
|
||||
$result = $pagination ? $builder->paginate($perPage) : $builder->get();
|
||||
|
||||
if (is_null($filter)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ($result instanceof AbstractPaginator) {
|
||||
$collection = $result->getCollection();
|
||||
$collection = $filter($collection);
|
||||
|
||||
return $result->setCollection($collection);
|
||||
}
|
||||
return $filter($result);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* EmailServiceTest.php@HDK-Core
|
||||
*
|
||||
@@ -9,15 +10,19 @@
|
||||
|
||||
namespace Singularity\HDK\Test\Core\Service;
|
||||
|
||||
use PharIo\Manifest\Email;
|
||||
use Singularity\HDK\Core\Service\EmailService;
|
||||
use Symfony\Component\Mailer\Exception\TransportException;
|
||||
|
||||
$dsn = 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465';
|
||||
$mail_sender_name = 'LuxCreo';
|
||||
$mail_sender = 'account@luxcreo.ai';
|
||||
$email = new EmailService($dsn, $mail_sender_name, $mail_sender);
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('assertions that send HTML is available', function () use ($email) {
|
||||
|
||||
it('assertions that send HTML is available', function () {
|
||||
$dsn = 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465';
|
||||
$mail_sender_name = 'LuxCreo';
|
||||
$mail_sender = 'account@luxcreo.ai';
|
||||
// $email = new EmailService($dsn, $mail_sender_name, $mail_sender);
|
||||
$email = make(EmailService::class, ['dsn' => $dsn, 'mailSenderName' => $mail_sender_name, 'mailSender' => $mail_sender]);
|
||||
$result = $email->sendHtml(
|
||||
'dongyun.li@luxcreo.ai',
|
||||
'HDK Unit Test HTML',
|
||||
@@ -28,7 +33,13 @@ HTML
|
||||
expect($result)->toBeTrue();
|
||||
});
|
||||
|
||||
it('assertions that send Text is available', function () use ($email) {
|
||||
it('assertions that send Text is available', function () {
|
||||
$dsn = 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465';
|
||||
$mail_sender_name = 'LuxCreo';
|
||||
$mail_sender = 'account@luxcreo.ai';
|
||||
// $email = new EmailService($dsn, $mail_sender_name, $mail_sender);
|
||||
$email = make(EmailService::class, ['dsn' => $dsn, 'mailSenderName' => $mail_sender_name, 'mailSender' => $mail_sender]);
|
||||
|
||||
$result = $email->sendText(
|
||||
'dongyun.li@luxcreo.ai',
|
||||
'HDK Unit Test Text',
|
||||
@@ -39,7 +50,13 @@ Text
|
||||
expect($result)->toBeTrue();
|
||||
});
|
||||
|
||||
it('assertions Error Receiver can be catch', function () use ($email) {
|
||||
it('assertions Error Receiver can be catch', function () {
|
||||
$dsn = 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465';
|
||||
$mail_sender_name = 'LuxCreo';
|
||||
$mail_sender = 'account@luxcreo.ai';
|
||||
// $email = new EmailService($dsn, $mail_sender_name, $mail_sender);
|
||||
$email = make(EmailService::class, ['dsn' => $dsn, 'mailSenderName' => $mail_sender_name, 'mailSender' => $mail_sender]);
|
||||
|
||||
try {
|
||||
$email->sendHtml(
|
||||
'unknown@luxcreo.ai',
|
||||
@@ -63,3 +80,29 @@ Text
|
||||
expect($t->getCode())->toBe(554);
|
||||
}
|
||||
});
|
||||
|
||||
it('should can contain attachment', function () {
|
||||
$dsn = 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465';
|
||||
$mail_sender_name = 'LuxCreo';
|
||||
$mail_sender = 'account@luxcreo.ai';
|
||||
// $email = new EmailService($dsn, $mail_sender_name, $mail_sender);
|
||||
$email = make(EmailService::class, ['dsn' => $dsn, 'mailSenderName' => $mail_sender_name, 'mailSender' => $mail_sender]);
|
||||
|
||||
$email->sendHtml(
|
||||
'dongyun.li@luxcreo.ai',
|
||||
'HDK Unit Test HTML',
|
||||
<<<HTML
|
||||
<h1>Hello, World!</h1>
|
||||
HTML,
|
||||
[],
|
||||
[],
|
||||
[
|
||||
[
|
||||
'path' => __DIR__ . '/../../README.md',
|
||||
'name' => 'README.md',
|
||||
'mimeType' => 'text/markdown',
|
||||
],
|
||||
],
|
||||
[]
|
||||
);
|
||||
})->only();
|
||||
|
||||
@@ -9,30 +9,61 @@
|
||||
|
||||
namespace Singularity\HDK\Test\Core\Unit;
|
||||
|
||||
use Hyperf\Context\Context;
|
||||
use Singularity\HDK\Core\Service\ExtendService;
|
||||
use Singularity\HDK\Core\Service\UtilsService;
|
||||
|
||||
$service = new ExtendService();
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
/** @var ExtendService $service */
|
||||
$service = make(ExtendService::class, ['utils' => new UtilsService()]);
|
||||
it('asserts no parameters can be parsed.', function (ExtendService $service, $params) {
|
||||
$service->parse(
|
||||
null,
|
||||
$params
|
||||
);
|
||||
$result = $service->getExtends();
|
||||
expect($result)->toBeArray()->toBe([])->toHaveCount(0)->toBe([]);
|
||||
})->with([
|
||||
[$service, null],
|
||||
[$service, ''],
|
||||
[$service, []],
|
||||
[$service, ['extends' => '']],
|
||||
[$service, ['extends' => null]],
|
||||
]);
|
||||
|
||||
it('asserts has no specify extend', function () use ($service) {
|
||||
Context::destroy(ExtendService::class);
|
||||
expect($service->hasExtend('a'))->toBeFalse();
|
||||
})->depends('it asserts query parameters can be parsed.');
|
||||
|
||||
it('asserts query parameters can be parsed.', function () use ($service) {
|
||||
$result = $service->parse(
|
||||
null,
|
||||
params: [
|
||||
[
|
||||
'id' => 5,
|
||||
'extends' => 'a,b',
|
||||
]
|
||||
);
|
||||
expect($result)->toBeArray()->toHaveCount(2)->toBe(['a', 'b']);
|
||||
});
|
||||
|
||||
it('asserts has extends', function () use ($service) {
|
||||
expect($service->hasExtends('a'))->toBeTrue()
|
||||
->and($service->hasExtends('b'))->toBeTrue()
|
||||
->and($service->hasExtends('c'))->toBeFalse();
|
||||
Context::set(ExtendService::class, ['a', 'b']);
|
||||
expect($service->hasExtends())->toBeTrue();
|
||||
});
|
||||
|
||||
it('asserts has specify extend', function () use ($service) {
|
||||
Context::set(ExtendService::class, ['a', 'b']);
|
||||
expect($service->hasExtend('a'))->toBeTrue()
|
||||
->and($service->hasExtend('b'))->toBeTrue()
|
||||
->and($service->hasExtend('c'))->toBeFalse();
|
||||
})->depends('it asserts query parameters can be parsed.');
|
||||
|
||||
it('asserts parsed extends', function () use ($service) {
|
||||
$extends = $service->getExtends();
|
||||
expect($extends)->toBeArray()->toMatchArray([
|
||||
'a',
|
||||
'b',
|
||||
]);
|
||||
})->depends('it asserts query parameters can be parsed.');
|
||||
// it('asserts parsed extends', function () use ($service) {
|
||||
// $extends = $service->getExtends();
|
||||
// expect($extends)->toBeArray()->toMatchArray([
|
||||
// 'a',
|
||||
// 'b',
|
||||
// ]);
|
||||
// })->depends('it asserts query parameters can be parsed.');
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Created on 2023/1/9
|
||||
*/
|
||||
|
||||
use Hyperf\Utils\Codec\Json;
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Core\Service\OssService;
|
||||
|
||||
use function Spatie\PestPluginTestTime\testTime;
|
||||
|
||||
41
tests/Unit/RequestServiceTest.php
Normal file
41
tests/Unit/RequestServiceTest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* RequestServiceTest.php@Core
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/9/20
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Test\Core\Unit;
|
||||
|
||||
use Singularity\HDK\Core\Http\RequestService;
|
||||
use Singularity\HDK\Core\Http\RequestServiceFactory;
|
||||
use Teapot\StatusCode\RFC\RFC7231;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
class RequestServiceTest
|
||||
{
|
||||
private RequestService $service;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->service = RequestServiceFactory::make();
|
||||
}
|
||||
|
||||
public function getInstance(): RequestService
|
||||
{
|
||||
return $this->service;
|
||||
}
|
||||
}
|
||||
|
||||
test('Http 请求服务可以正常使用', function () {
|
||||
/** @var RequestServiceTest $class */
|
||||
$class = make(RequestServiceTest::class);
|
||||
$response = $class->getInstance()->setOptions([
|
||||
'allow_redirects' => false,
|
||||
])->requestGet('https://www.baidu.com');
|
||||
expect($response->getStatusCode())->toBe(RFC7231::OK);
|
||||
});
|
||||
@@ -7,14 +7,172 @@
|
||||
* Created on 2023/1/12
|
||||
*/
|
||||
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Core\Service\UtilsService;
|
||||
|
||||
$utils = new UtilsService();
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
$utils = new UtilsService();
|
||||
dataset('categories', [
|
||||
[
|
||||
'source' => <<<JSON
|
||||
[
|
||||
{
|
||||
"id": 200002538,
|
||||
"name": "空心菜类",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,空心菜类"
|
||||
},
|
||||
{
|
||||
"id": 200002537,
|
||||
"name": "香菜类",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,葱姜蒜椒/调味菜,香菜类"
|
||||
},
|
||||
{
|
||||
"id": 200002536,
|
||||
"name": "紫苏/苏子叶",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,紫苏/苏子叶"
|
||||
},
|
||||
{
|
||||
"id": 200002543,
|
||||
"name": "乌塌菜/塌菜/乌菜",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,乌塌菜/塌菜/乌菜"
|
||||
},
|
||||
{
|
||||
"id": 200002542,
|
||||
"name": "菜心/菜苔类",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,菜心/菜苔类"
|
||||
},
|
||||
{
|
||||
"id": 200002540,
|
||||
"name": "马兰头/马兰/红梗菜",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,马兰头/马兰/红梗菜"
|
||||
},
|
||||
{
|
||||
"id": 200002531,
|
||||
"name": "苋菜类",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,苋菜类"
|
||||
},
|
||||
{
|
||||
"id": 200002528,
|
||||
"name": "其他叶菜类",
|
||||
"level": 3,
|
||||
"namePath": "蔬菜/豆制品,叶菜类,其他叶菜类"
|
||||
}
|
||||
]
|
||||
JSON,
|
||||
'expected' => <<<JSON
|
||||
[
|
||||
{
|
||||
"id": "e485b0bb87",
|
||||
"id_path": ",e485b0bb87,",
|
||||
"level": 1,
|
||||
"name": "蔬菜/豆制品",
|
||||
"name_path": "蔬菜/豆制品",
|
||||
"parent_id": 0,
|
||||
"children": [
|
||||
{
|
||||
"id": "bf1753faa2",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,",
|
||||
"level": 2,
|
||||
"name": "叶菜类",
|
||||
"name_path": "蔬菜/豆制品,叶菜类",
|
||||
"parent_id": "e485b0bb87",
|
||||
"children": [
|
||||
{
|
||||
"id": "b8c8b14630",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,b8c8b14630,",
|
||||
"level": 3,
|
||||
"name": "空心菜类",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,空心菜类",
|
||||
"parent_id": "bf1753faa2"
|
||||
},
|
||||
{
|
||||
"id": "78c941ae91",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,78c941ae91,",
|
||||
"level": 3,
|
||||
"name": "紫苏/苏子叶",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,紫苏/苏子叶",
|
||||
"parent_id": "bf1753faa2"
|
||||
},
|
||||
{
|
||||
"id": "eccbf542f9",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,eccbf542f9,",
|
||||
"level": 3,
|
||||
"name": "乌塌菜/塌菜/乌菜",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,乌塌菜/塌菜/乌菜",
|
||||
"parent_id": "bf1753faa2"
|
||||
},
|
||||
{
|
||||
"id": "3621a8c3dc",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,3621a8c3dc,",
|
||||
"level": 3,
|
||||
"name": "菜心/菜苔类",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,菜心/菜苔类",
|
||||
"parent_id": "bf1753faa2"
|
||||
},
|
||||
{
|
||||
"id": "aad334b5a0",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,aad334b5a0,",
|
||||
"level": 3,
|
||||
"name": "马兰头/马兰/红梗菜",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,马兰头/马兰/红梗菜",
|
||||
"parent_id": "bf1753faa2"
|
||||
},
|
||||
{
|
||||
"id": "70d40b44f2",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,70d40b44f2,",
|
||||
"level": 3,
|
||||
"name": "苋菜类",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,苋菜类",
|
||||
"parent_id": "bf1753faa2"
|
||||
},
|
||||
{
|
||||
"id": "45623d0c88",
|
||||
"id_path": ",e485b0bb87,bf1753faa2,45623d0c88,",
|
||||
"level": 3,
|
||||
"name": "其他叶菜类",
|
||||
"name_path": "蔬菜/豆制品,叶菜类,其他叶菜类",
|
||||
"parent_id": "bf1753faa2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "188ae68906",
|
||||
"id_path": ",e485b0bb87,188ae68906,",
|
||||
"level": 2,
|
||||
"name": "葱姜蒜椒/调味菜",
|
||||
"name_path": "蔬菜/豆制品,葱姜蒜椒/调味菜",
|
||||
"parent_id": "e485b0bb87",
|
||||
"children": [
|
||||
{
|
||||
"id": "4c64873413",
|
||||
"id_path": ",e485b0bb87,188ae68906,4c64873413,",
|
||||
"level": 3,
|
||||
"name": "香菜类",
|
||||
"name_path": "蔬菜/豆制品,葱姜蒜椒/调味菜,香菜类",
|
||||
"parent_id": "188ae68906"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
JSON
|
||||
],
|
||||
]);
|
||||
$length_data = [];
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
try {
|
||||
$length_data[] = random_int(1, 9);
|
||||
$length_data[(string)$i] = [
|
||||
'length' => random_int(1, 9)
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
continue;
|
||||
}
|
||||
@@ -58,5 +216,63 @@ test('断言可以根据参数构建 URL', function (string $url, array $params,
|
||||
['c' => 'd'],
|
||||
true,
|
||||
'http://username:password@127.0.0.1/git/resp?id=1#/page?a=b&c=d',
|
||||
]
|
||||
],
|
||||
])->group('pure', 'utils');
|
||||
|
||||
test('断言可以判断是否是数组中的元素', function (
|
||||
$needle,
|
||||
array $haystack,
|
||||
bool $expect,
|
||||
bool $exceptions = false
|
||||
) use ($utils) {
|
||||
try {
|
||||
expect($utils->inArray($needle, $haystack))->toBe($expect);
|
||||
} catch (Throwable $e) {
|
||||
if ($exceptions) {
|
||||
expect(true)->toBeTrue();
|
||||
}
|
||||
}
|
||||
})->with([
|
||||
[1, ['1', 2, 3], true, false],
|
||||
['1', ['1', 2, 3], true, false],
|
||||
[[1, 2, 3], ['1', 2, 3], false, true],
|
||||
])->group('pure', 'utils');
|
||||
|
||||
test('无极分类', function (string $source, string $expected) {
|
||||
$tree = [];
|
||||
|
||||
foreach (Json::decode($source) as $item) {
|
||||
$path_array = explode(',', $item['namePath']);
|
||||
$parent_id = 0;
|
||||
|
||||
$name_path = [];
|
||||
$id_path = ',';
|
||||
|
||||
foreach ($path_array as $i => $name) {
|
||||
$name_path[] = $name;
|
||||
$level = $i + 1;
|
||||
$id = substr(md5($level . $name), 0, 10);
|
||||
$id_path .= $id . ',';
|
||||
$new_item = [
|
||||
'id' => $id,
|
||||
'id_path' => $id_path,
|
||||
'level' => $level,
|
||||
'name' => $name,
|
||||
'name_path' => join(',', $name_path + [$name]),
|
||||
'parent_id' => $parent_id,
|
||||
];
|
||||
|
||||
$tree[$id] = $new_item;
|
||||
$parent_id = $id;
|
||||
}
|
||||
}
|
||||
|
||||
/** @var UtilsService $utils */
|
||||
$utils = make(UtilsService::class);
|
||||
usort($tree, fn ($prevent, $current) => $current['level'] <=> $prevent['level']);
|
||||
|
||||
$tree = array_column($tree, null, 'id');
|
||||
$utils->unlimitedSubCategoriesQuicklyWithLevel(list: $tree);
|
||||
|
||||
expect($tree)->toBe(Json::decode($expected));
|
||||
})->with('categories');
|
||||
|
||||
130
tests/Unit/XmlServiceTest.php
Normal file
130
tests/Unit/XmlServiceTest.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* XmlServiceTest.php@LuxOP
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2023/4/10
|
||||
*/
|
||||
|
||||
namespace HyperfTest\Unit\Common;
|
||||
|
||||
use Singularity\HDK\Core\Service\XmlService;
|
||||
use Symfony\Component\Serializer\Encoder\XmlEncoder;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
/** @var XmlService $service */
|
||||
$service = make(
|
||||
XmlService::class,
|
||||
['encoder' => make(XmlEncoder::class)]
|
||||
);
|
||||
|
||||
test(
|
||||
'assert Xml can be encoded',
|
||||
function (array $data, string $expect, string $rootNodeName) use ($service) {
|
||||
$result = $service->encode($data, $rootNodeName);
|
||||
|
||||
expect($result)->toBe($expect);
|
||||
}
|
||||
)->with([
|
||||
'normal' => [
|
||||
'data' => [
|
||||
'@version' => '1.0',
|
||||
'@descripe' => 'Luxcreo',
|
||||
'UserName' => 'zhm',
|
||||
'Email' => 'haimei.zheng@luxcreo.ai',
|
||||
'BiosId' => '420036H32020120279',
|
||||
'validTime' => '2099/03/27',
|
||||
],
|
||||
'expect' => <<<'XML'
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClientInfo version="1.0" descripe="Luxcreo">
|
||||
<UserName>zhm</UserName>
|
||||
<Email>haimei.zheng@luxcreo.ai</Email>
|
||||
<BiosId>420036H32020120279</BiosId>
|
||||
<validTime>2099/03/27</validTime>
|
||||
</ClientInfo>
|
||||
|
||||
XML,
|
||||
'xmlRootNodeName' => 'ClientInfo',
|
||||
],
|
||||
'normal attribute' => [
|
||||
'data' => [
|
||||
'@version' => '1.0',
|
||||
'@descripe' => 'Luxcreo',
|
||||
'UserName' => 'zhm',
|
||||
'Email' => [
|
||||
'@type' => 'Business',
|
||||
'#' => 'haimei.zheng@luxcreo.ai',
|
||||
],
|
||||
'BiosId' => '420036H32020120279',
|
||||
'validTime' => '2099/03/27',
|
||||
],
|
||||
'expect' => <<<'XML'
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClientInfo version="1.0" descripe="Luxcreo">
|
||||
<UserName>zhm</UserName>
|
||||
<Email type="Business">haimei.zheng@luxcreo.ai</Email>
|
||||
<BiosId>420036H32020120279</BiosId>
|
||||
<validTime>2099/03/27</validTime>
|
||||
</ClientInfo>
|
||||
|
||||
XML
|
||||
,
|
||||
'ClientInfo',
|
||||
],
|
||||
'normal comment' => [
|
||||
'data' => [
|
||||
'@version' => '1.0',
|
||||
'@descripe' => 'Luxcreo',
|
||||
'UserName' => 'zhm',
|
||||
'Email' => [
|
||||
'@type' => 'Business',
|
||||
'#' => 'haimei.zheng@luxcreo.ai',
|
||||
],
|
||||
'BiosId' => '420036H32020120279',
|
||||
'validTime' => [
|
||||
'#comment' => '到期时间',
|
||||
],
|
||||
],
|
||||
'expect' => <<<'XML'
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClientInfo version="1.0" descripe="Luxcreo">
|
||||
<UserName>zhm</UserName>
|
||||
<Email type="Business">haimei.zheng@luxcreo.ai</Email>
|
||||
<BiosId>420036H32020120279</BiosId>
|
||||
<validTime>
|
||||
<!--到期时间-->
|
||||
</validTime>
|
||||
</ClientInfo>
|
||||
|
||||
XML
|
||||
,
|
||||
'ClientInfo',
|
||||
],
|
||||
]);
|
||||
|
||||
test('assert Xml can be parsed', function (string $xml, array $expected) use ($service) {
|
||||
$data = $service->decode($xml);
|
||||
expect($data)->toBe($expected);
|
||||
})->with([
|
||||
'normal' => [
|
||||
'xml' => <<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ClientInfo version="1.0" descripe="LuxAlignAuthentication">
|
||||
<UserName>zhm</UserName>
|
||||
<Email>haimei.zheng@luxcreo.ai</Email>
|
||||
<BiosId>420036H32020120279</BiosId>
|
||||
</ClientInfo>
|
||||
|
||||
XML,
|
||||
'expected' => [
|
||||
'@version' => 1.0,
|
||||
'@descripe' => 'LuxAlignAuthentication',
|
||||
'UserName' => 'zhm',
|
||||
'Email' => 'haimei.zheng@luxcreo.ai',
|
||||
'BiosId' => '420036H32020120279',
|
||||
],
|
||||
],
|
||||
]);
|
||||
@@ -1,16 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
use Hyperf\Context\ApplicationContext;
|
||||
use Hyperf\Di\ClassLoader;
|
||||
use Hyperf\Di\Container;
|
||||
use Hyperf\Di\Definition\DefinitionSource;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Swoole\Runtime;
|
||||
|
||||
ini_set('display_errors', 'on');
|
||||
ini_set('display_startup_errors', 'on');
|
||||
|
||||
error_reporting(E_ALL);
|
||||
date_default_timezone_set('Asia/Shanghai');
|
||||
|
||||
|
||||
!defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
||||
!defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
||||
|
||||
Runtime::enableCoroutine(true);
|
||||
|
||||
require BASE_PATH . '/vendor/autoload.php';
|
||||
ClassLoader::init();
|
||||
|
||||
$container = new Container(new DefinitionSource([]));
|
||||
if (!$container instanceof ContainerInterface) {
|
||||
throw new RuntimeException('The dependency injection container is invalid.');
|
||||
}
|
||||
$container = ApplicationContext::setContainer($container);
|
||||
|
||||
Reference in New Issue
Block a user