mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-05 15:55:36 +08:00
Compare commits
435 Commits
2.7.5
...
3.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb936e97ac | ||
|
|
8ca4f7400a | ||
|
|
61b48676ae | ||
|
|
257e59b79f | ||
|
|
c19791c31d | ||
|
|
c99747c1f6 | ||
|
|
a9b6989966 | ||
|
|
c9bf0fb13c | ||
|
|
04247048d4 | ||
|
|
b2a6c2f5e0 | ||
|
|
865c306e14 | ||
|
|
588fc919d9 | ||
|
|
8ff7da4d23 | ||
|
|
da516b487d | ||
|
|
06615cbb29 | ||
|
|
463ee0cced | ||
|
|
208ccd6642 | ||
|
|
cd2bb1b570 | ||
|
|
52a195aca2 | ||
|
|
fbc3cf00a2 | ||
|
|
ede5f456a8 | ||
|
|
2633e91d4d | ||
|
|
39b3a74d34 | ||
|
|
3ecd224ce6 | ||
|
|
49c7033eaa | ||
|
|
20ca848df9 | ||
|
|
5b0e3ed636 | ||
|
|
14840715bc | ||
|
|
ed4537e5d5 | ||
|
|
58d4b4427d | ||
|
|
8c6aba9361 | ||
|
|
1173949bba | ||
|
|
279956456c | ||
|
|
3f8c557a96 | ||
|
|
ff93201ab1 | ||
|
|
cd94539e99 | ||
|
|
adc1d176e3 | ||
|
|
44c25f7fdd | ||
|
|
3806983bc2 | ||
|
|
c6f877700e | ||
|
|
c2fb90dfc7 | ||
|
|
ca61e6a238 | ||
|
|
9399e54da8 | ||
|
|
385f217b96 | ||
|
|
65bb6a2473 | ||
|
|
a430cf59c4 | ||
|
|
4bf328ef67 | ||
|
|
ebb724415d | ||
|
|
daa07dcb2b | ||
|
|
635f081437 | ||
|
|
c7b4ca2a82 | ||
|
|
b5c91531fa | ||
|
|
8199e91ce0 | ||
|
|
44c32c1711 | ||
|
|
5a3da43640 | ||
|
|
352f3e920e | ||
|
|
5f4a00c77e | ||
|
|
aeea6f5dc1 | ||
|
|
ea74a531b4 | ||
|
|
02003b2bd3 | ||
|
|
723dfd30a2 | ||
|
|
aa29dc99f3 | ||
|
|
74ba4d0145 | ||
|
|
5705f5227f | ||
|
|
3bb34b46ee | ||
|
|
4d0ea99f47 | ||
|
|
fe70c07113 | ||
|
|
27c6bf1864 | ||
|
|
f4ded4c6d7 | ||
|
|
4a2c7f5ecb | ||
|
|
7a051380e2 | ||
|
|
35dec947df | ||
|
|
6b34427855 | ||
|
|
59a9f30089 | ||
|
|
779564ebb6 | ||
|
|
a4f992b9e5 | ||
|
|
cf3f09600b | ||
|
|
83c1d63408 | ||
|
|
43337c34c8 | ||
|
|
bb431ccf53 | ||
|
|
ba69cc93ee | ||
|
|
406de8f4df | ||
|
|
fd05fe6e25 | ||
|
|
10a0ee9142 | ||
|
|
836d4dc1ef | ||
|
|
a18fcdb21e | ||
|
|
6c9cd06e4a | ||
|
|
44c1ac054c | ||
|
|
9d77d60887 | ||
|
|
8f7fd97ebe | ||
|
|
87e3b2249c | ||
|
|
5e12af77a4 | ||
|
|
47244373d7 | ||
|
|
a72530598a | ||
|
|
2679facf24 | ||
|
|
cf9db4b0d4 | ||
|
|
f341c8585e | ||
|
|
28f7b47034 | ||
|
|
99954f9140 | ||
|
|
85b21d63ed | ||
|
|
ef443d9912 | ||
|
|
db2b22c822 | ||
|
|
24156884e4 | ||
|
|
6413567353 | ||
|
|
84f84dad40 | ||
|
|
dd01653da9 | ||
|
|
085472a12c | ||
|
|
e9b6965678 | ||
|
|
1a9680c09a | ||
|
|
40f8fe22ee | ||
|
|
be6002dd64 | ||
|
|
96ebb770b6 | ||
|
|
9bcdb254c9 | ||
|
|
87e71f1eb8 | ||
|
|
451ce104c5 | ||
|
|
7920711988 | ||
|
|
6e78f2caf2 | ||
|
|
2727b056eb | ||
|
|
975d0e3540 | ||
|
|
eb7e700e7c | ||
|
|
18892a14c2 | ||
|
|
6cbde80a1c | ||
|
|
6fc875aa72 | ||
|
|
29f5c3c758 | ||
|
|
afa6411004 | ||
|
|
67526c30da | ||
|
|
dc67dbc489 | ||
|
|
05ac2feebd | ||
|
|
6f30c04899 | ||
|
|
dfce8e9749 | ||
|
|
aae326133b | ||
|
|
15383a6b92 | ||
|
|
5d8a1deb35 | ||
|
|
b09d12aad5 | ||
|
|
488acc3e69 | ||
|
|
32534c870d | ||
|
|
74af1516ac | ||
|
|
07b2f175f3 | ||
|
|
1a1c65afce | ||
|
|
90282b858e | ||
|
|
f819922d8a | ||
|
|
aa8fdf557e | ||
|
|
4896cf0ad3 | ||
|
|
2e61e2a366 | ||
|
|
172a7444c9 | ||
|
|
3ea5b16487 | ||
|
|
e83a169fd6 | ||
|
|
53c1c0103c | ||
|
|
e467402a15 | ||
|
|
d5fc16dccb | ||
|
|
3be84edb5a | ||
|
|
fe3bb22311 | ||
|
|
86c2cf96a9 | ||
|
|
67ba8340cc | ||
|
|
ac69640253 | ||
|
|
64965bcc93 | ||
|
|
2eb73f3746 | ||
|
|
8f761c31e3 | ||
|
|
528b61862a | ||
|
|
c7003a7139 | ||
|
|
75e65b082e | ||
|
|
22d38b783d | ||
|
|
ebdada57a6 | ||
|
|
28f8850013 | ||
|
|
540977c637 | ||
|
|
4ba74e9f3e | ||
|
|
cecdb1681c | ||
|
|
2947da2a00 | ||
|
|
da6000b4da | ||
|
|
8be7207c3c | ||
|
|
0a806a74b1 | ||
|
|
d56f9d6e6e | ||
|
|
dc742763a8 | ||
|
|
0b9b87ba23 | ||
|
|
346be22ea9 | ||
|
|
b2c95d96b1 | ||
|
|
1c801bb205 | ||
|
|
163d240a9c | ||
|
|
19fc3a6d40 | ||
|
|
4c9bc002f4 | ||
|
|
b3a5d50ba8 | ||
|
|
f7919129b6 | ||
|
|
dccb1d91e2 | ||
|
|
41b058aeaf | ||
|
|
f2a12634a4 | ||
|
|
8d33f45388 | ||
|
|
cb7e230214 | ||
|
|
badd05a014 | ||
|
|
47ffe9a2ec | ||
|
|
4fe74eb5fe | ||
|
|
1c40896dc0 | ||
|
|
872b4ce1c6 | ||
|
|
c0fed1a391 | ||
|
|
d1f584e490 | ||
|
|
79f5011d58 | ||
|
|
e350edd41f | ||
|
|
23a6e56478 | ||
|
|
80050f11f2 | ||
|
|
25c46cc978 | ||
|
|
458c42ae7c | ||
|
|
febeeadc7b | ||
|
|
044643559d | ||
|
|
782e668abf | ||
|
|
fa6af88566 | ||
|
|
c106c4fc2a | ||
|
|
09780f64de | ||
|
|
81d4558b2f | ||
|
|
3de0e37fd5 | ||
|
|
fcfd2f8ba5 | ||
|
|
7e7e461237 | ||
|
|
2afab030bd | ||
|
|
5cbeee6e86 | ||
|
|
87bbffefc3 | ||
|
|
a2877cab70 | ||
|
|
4f10b6dbc3 | ||
|
|
24a213a8ff | ||
|
|
cf21044cf7 | ||
|
|
289a5d7051 | ||
|
|
b5ae76d298 | ||
|
|
598cf60e10 | ||
|
|
c4ca2103e4 | ||
|
|
4b55a3e525 | ||
|
|
376b81f841 | ||
|
|
ee6035c59a | ||
|
|
a757330788 | ||
|
|
bf141202f8 | ||
|
|
1be3127177 | ||
|
|
c74a43cd74 | ||
|
|
1b520d3c96 | ||
|
|
b7418a2a3a | ||
|
|
eee67cdb53 | ||
|
|
1d70bc4ed7 | ||
|
|
d06b0dd6d6 | ||
|
|
cbbac0554e | ||
|
|
5f16766997 | ||
|
|
dcd6cae0f6 | ||
|
|
cc43993d5b | ||
|
|
2478ffe331 | ||
|
|
18ae960f86 | ||
|
|
fcb226e357 | ||
|
|
58c04b7a7b | ||
|
|
a6401fa9ef | ||
|
|
2481124ada | ||
|
|
488fde47e5 | ||
|
|
e7e77c99d0 | ||
|
|
6fbd35ed33 | ||
|
|
fba2339280 | ||
|
|
bd8270a4ae | ||
|
|
5299061c87 | ||
|
|
e843aeac55 | ||
|
|
19c792209b | ||
|
|
277d442634 | ||
|
|
51bec043e3 | ||
|
|
b7595f6f22 | ||
|
|
55181d583f | ||
|
|
b5a5a4f32e | ||
|
|
a746779efa | ||
|
|
736b6ea0a5 | ||
|
|
884f07baa6 | ||
|
|
b496c3136e | ||
|
|
bbfb40f973 | ||
|
|
a73e1fc164 | ||
|
|
ef7acb7fa0 | ||
|
|
fcd108adbe | ||
|
|
c9c76bfd10 | ||
|
|
d9302a3120 | ||
|
|
0cb3308dd1 | ||
|
|
583b9d7cf7 | ||
|
|
d7728ebc25 | ||
|
|
b6742526aa | ||
|
|
4defd8ac1b | ||
|
|
d28672e2ad | ||
|
|
94d6a51358 | ||
|
|
54eabc948f | ||
|
|
6c9e26ce83 | ||
|
|
a934037179 | ||
|
|
396444a089 | ||
|
|
699444abdd | ||
|
|
088031f807 | ||
|
|
8ce6e2c111 | ||
|
|
e7f36b9fcf | ||
|
|
dab91f526e | ||
|
|
35e23a7cbc | ||
|
|
7df05df48f | ||
|
|
707a1ae628 | ||
|
|
a65fc4076b | ||
|
|
f487897cf2 | ||
|
|
869d9ed543 | ||
|
|
8f61ed7561 | ||
|
|
8cb6a32341 | ||
|
|
687260e53c | ||
|
|
a919ce4554 | ||
|
|
d19d7acedd | ||
|
|
a393b3aff5 | ||
|
|
8c2036b6b4 | ||
|
|
dc081861ad | ||
|
|
ec76d2ba7d | ||
|
|
47ce0a8e9c | ||
|
|
f1c730962b | ||
|
|
d95a5131f6 | ||
|
|
69637cf482 | ||
|
|
25d6ec3a92 | ||
|
|
8bf5ff4e7f | ||
|
|
fd4e4be3a8 | ||
|
|
e0a01ea2ca | ||
|
|
256ccb96a6 | ||
|
|
bfffdc7d21 | ||
|
|
3bbe21268b | ||
|
|
1537e88a74 | ||
|
|
0d9711e62d | ||
|
|
0a7c5f06c6 | ||
|
|
e7a8a32b73 | ||
|
|
62b703f2e4 | ||
|
|
f44921d136 | ||
|
|
cd42545c7d | ||
|
|
0df3fd7bed | ||
|
|
56241da281 | ||
|
|
05a04104dd | ||
|
|
50d27ee186 | ||
|
|
371926b5a6 | ||
|
|
97face2406 | ||
|
|
ea64b40011 | ||
|
|
6d23e489aa | ||
|
|
f4d75e211f | ||
|
|
48f6cc644d | ||
|
|
33f517333f | ||
|
|
7253a309c7 | ||
|
|
f2aff5882d | ||
|
|
0dd61a7270 | ||
|
|
420b8e6d67 | ||
|
|
9e08919ce0 | ||
|
|
a7324f6c49 | ||
|
|
721c0834db | ||
|
|
e37629aaea | ||
|
|
a43a4a429e | ||
|
|
f5d34198e7 | ||
|
|
46604293e9 | ||
|
|
58e405cccd | ||
|
|
1deea5bebc | ||
|
|
cad5636f92 | ||
|
|
90290bee94 | ||
|
|
9f7ebceeb9 | ||
|
|
60ea2c7e12 | ||
|
|
441c866160 | ||
|
|
33d3341bb3 | ||
|
|
1d778fd78e | ||
|
|
0cd73a6304 | ||
|
|
2fedfe5b18 | ||
|
|
77c140bee6 | ||
|
|
c06e38d71f | ||
|
|
9b59cec22a | ||
|
|
306e992789 | ||
|
|
8335cfed69 | ||
|
|
4702aa1987 | ||
|
|
145e1b31a0 | ||
|
|
f2e28de20c | ||
|
|
bcaaf88edb | ||
|
|
120698fb43 | ||
|
|
dd88585ffa | ||
|
|
93a8c450ad | ||
|
|
3451434997 | ||
|
|
0bab2e74b0 | ||
|
|
c1a877489b | ||
|
|
520099aaba | ||
|
|
9bd02b3dd2 | ||
|
|
ba64f2c189 | ||
|
|
fbb194a6c5 | ||
|
|
30b2d2134b | ||
|
|
7eea71e282 | ||
|
|
e40b3029e0 | ||
|
|
17492c78fa | ||
|
|
a9276d3f72 | ||
|
|
eecbe49955 | ||
|
|
be9874a9ad | ||
|
|
b4fcc057c5 | ||
|
|
d9499dc56b | ||
|
|
f6806c88ab | ||
|
|
2caca545ad | ||
|
|
ff0f11da7f | ||
|
|
daa1822bc5 | ||
|
|
d490892092 | ||
|
|
182a4e7b06 | ||
|
|
e9beed03ea | ||
|
|
8351527aea | ||
|
|
ddff663b0b | ||
|
|
31b4fb9201 | ||
|
|
1f7f0da383 | ||
|
|
9fa1079248 | ||
|
|
ae0cf5e3d7 | ||
|
|
672369c598 | ||
|
|
73687f248b | ||
|
|
65cc2a948a | ||
|
|
299f36dcc0 | ||
|
|
f5cbce5195 | ||
|
|
a3780667b2 | ||
|
|
a21742a326 | ||
|
|
40aacb2e61 | ||
|
|
ba18869c85 | ||
|
|
a454f2c523 | ||
|
|
7caebaa6ba | ||
|
|
580abd7317 | ||
|
|
3187431611 | ||
|
|
81c37c9a0a | ||
|
|
ba5bca20da | ||
|
|
533fe187bd | ||
|
|
c4da26c19d | ||
|
|
ca7bfcc8c6 | ||
|
|
6c7b582faf | ||
|
|
6f2e6135f1 | ||
|
|
37a92e03c1 | ||
|
|
35385f8916 | ||
|
|
a2fbdd8e0a | ||
|
|
bab610722f | ||
|
|
4cabc8d132 | ||
|
|
e8bd381907 | ||
|
|
42aac802dd | ||
|
|
d748a20445 | ||
|
|
5db3ff934d | ||
|
|
9bfa3ede20 | ||
|
|
127466e546 | ||
|
|
16aa30cac7 | ||
|
|
05a3d0111b | ||
|
|
9f4b5fb14a | ||
|
|
a716e68f87 | ||
|
|
2e127771ed | ||
|
|
c6bbba6051 | ||
|
|
443ed115b0 | ||
|
|
f450b8d863 | ||
|
|
acf570e652 | ||
|
|
4e9199c68e | ||
|
|
6f5575b155 | ||
|
|
700b854434 | ||
|
|
37b5d954e9 | ||
|
|
ac50e96568 | ||
|
|
86174c2e9f |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- closed
|
||||
paths:
|
||||
- 'src/**.php'
|
||||
|
||||
jobs:
|
||||
incremental-build-number:
|
||||
if: github.event.pull_request.merged == true
|
||||
name: Incremental Build Number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Increment build number
|
||||
run: sed -i -r 's/(.*)(\VERSION_ID\s=\s)([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' src/ZM/ConsoleApplication.php
|
||||
|
||||
- name: Commit change
|
||||
run: |
|
||||
git config --global user.name 'Github Build Bot'
|
||||
git config --global user.email 'noreply@github.com'
|
||||
git add src/ZM/ConsoleApplication.php
|
||||
git commit -m "increment build number"
|
||||
git push
|
||||
42
.github/workflows/coding-style.yml
vendored
Normal file
42
.github/workflows/coding-style.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Code Style
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pre_job:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@v5
|
||||
with:
|
||||
concurrent_skipping: same_content_newer
|
||||
skip_after_successful_duplicate: true
|
||||
paths: '["src/**", "tests/**"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule"]'
|
||||
|
||||
cs-fix:
|
||||
needs: pre_job
|
||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||
name: Code Style
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup PHP
|
||||
uses: sunxyw/workflows/setup-environment@main
|
||||
with:
|
||||
php-version: 8.0
|
||||
php-extensions: swoole, posix, json
|
||||
operating-system: ubuntu-latest
|
||||
use-cache: true
|
||||
|
||||
- name: Code Style
|
||||
uses: sunxyw/workflows/coding-style@main
|
||||
54
.github/workflows/increment-build-number.yml
vendored
Normal file
54
.github/workflows/increment-build-number.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Increment Build Number
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- '*-develop'
|
||||
types:
|
||||
- closed
|
||||
paths:
|
||||
- 'src/**.php'
|
||||
|
||||
jobs:
|
||||
incremental-build-number:
|
||||
if: github.event.pull_request.merged == true
|
||||
name: Incremental Build Number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.base_ref }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: sunxyw/workflows/setup-environment@main
|
||||
with:
|
||||
php-version: 8.0
|
||||
php-extensions: swoole, posix, json
|
||||
operating-system: ubuntu-latest
|
||||
use-cache: true
|
||||
|
||||
- name: Generate API Docs
|
||||
id: generate-api-docs
|
||||
continue-on-error: true
|
||||
run: bin/gendoc
|
||||
|
||||
- name: Commit API Docs
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: update api docs
|
||||
branch: ${{ github.base_ref }}
|
||||
|
||||
- name: Increment build number
|
||||
id: increment-build-number
|
||||
run: |
|
||||
sed -i -r 's/(.*)(\VERSION_ID\s=\s)([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' src/ZM/Framework.php
|
||||
BUILD_ID=$(cat src/ZM/Framework.php | grep "VERSION_ID = " | sed 's/[^0-9]//g')
|
||||
echo "::set-output name=build_id::$BUILD_ID"
|
||||
|
||||
- name: Commit build number
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: increment build number (build ${{ steps.increment-build-number.outputs.build_id }})
|
||||
branch: ${{ github.base_ref }}
|
||||
65
.github/workflows/integration-test.yml
vendored
65
.github/workflows/integration-test.yml
vendored
@@ -1,65 +0,0 @@
|
||||
name: Integration Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
- review_requested
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
|
||||
jobs:
|
||||
integration:
|
||||
name: Integration Test (PHP ${{ matrix.php-versions }}) (OS ${{ matrix.operating-system }})
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ "ubuntu-latest", "macos-latest" ]
|
||||
php-versions: [ "7.2", "7.3", "7.4", "8.0", "8.1" ]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: swoole, posix, json
|
||||
|
||||
- name: Setup problem matchers for PHP
|
||||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
|
||||
|
||||
- name: Validate composer.json
|
||||
run: "composer validate --strict"
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install Composer Dependencies
|
||||
run: "composer install --prefer-dist --no-progress --optimize-autoloader"
|
||||
|
||||
- name: Run Static Analysis
|
||||
run: "composer analyse"
|
||||
|
||||
- name: Run PHP CS Fixer Check
|
||||
run: "./vendor/bin/php-cs-fixer fix --dry-run --diff"
|
||||
42
.github/workflows/static-analysis.yml
vendored
Normal file
42
.github/workflows/static-analysis.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Static Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pre_job:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@v5
|
||||
with:
|
||||
concurrent_skipping: same_content_newer
|
||||
skip_after_successful_duplicate: true
|
||||
paths: '["src/**", "tests/**"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule"]'
|
||||
|
||||
analyse:
|
||||
needs: pre_job
|
||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||
name: Static Analysis
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup PHP
|
||||
uses: sunxyw/workflows/setup-environment@main
|
||||
with:
|
||||
php-version: 8.0
|
||||
php-extensions: swoole, posix, json
|
||||
operating-system: ubuntu-latest
|
||||
use-cache: true
|
||||
|
||||
- name: Static Analysis
|
||||
uses: sunxyw/workflows/static-analysis@main
|
||||
54
.github/workflows/test.yml
vendored
Normal file
54
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
- '*-dev*'
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- review_requested
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pre_job:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@v5
|
||||
with:
|
||||
concurrent_skipping: same_content_newer
|
||||
skip_after_successful_duplicate: true
|
||||
paths: '["src/**", "tests/**", "bin/phpunit-zm"]'
|
||||
do_not_skip: '["workflow_dispatch", "schedule"]'
|
||||
|
||||
test:
|
||||
needs: pre_job
|
||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
php-version: [ 8.0, 8.1, 8.2 ]
|
||||
name: PHP ${{ matrix.php-version }} Test (${{ matrix.operating-system }})
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup PHP
|
||||
uses: sunxyw/workflows/setup-environment@main
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
php-extensions: swoole, posix, json
|
||||
operating-system: ${{ matrix.operating-system }}
|
||||
use-cache: true
|
||||
|
||||
- name: Test
|
||||
uses: sunxyw/workflows/test@main
|
||||
15
.github/workflows/vuepress-deploy.yml
vendored
15
.github/workflows/vuepress-deploy.yml
vendored
@@ -1,8 +1,11 @@
|
||||
name: VuePress Auto Deploy
|
||||
name: Docs and Script Auto Deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'ext/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -10,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout master
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Deploy docs to GitHub Pages
|
||||
uses: jenkey2011/vuepress-deploy@master
|
||||
@@ -30,3 +33,11 @@ jobs:
|
||||
REMOTE_HOST: ${{ secrets.ZHAMAO_XIN_HOST }}
|
||||
REMOTE_USER: ${{ secrets.ZHAMAO_XIN_USER }}
|
||||
TARGET: ${{ secrets.ZHAMAO_XIN_TARGET }}
|
||||
- name: deploy script file
|
||||
uses: wlixcc/SFTP-Deploy-Action@v1.2
|
||||
with:
|
||||
username: ${{ secrets.ZHAMAO_XIN_USER }}
|
||||
server: ${{ secrets.ZHAMAO_XIN_HOST }}
|
||||
ssh_private_key: ${{ secrets.ZHAMAO_XIN_PRIVATE_KEY }}
|
||||
local_path: './ext/go.sh'
|
||||
remote_path: ${{ secrets.ZHAMAO_XIN_MAIN_TARGET }}
|
||||
|
||||
73
.gitignore
vendored
73
.gitignore
vendored
@@ -1,21 +1,27 @@
|
||||
.idea/
|
||||
/src/test/
|
||||
/src/webconsole/config/
|
||||
/vendor/
|
||||
### Zhamao Framework ###
|
||||
/zm_data/
|
||||
composer.lock
|
||||
/resources/server.phar
|
||||
/distribute/
|
||||
/bin/.phpunit.result.cache
|
||||
/resources/zhamao.service
|
||||
.phpunit.result.cache
|
||||
.daemon_pid
|
||||
/runtime/
|
||||
/tmp/
|
||||
/temp/
|
||||
/site/
|
||||
/plugins/
|
||||
|
||||
# go-cqhttp快速安装启动相关(可能被废弃)
|
||||
# 框架审计文件
|
||||
audit.log
|
||||
|
||||
# 进程锁文件
|
||||
.daemon_pid
|
||||
.zm_worker_*.pid
|
||||
|
||||
### Composer ###
|
||||
composer.phar
|
||||
/vendor/
|
||||
composer.lock
|
||||
|
||||
### Go CQHTTP ###
|
||||
/ext/go-cqhttp/data/
|
||||
/ext/go-cqhttp/logs/
|
||||
/ext/go-cqhttp/config.hjson
|
||||
@@ -23,12 +29,55 @@ composer.lock
|
||||
/ext/go-cqhttp/go-cqhttp
|
||||
/ext/go-cqhttp/session.token
|
||||
|
||||
.zm_worker_*.pid
|
||||
### Git ###
|
||||
# 备份文件
|
||||
*.orig
|
||||
|
||||
# Git Hook 的相关锁文件
|
||||
# 解决 Merge 冲突时可能会自动生成的文件
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
# Git Hooks
|
||||
cghooks.lock
|
||||
|
||||
# Vuepress 相关文件
|
||||
### VuePress ###
|
||||
/node_modules/
|
||||
/docs/.vuepress/dist/
|
||||
package-lock.json
|
||||
|
||||
### PHPUnit ###
|
||||
|
||||
# 生成的文件
|
||||
/bin/.phpunit.result.cache
|
||||
.phpunit.result.cache
|
||||
.phpunit.cache
|
||||
|
||||
# 本地配置
|
||||
/phpunit.xml
|
||||
|
||||
# 构建目录
|
||||
/build/
|
||||
|
||||
### PhpStorm ###
|
||||
# 兼容 PHPStorm 及其他 Jetbrains IDE
|
||||
|
||||
# 除了代码格式配置和运行配置之外的所有文件
|
||||
.idea/*
|
||||
|
||||
!.idea/codeStyles
|
||||
!.idea/runConfigurations
|
||||
|
||||
### Phive ###
|
||||
/.phive/
|
||||
/tools/
|
||||
|
||||
### ASDF ###
|
||||
/.tool-version
|
||||
|
||||
.DS_Store
|
||||
|
||||
@@ -65,11 +65,11 @@ return (new PhpCsFixer\Config())
|
||||
'standardize_not_equals' => true,
|
||||
'multiline_comment_opening_closing' => true,
|
||||
'phpdoc_summary' => false,
|
||||
'php_unit_test_class_requires_covers' => false,
|
||||
])
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->exclude('vendor')
|
||||
->exclude('docs')
|
||||
->in(__DIR__ . '/src')
|
||||
->in(__DIR__ . '/tests')
|
||||
)
|
||||
->setUsingCache(false);
|
||||
|
||||
11
.phpstorm.meta.php
Normal file
11
.phpstorm.meta.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
use OneBot\V12\Object\Event\OneBotEvent;
|
||||
use ZM\Context\Context;
|
||||
|
||||
override(Context::__call(0), map([
|
||||
'getBotEvent' => OneBotEvent::class,
|
||||
]));
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Reload Zhamao Server" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="./zhamao server:reload && exit" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,17 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run Zhamao Server" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="./zhamao server" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="./zhamao" />
|
||||
<option name="SCRIPT_OPTIONS" value="server" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,17 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run watcher" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="bin/watcher" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="/bin/zsh" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,17 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Stop Zhamao Server" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="./zhamao server:stop && exit" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
68
CONTRIBUTING.md
Normal file
68
CONTRIBUTING.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# 炸毛框架贡献指南
|
||||
|
||||
首先很高兴你愿意读这篇文章,因为我们需要更多的开发者来帮助我们开发和维护。
|
||||
|
||||
如果你还没加入我们的 [QQ 群(670821194)][qq-group],我们建议你加入一下,以便和其他开发者实时交流和协作。
|
||||
|
||||
## 测试
|
||||
|
||||
我们目前采用 PHPUnit 作为测试框架,如果你编写了新的功能或改变了现有的行为,我们希望你可以编写相应的测试代码。
|
||||
|
||||
## 提交变更
|
||||
|
||||
请使用 [GitHub Pull Request][new-pr] 提交你的更改,并附上恰当的说明(例如一个简明的列表列出所作的改动)。
|
||||
|
||||
同时,请不要忘记在提交前执行代码格式检查 `composer cs-fix` 和静态分析检查 `composer analyse`
|
||||
。虽然我们的自动化流程会在你推送到仓库后自动运行检查,但我仍然建议你提前在本地运行,以节省可能的修改成本。
|
||||
|
||||
对了,请尽量为你的每个函数、方法加上 PHPDoc 注释。
|
||||
|
||||
## 具体贡献流程
|
||||
|
||||
#### **你发现了个 BUG?**
|
||||
|
||||
- **如果你发现的是安全漏洞,请不要在 GitHub 上回报!** 请直接联系 [@crazywhalecc](https://github.com/crazywhalecc)。
|
||||
|
||||
- **确保该问题还没被其他人回报。** 你可以在 [Issue 列表][issues] 中搜索相关关键词来检查。
|
||||
|
||||
- 如果你没能找到一个已有的 Issue 来描述你遇到的问题,[请新建一个 Issue][new-issue]。请务必包含**标题和清晰的描述**
|
||||
,尽可能多的相关信息,以及一个**代码示例**或者一个**可执行的测试用例**,来描述你遇到的问题。
|
||||
|
||||
- 如果可以的话,请使用相关的 Issue 模板来创建 Issue。
|
||||
|
||||
#### **你修复了个 BUG?**
|
||||
|
||||
- 在 GitHub 上提交一个 Pull Request。
|
||||
|
||||
- 确保 PR 的描述清楚地描述了问题和解决方案。如果有相关的 Issue,请在 PR 描述中包含 Issue 编号。
|
||||
|
||||
#### **你想添加新功能或改变现有功能?**
|
||||
|
||||
- 虽然你可以直接提交 PR,但我们建议你先与我们的开发者讨论你的想法,以避免你的努力白费。你可以在 [QQ 群][qq-group]
|
||||
中与我们的开发者交流,或者在 [GitHub Issue][issues] 中提出你的想法。
|
||||
|
||||
- 如果你的想法被采纳,你可以在 GitHub 上[提交一个 Pull Request][new-pr]。
|
||||
|
||||
#### **你对源码有疑问?**
|
||||
|
||||
- 你可以在 [QQ 群][qq-group] 中与我们的开发者讨论,或者你也可以在 [GitHub Issue][issues] 中提出你的疑问。
|
||||
|
||||
#### **你想为文档做贡献?**
|
||||
|
||||
- 非常欢迎^^
|
||||
|
||||
- 你可以直接[提交一个 Pull Request][new-pr]。
|
||||
|
||||
炸毛框架是由志愿开发者共同维护的项目。我们欢迎你加入我们的开发。
|
||||
|
||||
感谢~ :heart: :heart: :heart:
|
||||
|
||||
炸毛框架开发团队
|
||||
|
||||
[issues]: https://github.com/zhamao-robot/zhamao-framework/issues
|
||||
|
||||
[new-pr]: https://github.com/zhamao-robot/zhamao-framework/pull/new/master
|
||||
|
||||
[new-issue]: https://github.com/zhamao-robot/zhamao-framework/issues/new
|
||||
|
||||
[qq-group]: https://jq.qq.com/?_wv=1027&k=KdIGy0UK
|
||||
2
LICENSE
2
LICENSE
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2022 CrazyBot Developer Team
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
110
README.md
110
README.md
@@ -3,14 +3,42 @@
|
||||
<h2>炸毛框架</h2>
|
||||
炸毛框架 (zhamao-framework) 是一个协程高性能的聊天机器人 + Web 服务器开发框架<br><br>
|
||||
|
||||
[](http://wpa.qq.com/msgrd?v=3&uin=627577391&site=qq&menu=yes)
|
||||
[](https://github.com/zhamao-robot/zhamao-framework/blob/master/LICENSE)
|
||||
[](https://packagist.org/packages/zhamao/framework)
|
||||
[](https://github.com/howmanybots/onebot)
|
||||

|
||||
<p align="center">
|
||||
<a href="https://onebot.dev/">
|
||||
<img src="https://img.shields.io/badge/OneBot-11-black?style=flat-square" alt="OneBot">
|
||||
</a>
|
||||
|
||||
[](https://github.com/zhamao-robot/zhamao-framework/search?q=AnnotationBase)
|
||||
[](https://github.com/zhamao-robot/zhamao-framework/search?q=TODO)
|
||||
<a href="https://github.com/zhamao-robot/zhamao-framework/actions">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/zhamao-robot/zhamao-framework/test.yml?branch=v3-develop&label=Test&style=flat-square" alt="Integration Test">
|
||||
</a>
|
||||
|
||||
<a href="https://packagist.org/packages/zhamao/framework">
|
||||
<img src="https://img.shields.io/packagist/dt/zhamao/framework?label=Downloads&style=flat-square" alt="下载数">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/zhamao-robot/zhamao-framework/releases">
|
||||
<img src="https://img.shields.io/packagist/v/zhamao/framework?include_prereleases&label=Release&style=flat-square" alt="最新版本">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/zhamao-robot/zhamao-framework/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/zhamao-robot/zhamao-framework?label=License&style=flat-square" alt="开源协议">
|
||||
</a>
|
||||
|
||||
<a href="https://wpa.qq.com/msgrd?v=3&uin=627577391&site=qq&menu=yes">
|
||||
<img src="https://img.shields.io/badge/作者QQ-627577391-orange?style=flat-square" alt="作者QQ">
|
||||
</a>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<a href="https://github.com/zhamao-robot/zhamao-framework/search?q=AnnotationBase">
|
||||
<img src="https://img.shields.io/github/search/zhamao-robot/zhamao-framework/AnnotationBase?label=Annotations&style=flat-square" alt="注解数量">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/zhamao-robot/zhamao-framework/search?q=TODO">
|
||||
<img src="https://img.shields.io/github/search/zhamao-robot/zhamao-framework/TODO?label=TODO&style=flat-square" alt="TODO">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -22,42 +50,50 @@
|
||||
|
||||
## 简介
|
||||
|
||||
炸毛框架使用 PHP 编写,采用 Swoole 扩展为基础,主要面向 API 服务,聊天机器人(OneBot 兼容的 QQ 机器人对接),包含 Websocket、HTTP
|
||||
炸毛框架使用 PHP 编写,主要面向 API 服务,聊天机器人,包含 Websocket、HTTP
|
||||
等监听和请求库,用户代码采用模块化处理,使用注解可以方便地编写各类功能。
|
||||
|
||||
框架主要用途为 HTTP 服务器,机器人搭建框架。尤其对于 QQ 机器人消息处理较为方便和全面,提供了众多会话机制和内部调用机制,可以以各种方式设计你自己的模块。
|
||||
框架主要用途为 HTTP 服务器,机器人搭建框架。尤其对于聊天机器人消息处理较为方便和全面,提供了众多会话机制和内部调用机制,可以以各种方式设计你自己的插件。
|
||||
|
||||
```php
|
||||
/**
|
||||
* @CQCommand("你好")
|
||||
*/
|
||||
#[\BotCommand('你好')]
|
||||
public function hello() {
|
||||
ctx()->reply("你好,我是炸毛!"); // 简单的命令式回复
|
||||
}
|
||||
/**
|
||||
* @RequestMapping("/index")
|
||||
*/
|
||||
#[\Route('/index')]
|
||||
public function index() {
|
||||
return "<h1>hello!</h1>"; // 快速的 HTTP 服务开发
|
||||
}
|
||||
```
|
||||
|
||||
> 从 2.7.0 版本开始,框架已支持同时使用 Annotation 和原生 Attribute 注解,供开发者根据需要自由选用。
|
||||
|
||||
## 开始
|
||||
|
||||
如果你是初学者,可以直接使用以下脚本部署 PHP 环境和安装框架的脚手架:
|
||||
框架目前支持 Linux、WSL、macOS 环境直接运行,上述环境可直接使用下方一键安装脚本。
|
||||
|
||||
> 如果你想在其他环境安装部署,可使用 Docker、Cygwin,详见文档。
|
||||
|
||||
```bash
|
||||
# 新建一个自己喜欢名字的文件夹,运行一键安装脚本 (仅限 x86-64(AMD64) 和 AArch64(ARM64) 平台)
|
||||
mkdir zhamao-app/
|
||||
cd zhamao-app/
|
||||
# 默认安装的 PHP 版本为 7.4,如需使用其他版本,请设置环境变量 ZM_DOWN_PHP_VERSION 为对应的 PHP 版本,例如:
|
||||
# export ZM_DOWN_PHP_VERSION=8.1
|
||||
bash -c "$(curl -fsSL https://api.zhamao.xin/go.sh)"
|
||||
# 检测PHP环境、安装框架
|
||||
bash <(curl -fsSL https://zhamao.xin/go.sh)
|
||||
|
||||
# 启动
|
||||
./zhamao server:start
|
||||
# 启动框架
|
||||
cd zhamao-app
|
||||
./zhamao server
|
||||
```
|
||||
|
||||
一键安装脚本还有可以自定义参数的方式,比如:
|
||||
|
||||
```bash
|
||||
# 脚本默认会检测系统的PHP,如果想直接跳过检测,安装独立的PHP版本,则添加此环境变量
|
||||
export ZM_NO_LOCAL_PHP="yes"
|
||||
# 脚本如果安装独立版本PHP,默认版本为8.0,如果想使用其他版本,则添加此环境变量指定版本
|
||||
export ZM_DOWN_PHP_VERSION="8.1"
|
||||
# 脚本默认会将框架在当前目录下的 `zhamao-app` 目录进行安装,如果想使用其他目录,则添加此环境变量
|
||||
export ZM_CUSTOM_DIR="my-custom-app"
|
||||
# 脚本默认会对本项目使用阿里云国内加速镜像,如果想使用packagist源,则添加此环境变量
|
||||
export ZM_COMPOSER_PACKAGIST="yes"
|
||||
# 执行完前面的环境变量再执行一键安装脚本,就可以实现自定义参数!
|
||||
bash <(curl -fsSL https://zhamao.xin/go.sh)
|
||||
```
|
||||
|
||||
关于其他安装方式,请参阅[文档](https://framework.zhamao.xin/guide/installation.html) 。
|
||||
@@ -71,22 +107,20 @@ bash -c "$(curl -fsSL https://api.zhamao.xin/go.sh)"
|
||||
## 特点
|
||||
|
||||
- 原生支持多个机器人客户端同时连接
|
||||
- 使用 Swoole 多工作进程机制和协程加持,尽可能简单的情况下提升了性能
|
||||
- 灵活的注解事件绑定机制,可同时使用 Annotation 和原生 Attribute 注解
|
||||
- 易用的上下文,模块内随处可用
|
||||
- 采用模块化编写,可自由搭配其他 Composer 组件,也可单文件面向过程编写
|
||||
- 完善的插件系统,可编写插件后打包或分发,供他人使用
|
||||
- 采用插件化编写,可自由搭配其他 Composer 组件,也可单文件面向过程编写
|
||||
- 支持模块打包、热加载,分享模块更方便
|
||||
- 常驻内存,全局缓存变量随处使用,提供多种缓存方案
|
||||
- 自带 MySQL、Redis 等数据库连接池等数据库连接方案
|
||||
- 自带 MySQL、SQLite、Redis 等数据库连接池
|
||||
- 本身为 HTTP 服务器、WebSocket 服务器,可以构建属于自己的 HTTP API 接口
|
||||
- 静态文件服务器,可将前端合并到一起
|
||||
- 自带 PHP + Swoole 环境,无需手动编译安装,by [crazywhalecc/static-php-cli](https://github.com/crazywhalecc/static-php-cli)
|
||||
- 自带 PHP 环境,无需手动编译安装,by [crazywhalecc/static-php-cli](https://github.com/crazywhalecc/static-php-cli)
|
||||
|
||||
## 下载源码
|
||||
|
||||
框架源码可直接克隆本仓库进行编辑,如果你在国内,访问 GitHub 和克隆仓库比较慢,可以将 `github.com` 替换为 `fgit.zhamao.me` 进行加速。
|
||||
|
||||
例如:`git clone https://fgit.zhamao.me/zhamao-robot/zhamao-framework.git --depth 1`。
|
||||
例如:`git clone https://hub.fastgit.xyz/zhamao-robot/zhamao-framework.git --depth 1`。
|
||||
|
||||
## 贡献和捐赠
|
||||
|
||||
@@ -110,12 +144,12 @@ bash -c "$(curl -fsSL https://api.zhamao.xin/go.sh)"
|
||||
|
||||
作者的炸毛机器人已从2018年初起稳定运行了**四年半**,并且持续迭代。
|
||||
|
||||
欢迎随时在 HTTP-API 插件群里提问,当然更好的话可以加作者 QQ([627577391](http://wpa.qq.com/msgrd?v=3&uin=627577391&site=qq&menu=yes))
|
||||
可以加作者 QQ([627577391](http://wpa.qq.com/msgrd?v=3&uin=627577391&site=qq&menu=yes))
|
||||
或提交 [Issue](https://github.com/zhamao-robot/zhamao-framework/issues/new/choose) 进行疑难解答。
|
||||
|
||||
本项目在更新内容时,请及时关注 GitHub 动态,更新前请将自己的模块代码做好备份。
|
||||
本项目在更新内容时,请及时关注 GitHub 动态,更新前请将自己的插件或项目代码做好备份。
|
||||
|
||||
项目框架采用 Apache-2.0 协议开源,在分发或重写修改等操作时需遵守协议。项目模块部分(`Module` 文件夹) 在非借鉴框架内代码时可不遵守 Apache-2.0 协议进行分发和修改(声明版权)。
|
||||
项目框架采用 Apache-2.0 协议开源,在分发或重写修改等操作时需遵守协议。项目插件部分(除 `src/Globals`、`src/ZM` 文件夹外的其他文件夹) 在非借鉴框架内代码时可不遵守 Apache-2.0 协议进行分发和修改(声明版权)。
|
||||
|
||||
**注意**:在你使用 mirai 等 `AGPL-3.0` 协议的机器人软件与框架连接时,使用本框架需要将你编写或修改的部分使用 `AGPL-3.0` 协议重新分发。
|
||||
|
||||
@@ -125,6 +159,6 @@ bash -c "$(curl -fsSL https://api.zhamao.xin/go.sh)"
|
||||
|
||||
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/PhpStorm.svg" width="300">
|
||||
|
||||
感谢 [php-libonebot](https://github.com/botuniverse/php-libonebot) 开发者 @sunxyw 中为项目开发规范化提出的一些建议。
|
||||
感谢开发者 @sunxyw 中为项目开发规范化提出的一些建议。
|
||||
|
||||
<!--  -->
|
||||

|
||||
|
||||
69
bin/gendoc
69
bin/gendoc
@@ -5,7 +5,6 @@
|
||||
* 决定是否忽略该类
|
||||
*
|
||||
* @param ReflectionClass $class 准备生成的类的反射类
|
||||
* @return bool
|
||||
*/
|
||||
function should_ignore_class(ReflectionClass $class): bool
|
||||
{
|
||||
@@ -70,7 +69,7 @@ if (file_exists($root . '/vendor/jasny/phpdoc-parser/composer.json')) {
|
||||
foreach ($composers as $composer) {
|
||||
if (check_composer_executable($composer)) {
|
||||
echo '正在使用 ' . $composer . ' 安装 PHPDoc 解析库,请稍候...' . PHP_EOL;
|
||||
passthru("$composer require --quiet jasny/phpdoc-parser", $exit_code);
|
||||
passthru("{$composer} require --quiet jasny/phpdoc-parser", $exit_code);
|
||||
if ($exit_code === 0) {
|
||||
$phpdoc_package_temp_installed = true;
|
||||
break;
|
||||
@@ -83,6 +82,20 @@ if (file_exists($root . '/vendor/jasny/phpdoc-parser/composer.json')) {
|
||||
}
|
||||
}
|
||||
|
||||
function remove_temp_phpdoc_package()
|
||||
{
|
||||
if ($GLOBALS['phpdoc_package_temp_installed']) {
|
||||
echo '正在移除 PHPDoc 解析库,请稍候...' . PHP_EOL;
|
||||
passthru('composer remove --quiet jasny/phpdoc-parser', $exit_code);
|
||||
if ($exit_code !== 0) {
|
||||
echo '移除失败,请手动移除:composer remove jasny/phpdoc-parser' . PHP_EOL;
|
||||
}
|
||||
echo '移除完成';
|
||||
}
|
||||
}
|
||||
|
||||
register_shutdown_function('remove_temp_phpdoc_package');
|
||||
|
||||
// 从这里开始是主要生成逻辑
|
||||
|
||||
require_once $root . '/vendor/autoload.php';
|
||||
@@ -90,16 +103,17 @@ require_once $root . '/vendor/autoload.php';
|
||||
use Jasny\PhpdocParser\PhpdocParser;
|
||||
use Jasny\PhpdocParser\Set\PhpDocumentor;
|
||||
use Jasny\PhpdocParser\Tag\Summery;
|
||||
use ZM\Console\Console;
|
||||
use ZM\Logger\ConsoleLogger;
|
||||
|
||||
$opts = getopt('', ['show-warnings', 'show-debug']);
|
||||
|
||||
$opts = getopt('', ['show-warnings']);
|
||||
if (array_key_exists('show-warnings', $opts)) {
|
||||
$show_warnings = true;
|
||||
} else {
|
||||
$show_warnings = false;
|
||||
}
|
||||
|
||||
Console::init(2);
|
||||
ob_logger_register(new ConsoleLogger(array_key_exists('show-debug', $opts) ? 'debug' : 'info'));
|
||||
|
||||
$errors = [];
|
||||
$warnings = [];
|
||||
@@ -120,7 +134,7 @@ function error(string $message)
|
||||
{
|
||||
global $errors;
|
||||
$errors[] = $message;
|
||||
Console::error($message);
|
||||
logger()->error($message);
|
||||
}
|
||||
|
||||
function warning(string $message)
|
||||
@@ -128,7 +142,7 @@ function warning(string $message)
|
||||
global $warnings, $show_warnings;
|
||||
$warnings[] = $message;
|
||||
if ($show_warnings) {
|
||||
Console::warning($message);
|
||||
logger()->warning($message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +174,7 @@ function get_class_metas(string $class_name, PhpdocParser $parser): array
|
||||
continue;
|
||||
}
|
||||
|
||||
Console::verbose('正在解析方法:' . $class_name . '::' . $method->getName());
|
||||
logger()->debug('正在解析方法:' . $class_name . '::' . $method->getName());
|
||||
|
||||
// 获取方法的注释并解析
|
||||
$doc = $method->getDocComment();
|
||||
@@ -169,6 +183,8 @@ function get_class_metas(string $class_name, PhpdocParser $parser): array
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
// 解析器对于多余空格的解析似乎有问题,这里去除一下多余的空格
|
||||
$doc = preg_replace('/\s(?=\s)/', '\\1', $doc);
|
||||
$meta = $parser->parse($doc);
|
||||
} catch (\Exception $e) {
|
||||
error('解析失败:' . $class_name . '::' . $method->getName() . ',' . $e->getMessage());
|
||||
@@ -264,6 +280,7 @@ function convert_meta_to_markdown(string $method, array $meta): string
|
||||
foreach ($meta['params'] as $param_name => $param_meta) {
|
||||
$markdown .= '| ' . $param_name . ' | ' . $param_meta['type'] . ' | ' . $param_meta['description'] . ' |' . "\n";
|
||||
}
|
||||
$markdown .= "\n";
|
||||
}
|
||||
|
||||
// 返回值
|
||||
@@ -284,7 +301,7 @@ function generate_sidebar_config(string $title, array $items): array
|
||||
];
|
||||
}
|
||||
|
||||
Console::info('开始生成!');
|
||||
logger()->info('开始生成!');
|
||||
|
||||
// 遍历类并将元数据添加至数组中
|
||||
foreach (new \RecursiveIteratorIterator($fs) as $file) {
|
||||
@@ -296,12 +313,16 @@ foreach (new \RecursiveIteratorIterator($fs) as $file) {
|
||||
// 过滤不包含类的文件
|
||||
$tokens = token_get_all(file_get_contents($path));
|
||||
$found = false;
|
||||
foreach ($tokens as $token) {
|
||||
foreach ($tokens as $k => $token) {
|
||||
if (!is_array($token)) {
|
||||
continue;
|
||||
}
|
||||
if ($token[0] === T_CLASS) {
|
||||
if ($token[0] === T_CLASS && $tokens[$k - 2][0] !== T_NEW) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
if ($k >= 100) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
@@ -309,9 +330,9 @@ foreach (new \RecursiveIteratorIterator($fs) as $file) {
|
||||
}
|
||||
|
||||
// 获取完整类名
|
||||
$path = ltrim($path, $root . '/');
|
||||
$path = str_replace($root . '/', '', $path);
|
||||
$class = str_replace(['.php', 'src/', '/'], ['', '', '\\'], $path);
|
||||
Console::verbose('正在解析类:' . $class);
|
||||
logger()->debug('正在解析类:' . $class);
|
||||
$meta = get_class_metas($class, $parser);
|
||||
// 忽略不包含任何方法的类
|
||||
if (empty($meta)) {
|
||||
@@ -341,7 +362,7 @@ foreach ($markdown as $class => $methods) {
|
||||
if (!file_exists(dirname($file)) && !mkdir($concurrent_directory = dirname($file), 0777, true) && !is_dir($concurrent_directory)) {
|
||||
throw new \RuntimeException(sprintf('无法建立目录 %s', $concurrent_directory));
|
||||
}
|
||||
Console::verbose('正在生成文档:' . $file);
|
||||
logger()->debug('正在生成文档:' . $file);
|
||||
$text = implode("\n\n", $methods);
|
||||
file_put_contents($file, $text);
|
||||
}
|
||||
@@ -368,29 +389,21 @@ $file = $root . '/docs/.vuepress/api.js';
|
||||
file_put_contents($file, $config);
|
||||
|
||||
if (count($warnings)) {
|
||||
Console::warning('生成过程中发现 ' . count($warnings) . ' 次警告');
|
||||
logger()->warning('生成过程中发现 ' . count($warnings) . ' 次警告');
|
||||
if (!$show_warnings) {
|
||||
Console::info('生成器默认忽略了警告,你可以通过 gendoc --show-warnings 来查看警告');
|
||||
logger()->info('生成器默认忽略了警告,你可以通过 gendoc --show-warnings 来查看警告');
|
||||
}
|
||||
}
|
||||
if (count($errors)) {
|
||||
Console::error('生成过程中发现错误:');
|
||||
logger()->error('生成过程中发现错误:');
|
||||
foreach ($errors as $error) {
|
||||
Console::error($error);
|
||||
logger()->error($error);
|
||||
}
|
||||
}
|
||||
|
||||
Console::success('API 文档生成完毕');
|
||||
Console::success(sprintf('共生成 %d 个类,共 %d 个方法', $class_count, $method_count));
|
||||
logger()->notice('API 文档生成完毕');
|
||||
logger()->notice(sprintf('共生成 %d 个类,共 %d 个方法', $class_count, $method_count));
|
||||
|
||||
// 完成生成,进行善后
|
||||
|
||||
if ($phpdoc_package_temp_installed) {
|
||||
echo '正在移除 PHPDoc 解析库,请稍候...' . PHP_EOL;
|
||||
passthru('composer remove --quiet jasny/phpdoc-parser', $exit_code);
|
||||
if ($exit_code !== 0) {
|
||||
echo '移除失败,请手动移除:composer remove jasny/phpdoc-parser' . PHP_EOL;
|
||||
}
|
||||
echo '移除完成';
|
||||
}
|
||||
exit(0);
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Copyright: Swlib
|
||||
* Author: Twosee <twose@qq.com>
|
||||
* Date: 2018/4/14 下午10:58
|
||||
*/
|
||||
|
||||
use Swoole\Coroutine;
|
||||
|
||||
Coroutine::set([
|
||||
'log_level' => SWOOLE_LOG_INFO,
|
||||
'trace_flags' => 0
|
||||
]);
|
||||
|
||||
if (!ini_get('date.timezone')) {
|
||||
ini_set('date.timezone', 'Asia/Shanghai');
|
||||
}
|
||||
|
||||
foreach ([
|
||||
__DIR__ . '/../../../autoload.php',
|
||||
__DIR__ . '/../../autoload.php',
|
||||
__DIR__ . '/../vendor/autoload.php',
|
||||
__DIR__ . '/vendor/autoload.php'
|
||||
] as $file
|
||||
) {
|
||||
if (file_exists($file)) {
|
||||
define('PHPUNIT_COMPOSER_INSTALL', $file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
|
||||
fwrite(
|
||||
STDERR,
|
||||
'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
|
||||
' composer install' . PHP_EOL . PHP_EOL .
|
||||
'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
|
||||
);
|
||||
|
||||
die(1);
|
||||
} else {
|
||||
if (array_reverse(explode('/', __DIR__))[0] ?? '' === 'test') {
|
||||
$vendor_dir = dirname(PHPUNIT_COMPOSER_INSTALL);
|
||||
$bin_unit = "{$vendor_dir}/bin/phpunit";
|
||||
$unit_uint = "{$vendor_dir}/phpunit/phpunit/phpunit";
|
||||
if (file_exists($bin_unit)) {
|
||||
@unlink($bin_unit);
|
||||
@symlink(__FILE__, $bin_unit);
|
||||
}
|
||||
if (file_exists($unit_uint)) {
|
||||
@unlink($unit_uint);
|
||||
@symlink(__FILE__, $unit_uint);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require PHPUNIT_COMPOSER_INSTALL;
|
||||
$starttime = microtime(true);
|
||||
go(function () {
|
||||
try {
|
||||
require_once __DIR__.'/../test/bootstrap.php';
|
||||
PHPUnit\TextUI\Command::main(false);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
});
|
||||
Swoole\Event::wait();
|
||||
echo "Took " . round(microtime(true) - $starttime, 4) . "s\n";
|
||||
65
bin/phpunit-zm
Executable file
65
bin/phpunit-zm
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/** For Swoole coroutine tests */
|
||||
|
||||
// 如果改成 true,则会在终端显示所有炸毛框架的 Log
|
||||
const ZM_TEST_LOG_DEBUG = false;
|
||||
|
||||
use OneBot\Driver\Event\Process\WorkerStartEvent;
|
||||
use PHPUnit\TextUI\Command;
|
||||
use Swoole\Atomic;
|
||||
use Tests\ZMResultPrinter;
|
||||
use ZM\Command\Server\ServerStartCommand;
|
||||
use ZM\Event\EventProvider;
|
||||
use ZM\Framework;
|
||||
use ZM\Logger\ConsoleLogger;
|
||||
use ZM\Store\MockAtomic;
|
||||
|
||||
// 引入自动加载
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
// 声明一个全局的原子计数,用于保存整个进程的退出状态码
|
||||
global $_swoole_atomic;
|
||||
// Windows 没有 Swoole,所以就使用了一个假的原子计数器,反正 Windows 只有单进程
|
||||
$_swoole_atomic = class_exists('\\Swoole\\Atomic') ? new Atomic() : new MockAtomic();
|
||||
|
||||
// 注册 Logger 等级
|
||||
ob_logger_register(new ConsoleLogger(ZM_TEST_LOG_DEBUG ? 'debug' : 'error'));
|
||||
|
||||
// 使用框架自身的 EventProvider
|
||||
global $ob_event_provider;
|
||||
$ob_event_provider = new EventProvider();
|
||||
|
||||
// 注册一个最低级别的 WorkerStart 事件,用于在框架的事件初始化之后开始运行 PHPUnit
|
||||
ob_event_provider()->addEventListener(WorkerStartEvent::getName(), function () {
|
||||
register_shutdown_function(function () {
|
||||
$error = error_get_last();
|
||||
// 下面这段代码的作用就是,不是错误引发的退出时照常退出即可
|
||||
if (($error['type'] ?? 0) != 0) {
|
||||
logger()->emergency(zm_internal_errcode('E00027') . 'Internal fatal error: ' . $error['message'] . ' at ' . $error['file'] . "({$error['line']})");
|
||||
}
|
||||
Framework::getInstance()->stop();
|
||||
});
|
||||
$_SERVER['argv'][] = '--printer';
|
||||
$_SERVER['argv'][] = ZMResultPrinter::class;
|
||||
try {
|
||||
// 不退出,而是返回 code
|
||||
$retcode = Command::main(false);
|
||||
} finally {
|
||||
global $_swoole_atomic;
|
||||
$_swoole_atomic->set($retcode ?? 0);
|
||||
Framework::getInstance()->stop($retcode ?? 0);
|
||||
}
|
||||
}, 1);
|
||||
|
||||
try {
|
||||
$options = ServerStartCommand::exportOptionArray();
|
||||
$options['driver'] = 'workerman';
|
||||
$options['worker-num'] = 1;
|
||||
$options['private-mode'] = true;
|
||||
(new Framework($options))->init()->start();
|
||||
exit($_swoole_atomic->get());
|
||||
} catch (Throwable $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
3
bin/phpunit-zm.bat
Normal file
3
bin/phpunit-zm.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
|
||||
php %~dp0phpunit-zm %*
|
||||
@@ -5,7 +5,10 @@
|
||||
# author: crazywhalecc
|
||||
# since: 2.5.0
|
||||
|
||||
if [ -f "$(pwd)/runtime/php" ]; then
|
||||
if [ "$ZM_CUSTOM_PHP_PATH" != "" ]; then
|
||||
echo "* Using PHP executable: ""$ZM_CUSTOM_PHP_PATH"
|
||||
executable="$ZM_CUSTOM_PHP_PATH"
|
||||
elif [ -f "$(pwd)/runtime/php" ]; then
|
||||
executable="$(pwd)/runtime/php"
|
||||
echo "* Framework started with built-in php."
|
||||
else
|
||||
104
composer.json
104
composer.json
@@ -1,56 +1,44 @@
|
||||
{
|
||||
"name": "zhamao/framework",
|
||||
"description": "High performance chat robot and web server development framework",
|
||||
"minimum-stability": "stable",
|
||||
"license": "Apache-2.0",
|
||||
"extra": {
|
||||
"zm": {
|
||||
"exclude-annotation-path": [
|
||||
"src/ZM"
|
||||
]
|
||||
},
|
||||
"hooks": {
|
||||
"post-merge": "composer install",
|
||||
"pre-commit": [
|
||||
"echo committing as $(git config user.name)",
|
||||
"./vendor/bin/php-cs-fixer fix --dry-run --diff ./src"
|
||||
],
|
||||
"pre-push": [
|
||||
"./vendor/bin/php-cs-fixer fix --dry-run --diff ./src",
|
||||
"composer analyse"
|
||||
]
|
||||
}
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "jerry",
|
||||
"email": "admin@zhamao.me"
|
||||
},
|
||||
{
|
||||
"name": "sunxyw",
|
||||
"email": "dev@sunxyw.xyz"
|
||||
}
|
||||
],
|
||||
"prefer-stable": true,
|
||||
"bin": [
|
||||
"bin/start",
|
||||
"bin/phpunit-swoole",
|
||||
"bin/gendoc"
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2 || ^7.3 || ^7.4 || ^8.0 || ^8.1",
|
||||
"php": "^8.0 || ^8.1",
|
||||
"ext-json": "*",
|
||||
"ext-posix": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"doctrine/dbal": "^2.13.1",
|
||||
"dragonmantank/cron-expression": "^3.3",
|
||||
"jelix/version": "^2.0",
|
||||
"koriym/attributes": "^1.0",
|
||||
"psy/psysh": "^0.11.2",
|
||||
"symfony/console": "~5.0 || ~4.0 || ~3.0",
|
||||
"onebot/libonebot": "dev-develop",
|
||||
"psr/container": "^2.0",
|
||||
"psy/psysh": "^0.11.8",
|
||||
"symfony/console": "^6.0",
|
||||
"symfony/polyfill-ctype": "^1.19",
|
||||
"symfony/polyfill-mbstring": "^1.19",
|
||||
"symfony/polyfill-php80": "^1.16",
|
||||
"symfony/routing": "~5.0 || ~4.0 || ~3.0",
|
||||
"zhamao/config": "^1.0",
|
||||
"zhamao/connection-manager": "^1.0",
|
||||
"zhamao/console": "^1.0",
|
||||
"zhamao/request": "^1.1"
|
||||
"symfony/routing": "~6.0 || ~5.0 || ~4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"brainmaestro/composer-git-hooks": "^3.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.2 != 3.7.0",
|
||||
"jetbrains/phpstorm-attributes": "^1.0",
|
||||
"phpstan/extension-installer": "^1.1",
|
||||
"phpstan/phpstan": "^1.1",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-phpunit": "^1.1",
|
||||
"phpunit/phpunit": "^8.5 || ^9.0",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"swoole/ide-helper": "^4.5"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "Use C/C++ extension instead of polyfill will be more efficient",
|
||||
@@ -59,36 +47,60 @@
|
||||
"ext-redis": "If you use Redis in framework, you will need this extension",
|
||||
"league/climate": "Display columns and status in terminal"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ZM\\": "src/ZM"
|
||||
},
|
||||
"files": [
|
||||
"src/ZM/global_functions.php"
|
||||
"src/Globals/global_functions.php",
|
||||
"src/Globals/global_defines_app.php",
|
||||
"src/Globals/global_class_alias.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Module\\": "src/Module",
|
||||
"Custom\\": "src/Custom"
|
||||
"Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"bin": [
|
||||
"bin/gendoc",
|
||||
"bin/phpunit-zm",
|
||||
"bin/zhamao"
|
||||
],
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"phpstan/extension-installer": true
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"brainmaestro/composer-git-hooks": "^2.8",
|
||||
"friendsofphp/php-cs-fixer": "^3.2 != 3.7.0",
|
||||
"phpstan/phpstan": "^1.1",
|
||||
"phpunit/phpunit": "^8.5 || ^9.0",
|
||||
"swoole/ide-helper": "^4.5"
|
||||
"extra": {
|
||||
"hooks": {
|
||||
"post-merge": "composer install",
|
||||
"pre-commit": [
|
||||
"echo committing as $(git config user.name)",
|
||||
"composer cs-fix -- --diff"
|
||||
],
|
||||
"pre-push": [
|
||||
"composer cs-fix -- --dry-run --diff",
|
||||
"composer analyse"
|
||||
]
|
||||
},
|
||||
"zm": {
|
||||
"exclude-annotation-path": [
|
||||
"src/ZM",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/cghooks add"
|
||||
],
|
||||
"analyse": "phpstan analyse --memory-limit 300M -l 0 ./src",
|
||||
"cs-fix": "php-cs-fixer fix $1"
|
||||
"analyse": "phpstan analyse --memory-limit 300M",
|
||||
"cs-fix": "php-cs-fixer fix",
|
||||
"test": "bin/phpunit-zm --no-coverage"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,152 +1,110 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/* bind host */
|
||||
$config['host'] = '0.0.0.0';
|
||||
/* 启动框架的底层驱动(原生支持 swoole、workerman 两种) */
|
||||
$config['driver'] = 'workerman';
|
||||
|
||||
/* bind port */
|
||||
$config['port'] = 20001;
|
||||
|
||||
/* 框架开到公网或外部的HTTP访问链接,通过 DataProvider::getFrameworkLink() 获取 */
|
||||
$config['http_reverse_link'] = 'http://127.0.0.1:' . $config['port'];
|
||||
|
||||
/* 框架是否启动debug模式,当debug模式为true时,启用热更新(需要安装inotify扩展) */
|
||||
$config['debug_mode'] = false;
|
||||
|
||||
/* 存放框架内文件数据的目录 */
|
||||
$config['zm_data'] = realpath(WORKING_DIR) . '/zm_data/';
|
||||
|
||||
/* 存放各个模块配置文件的目录 */
|
||||
$config['config_dir'] = $config['zm_data'] . 'config/';
|
||||
|
||||
/* 存放崩溃和运行日志的目录 */
|
||||
$config['crash_dir'] = $config['zm_data'] . 'crash/';
|
||||
|
||||
/* 对应swoole的server->set参数 */
|
||||
$config['swoole'] = [
|
||||
'log_file' => $config['crash_dir'] . 'swoole_error.log',
|
||||
// 'worker_num' => swoole_cpu_num(), //如果你只有一个 OneBot 实例连接到框架并且代码没有复杂的CPU密集计算,则可把这里改为1使用全局变量
|
||||
'dispatch_mode' => 2, // 包分配原则,见 https://wiki.swoole.com/#/server/setting?id=dispatch_mode
|
||||
'max_coroutine' => 300000,
|
||||
'max_wait_time' => 5,
|
||||
// 'task_worker_num' => 4,
|
||||
// 'task_enable_coroutine' => true
|
||||
/* 要启动的服务器监听端口及协议 */
|
||||
$config['servers'] = [
|
||||
[
|
||||
'host' => '0.0.0.0',
|
||||
'port' => 20001,
|
||||
'type' => 'websocket',
|
||||
],
|
||||
[
|
||||
'host' => '0.0.0.0',
|
||||
'port' => 20002,
|
||||
'type' => 'http',
|
||||
'flag' => 20002,
|
||||
],
|
||||
[
|
||||
'host' => '0.0.0.0',
|
||||
'port' => 20003,
|
||||
'type' => 'http',
|
||||
'flag' => 20003,
|
||||
],
|
||||
];
|
||||
|
||||
/* 一些框架与框架运行时设置的调整 */
|
||||
/* Workerman 驱动相关配置 */
|
||||
$config['workerman_options'] = [
|
||||
'worker_num' => 1, // 如果你只有一个 OneBot 实例连接到框架并且代码没有复杂的CPU密集计算,则可把这里改为1使用全局变量
|
||||
];
|
||||
|
||||
/* Swoole 驱动相关配置 */
|
||||
$config['swoole_options'] = [
|
||||
'coroutine_hook_flags' => SWOOLE_HOOK_ALL & (~SWOOLE_HOOK_CURL), // 协程 Hook 内容
|
||||
'swoole_set' => [
|
||||
'worker_num' => 1, // 如果你只有一个 OneBot 实例连接到框架并且代码没有复杂的CPU密集计算,则可把这里改为1使用全局变量
|
||||
'dispatch_mode' => 2, // 包分配原则,见 https://wiki.swoole.com/#/server/setting?id=dispatch_mode
|
||||
'max_coroutine' => 300000, // 允许最大的协程数
|
||||
'max_wait_time' => 5, // 安全退出模式下允许等待 Worker 的最长秒数
|
||||
// 'task_worker_num' => 4, // 启动 TaskWorker 进程的数量(默认不启动)
|
||||
// 'task_enable_coroutine' => true // TaskWorker 是否开启协程
|
||||
],
|
||||
'swoole_server_mode' => SWOOLE_PROCESS, // Swoole Server 启动模式,默认为 SWOOLE_PROCESS
|
||||
];
|
||||
|
||||
/* 默认存取炸毛数据的目录(相对目录时,代表WORKING_DIR下的目录,绝对目录按照绝对目录来) */
|
||||
$config['data_dir'] = 'zm_data';
|
||||
|
||||
/* 框架本体运行时的一些可调配置 */
|
||||
$config['runtime'] = [
|
||||
'swoole_coroutine_hook_flags' => SWOOLE_HOOK_ALL & (~SWOOLE_HOOK_CURL),
|
||||
'swoole_server_mode' => SWOOLE_PROCESS,
|
||||
'middleware_error_policy' => 1,
|
||||
'reload_delay_time' => 800,
|
||||
'global_middleware_binding' => [],
|
||||
'save_console_log_file' => false, // 改为目标路径,则将 Console 输出的日志保存到文件
|
||||
'annotation_reader_ignore' => [ // 设置注解解析器忽略的注解名或命名空间,防止解析到不该解析的
|
||||
'name' => [
|
||||
'mixin',
|
||||
],
|
||||
'namespace' => [],
|
||||
],
|
||||
'timezone' => 'Asia/Shanghai',
|
||||
];
|
||||
|
||||
/* 轻量字符串缓存,默认开启 */
|
||||
$config['light_cache'] = [
|
||||
'size' => 512, // 最多允许储存的条数(需要2的倍数)
|
||||
'max_strlen' => 32768, // 单行字符串最大长度(需要2的倍数)
|
||||
'hash_conflict_proportion' => 0.6, // Hash冲突率(越大越好,但是需要的内存更多)
|
||||
'persistence_path' => $config['zm_data'] . '_cache.json',
|
||||
'auto_save_interval' => 900,
|
||||
];
|
||||
|
||||
/* 大容量跨进程变量存储(2.2.0可用) */
|
||||
$config['worker_cache'] = [
|
||||
'worker' => 0,
|
||||
'transaction_timeout' => 30000,
|
||||
];
|
||||
|
||||
/* MySQL数据库连接信息,host留空则启动时不创建sql连接池 */
|
||||
$config['mysql_config'] = [
|
||||
'host' => '',
|
||||
'port' => 3306,
|
||||
'unix_socket' => null,
|
||||
'username' => 'root',
|
||||
'password' => '123456',
|
||||
'dbname' => '',
|
||||
'charset' => 'utf8mb4',
|
||||
'pool_size' => 64,
|
||||
'options' => [
|
||||
PDO::ATTR_STRINGIFY_FETCHES => false,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
],
|
||||
];
|
||||
|
||||
/* Redis连接信息,host留空则启动时不创建Redis连接池 */
|
||||
$config['redis_config'] = [
|
||||
'host' => '',
|
||||
'port' => 6379,
|
||||
'timeout' => 1,
|
||||
'db_index' => 0,
|
||||
'auth' => '',
|
||||
];
|
||||
|
||||
/* onebot连接约定的token */
|
||||
$config['access_token'] = '';
|
||||
|
||||
/* HTTP服务器固定请求头的返回 */
|
||||
$config['http_header'] = [
|
||||
'Server' => 'zhamao-framework',
|
||||
'Content-Type' => 'text/html; charset=utf-8',
|
||||
];
|
||||
|
||||
/* HTTP服务器在指定状态码下回复的页面(默认) */
|
||||
$config['http_default_code_page'] = [
|
||||
'404' => '404.html',
|
||||
];
|
||||
|
||||
/* zhamao-framework在框架启动时初始化的atomic们 */
|
||||
$config['init_atomics'] = [
|
||||
// 'custom_atomic_name' => 0, //自定义添加的Atomic
|
||||
];
|
||||
|
||||
/* 终端日志显示等级(0-4) */
|
||||
$config['info_level'] = 2;
|
||||
|
||||
/* 上下文接口类 implemented from ContextInterface */
|
||||
$config['context_class'] = \ZM\Context\Context::class;
|
||||
|
||||
/* 静态文件访问 */
|
||||
$config['static_file_server'] = [
|
||||
'status' => false,
|
||||
'document_root' => realpath(__DIR__ . '/../') . '/resources/html',
|
||||
'document_index' => [
|
||||
'index.html',
|
||||
/* 允许加载插件形式 */
|
||||
$config['plugin'] = [
|
||||
'enable' => true,
|
||||
'load_dir' => 'plugins',
|
||||
];
|
||||
|
||||
/* 内部默认启用的插件 */
|
||||
$config['native_plugin'] = [
|
||||
'onebot12' => true, // OneBot v12 协议支持
|
||||
'onebot12-ban-other-ws' => true, // OneBot v12 协议支持,禁止其他 WebSocket 连接
|
||||
];
|
||||
|
||||
/* 静态文件读取器 */
|
||||
$config['file_server'] = [
|
||||
'enable' => true,
|
||||
'document_root' => $config['data_dir'] . '/public/',
|
||||
'document_index' => 'index.html',
|
||||
'document_code_page' => [
|
||||
'404' => '404.html',
|
||||
'500' => '500.html',
|
||||
],
|
||||
];
|
||||
|
||||
/* 机器人解析模块,关闭后无法使用如CQCommand等注解(上面的modules即将废弃) */
|
||||
$config['onebot'] = [
|
||||
'status' => true,
|
||||
'single_bot_mode' => false,
|
||||
'message_level' => 99,
|
||||
'message_convert_string' => true,
|
||||
'message_command_policy' => 'interrupt',
|
||||
];
|
||||
|
||||
/* 一个远程简易终端,使用nc直接连接即可,但是不建议开放host为0.0.0.0(远程连接) */
|
||||
$config['remote_terminal'] = [
|
||||
'status' => false,
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 20002,
|
||||
'token' => '',
|
||||
];
|
||||
|
||||
/* 模块(插件)加载器的相关设置 */
|
||||
$config['module_loader'] = [
|
||||
'enable_hotload' => false,
|
||||
'load_path' => $config['zm_data'] . 'modules',
|
||||
/* MySQL 和 SQLite3 数据库连接配置,框架将自动生成连接池,支持多个连接池 */
|
||||
$config['database'] = [
|
||||
'sqlite_db1' => [
|
||||
'enable' => false,
|
||||
'type' => 'sqlite',
|
||||
'dbname' => 'a.db',
|
||||
'pool_size' => 10,
|
||||
],
|
||||
'zm' => [
|
||||
'enable' => false,
|
||||
'type' => 'mysql',
|
||||
'host' => '127.0.0.1', // 填写数据库服务器地址后才会创建数据库连接
|
||||
'port' => 3306,
|
||||
'username' => 'root',
|
||||
'password' => 'ZhamaoTEST',
|
||||
'dbname' => 'zm',
|
||||
'charset' => 'utf8mb4',
|
||||
'pool_size' => 64,
|
||||
],
|
||||
];
|
||||
|
||||
return $config;
|
||||
|
||||
152
config/global_old.php
Normal file
152
config/global_old.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/* bind host */
|
||||
$config['host'] = '0.0.0.0';
|
||||
|
||||
/* bind port */
|
||||
$config['port'] = 20001;
|
||||
|
||||
/* 框架开到公网或外部的HTTP访问链接,通过 DataProvider::getFrameworkLink() 获取 */
|
||||
$config['http_reverse_link'] = 'http://127.0.0.1:' . $config['port'];
|
||||
|
||||
/* 框架是否启动debug模式,当debug模式为true时,启用热更新(需要安装inotify扩展) */
|
||||
$config['debug_mode'] = false;
|
||||
|
||||
/* 存放框架内文件数据的目录 */
|
||||
$config['zm_data'] = realpath(WORKING_DIR) . '/zm_data/';
|
||||
|
||||
/* 存放各个模块配置文件的目录 */
|
||||
$config['config_dir'] = $config['zm_data'] . 'config/';
|
||||
|
||||
/* 存放崩溃和运行日志的目录 */
|
||||
$config['crash_dir'] = $config['zm_data'] . 'crash/';
|
||||
|
||||
/* 对应swoole的server->set参数 */
|
||||
$config['swoole'] = [
|
||||
'log_file' => $config['crash_dir'] . 'swoole_error.log',
|
||||
// 'worker_num' => swoole_cpu_num(), //如果你只有一个 OneBot 实例连接到框架并且代码没有复杂的CPU密集计算,则可把这里改为1使用全局变量
|
||||
'dispatch_mode' => 2, // 包分配原则,见 https://wiki.swoole.com/#/server/setting?id=dispatch_mode
|
||||
'max_coroutine' => 300000,
|
||||
'max_wait_time' => 5,
|
||||
// 'task_worker_num' => 4,
|
||||
// 'task_enable_coroutine' => true
|
||||
];
|
||||
|
||||
/* 一些框架与框架运行时设置的调整 */
|
||||
$config['runtime'] = [
|
||||
'swoole_coroutine_hook_flags' => SWOOLE_HOOK_ALL & (~SWOOLE_HOOK_CURL),
|
||||
'swoole_server_mode' => SWOOLE_PROCESS,
|
||||
'middleware_error_policy' => 1,
|
||||
'reload_delay_time' => 800,
|
||||
'global_middleware_binding' => [],
|
||||
'save_console_log_file' => false, // 改为目标路径,则将 Console 输出的日志保存到文件
|
||||
'annotation_reader_ignore' => [ // 设置注解解析器忽略的注解名或命名空间,防止解析到不该解析的
|
||||
'name' => [
|
||||
'mixin',
|
||||
],
|
||||
'namespace' => [],
|
||||
],
|
||||
];
|
||||
|
||||
/* 轻量字符串缓存,默认开启 */
|
||||
$config['light_cache'] = [
|
||||
'size' => 512, // 最多允许储存的条数(需要2的倍数)
|
||||
'max_strlen' => 32768, // 单行字符串最大长度(需要2的倍数)
|
||||
'hash_conflict_proportion' => 0.6, // Hash冲突率(越大越好,但是需要的内存更多)
|
||||
'persistence_path' => $config['zm_data'] . '_cache.json',
|
||||
'auto_save_interval' => 900,
|
||||
];
|
||||
|
||||
/* 大容量跨进程变量存储(2.2.0可用) */
|
||||
$config['worker_cache'] = [
|
||||
'worker' => 0,
|
||||
'transaction_timeout' => 30000,
|
||||
];
|
||||
|
||||
/* MySQL数据库连接信息,host留空则启动时不创建sql连接池 */
|
||||
$config['mysql_config'] = [
|
||||
'host' => '',
|
||||
'port' => 3306,
|
||||
'unix_socket' => null,
|
||||
'username' => 'root',
|
||||
'password' => '123456',
|
||||
'dbname' => '',
|
||||
'charset' => 'utf8mb4',
|
||||
'pool_size' => 64,
|
||||
'options' => [
|
||||
PDO::ATTR_STRINGIFY_FETCHES => false,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
],
|
||||
];
|
||||
|
||||
/* Redis连接信息,host留空则启动时不创建Redis连接池 */
|
||||
$config['redis_config'] = [
|
||||
'host' => '',
|
||||
'port' => 6379,
|
||||
'timeout' => 1,
|
||||
'db_index' => 0,
|
||||
'auth' => '',
|
||||
];
|
||||
|
||||
/* onebot连接约定的token */
|
||||
$config['access_token'] = '';
|
||||
|
||||
/* HTTP服务器固定请求头的返回 */
|
||||
$config['http_header'] = [
|
||||
'Server' => 'zhamao-framework',
|
||||
'Content-Type' => 'text/html; charset=utf-8',
|
||||
];
|
||||
|
||||
/* HTTP服务器在指定状态码下回复的页面(默认) */
|
||||
$config['http_default_code_page'] = [
|
||||
'404' => '404.html',
|
||||
];
|
||||
|
||||
/* zhamao-framework在框架启动时初始化的atomic们 */
|
||||
$config['init_atomics'] = [
|
||||
// 'custom_atomic_name' => 0, //自定义添加的Atomic
|
||||
];
|
||||
|
||||
/* 终端日志显示等级(0-4) */
|
||||
$config['info_level'] = 2;
|
||||
|
||||
/* 上下文接口类 implemented from ContextInterface */
|
||||
$config['context_class'] = \ZM\Context\Context::class;
|
||||
|
||||
/* 静态文件访问 */
|
||||
$config['static_file_server'] = [
|
||||
'status' => false,
|
||||
'document_root' => realpath(__DIR__ . '/../') . '/resources/html',
|
||||
'document_index' => [
|
||||
'index.html',
|
||||
],
|
||||
];
|
||||
|
||||
/* 机器人解析模块,关闭后无法使用如CQCommand等注解(上面的modules即将废弃) */
|
||||
$config['onebot'] = [
|
||||
'status' => true,
|
||||
'single_bot_mode' => false,
|
||||
'message_level' => 99,
|
||||
'message_convert_string' => true,
|
||||
'message_command_policy' => 'interrupt',
|
||||
];
|
||||
|
||||
/* 一个远程简易终端,使用nc直接连接即可,但是不建议开放host为0.0.0.0(远程连接) */
|
||||
$config['remote_terminal'] = [
|
||||
'status' => false,
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 20002,
|
||||
'token' => '',
|
||||
];
|
||||
|
||||
/* 模块(插件)加载器的相关设置 */
|
||||
$config['module_loader'] = [
|
||||
'enable_hotload' => false,
|
||||
'load_path' => $config['zm_data'] . 'modules',
|
||||
];
|
||||
|
||||
return $config;
|
||||
96
docker-compose.yml
Normal file
96
docker-compose.yml
Normal file
@@ -0,0 +1,96 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
bot:
|
||||
build:
|
||||
context: docker/zhamao
|
||||
dockerfile: ./Dockerfile
|
||||
container_name: zhamao-bot
|
||||
depends_on:
|
||||
- database-postgres
|
||||
- database-redis
|
||||
networks:
|
||||
- bot-net
|
||||
ports:
|
||||
- "20001-20005:20001-20005/tcp"
|
||||
volumes:
|
||||
- ".:/bot"
|
||||
|
||||
walle-q:
|
||||
build:
|
||||
context: docker/walle-q
|
||||
dockerfile: ./Dockerfile
|
||||
container_name: zhamao-bot-walle-q
|
||||
depends_on:
|
||||
- bot
|
||||
networks:
|
||||
- bot-net
|
||||
volumes:
|
||||
- "./docker/volumes/walle-q-data:/bot"
|
||||
|
||||
database-postgres:
|
||||
container_name: zhamao-bot-db-postgres
|
||||
env_file:
|
||||
- docker/environment.env
|
||||
image: postgres:14.4-alpine
|
||||
networks:
|
||||
- bot-net
|
||||
ports:
|
||||
- "5432:5432/tcp"
|
||||
restart: always
|
||||
volumes:
|
||||
- "./docker/volumes/postgres-data:/var/lib/postgresql/data"
|
||||
- "./docker/volumes/postgres-init:/docker-entrypoint-initdb.d"
|
||||
|
||||
database-redis:
|
||||
command:
|
||||
- redis-server
|
||||
- --requirepass
|
||||
- "$${REDIS_PASSWORD}"
|
||||
container_name: zhamao-bot-db-redis
|
||||
env_file:
|
||||
- docker/environment.env
|
||||
image: redis:7.0-alpine
|
||||
networks:
|
||||
- bot-net
|
||||
ports:
|
||||
- "6379:6379/tcp"
|
||||
restart: always
|
||||
volumes:
|
||||
- "./docker/volumes/redis-data:/data"
|
||||
|
||||
db-admin-adminer:
|
||||
container_name: zhamao-bot-dbadmin-adminer
|
||||
depends_on:
|
||||
database-postgres:
|
||||
condition: service_started
|
||||
database-redis:
|
||||
condition: service_started
|
||||
env_file:
|
||||
- docker/environment.env
|
||||
image: adminer:latest
|
||||
networks:
|
||||
- bot-net
|
||||
ports:
|
||||
- "15432:8080/tcp"
|
||||
profiles:
|
||||
- with-adminer
|
||||
|
||||
db-admin-redis-insight:
|
||||
container_name: zhamao-bot-dbadmin-redis-insight
|
||||
depends_on:
|
||||
database-postgres:
|
||||
condition: service_started
|
||||
database-redis:
|
||||
condition: service_started
|
||||
image: redislabs/redisinsight:latest
|
||||
networks:
|
||||
- bot-net
|
||||
ports:
|
||||
- "16379:8001/tcp"
|
||||
profiles:
|
||||
- with-adminer
|
||||
|
||||
networks:
|
||||
bot-net:
|
||||
name: bot-net
|
||||
2
docker/.gitignore
vendored
Normal file
2
docker/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/volumes
|
||||
environment.env
|
||||
7
docker/environment.env.example
Normal file
7
docker/environment.env.example
Normal file
@@ -0,0 +1,7 @@
|
||||
REDIS_PASSWORD={{$REDIS_PASSWORD}}
|
||||
|
||||
POSTGRES_USER={{$DB_ROOT_USER}}
|
||||
POSTGRES_PASSWORD={{$DB_ROOT_PASSWORD}}
|
||||
POSTGRES_APPLICATION_USER={{$DB_USER}}
|
||||
POSTGRES_APPLICATION_USER_PASSWORD={{$DB_PASSWORD}}
|
||||
POSTGRES_APPLICATION_DATABASE={{$DB_NAME}}
|
||||
14
docker/walle-q/Dockerfile
Normal file
14
docker/walle-q/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM alpine:latest
|
||||
|
||||
MAINTAINER sunxyw <me@sunxyw.xyz>
|
||||
|
||||
RUN apk add --no-cache curl
|
||||
RUN mkdir -p /bot && \
|
||||
curl -fsSL https://github.com/onebot-walle/walle-q/releases/latest/download/walle-q-i686-linux-musl.tar.gz -O && \
|
||||
tar -zxvf walle-q-i686-linux-musl.tar.gz -C /bot && \
|
||||
rm -rf walle-q-i686-linux-musl.tar.gz && \
|
||||
chmod +x /bot/walle-q-i686-linux-musl
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
ENTRYPOINT [ "/bot/walle-q-i686-linux-musl" ]
|
||||
14
docker/zhamao/Dockerfile
Normal file
14
docker/zhamao/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM phpswoole/swoole:5.0-php8.1
|
||||
|
||||
MAINTAINER sunxyw <me@sunxyw.xyz>
|
||||
|
||||
WORKDIR "/bot"
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
EXPOSE 20001-20005
|
||||
|
||||
RUN docker-php-ext-install pcntl
|
||||
|
||||
ENTRYPOINT [ "./zhamao" ]
|
||||
CMD [ "server" ]
|
||||
@@ -1 +1 @@
|
||||
module.exports = [{"title":"ZM","collapsable":true,"children":["ZM/ZMServer","ZM/ConsoleApplication","ZM/Framework"]},{"title":"ZM/API","collapsable":true,"children":["ZM/API/CQ","ZM/API/OneBotV11","ZM/API/TuringAPI","ZM/API/GoCqhttpAPIV11"]},{"title":"ZM/Annotation","collapsable":true,"children":["ZM/Annotation/AnnotationParser"]},{"title":"ZM/Annotation/Swoole","collapsable":true,"children":["ZM/Annotation/Swoole/OnSwooleEventBase"]},{"title":"ZM/Command","collapsable":true,"children":["ZM/Command/CheckConfigCommand"]},{"title":"ZM/Command/Generate","collapsable":true,"children":["ZM/Command/Generate/APIDocsGenerateCommand"]},{"title":"ZM/Context","collapsable":true,"children":["ZM/Context/Context"]},{"title":"ZM/DB","collapsable":true,"children":["ZM/DB/Table","ZM/DB/DeleteBody","ZM/DB/UpdateBody","ZM/DB/DB","ZM/DB/SelectBody","ZM/DB/InsertBody"]},{"title":"ZM/Event","collapsable":true,"children":["ZM/Event/EventManager","ZM/Event/EventTracer","ZM/Event/EventDispatcher"]},{"title":"ZM/Event/SwooleEvent","collapsable":true,"children":["ZM/Event/SwooleEvent/OnWorkerStart","ZM/Event/SwooleEvent/OnTask"]},{"title":"ZM/Http","collapsable":true,"children":["ZM/Http/Response"]},{"title":"ZM/Module","collapsable":true,"children":["ZM/Module/ModuleUnpacker","ZM/Module/ModulePacker","ZM/Module/ModuleBase","ZM/Module/QQBot"]},{"title":"ZM/MySQL","collapsable":true,"children":["ZM/MySQL/MySQLStatementWrapper","ZM/MySQL/MySQLQueryBuilder","ZM/MySQL/MySQLWrapper","ZM/MySQL/MySQLPool"]},{"title":"ZM/Store","collapsable":true,"children":["ZM/Store/LightCache","ZM/Store/ZMAtomic","ZM/Store/LightCacheInside"]},{"title":"ZM/Store/Redis","collapsable":true,"children":["ZM/Store/Redis/ZMRedis"]},{"title":"ZM/Utils","collapsable":true,"children":["ZM/Utils/Terminal","ZM/Utils/MessageUtil","ZM/Utils/DataProvider","ZM/Utils/SignalListener","ZM/Utils/ZMUtil","ZM/Utils/HttpUtil","ZM/Utils/CoMessage"]},{"title":"ZM/Utils/Manager","collapsable":true,"children":["ZM/Utils/Manager/CronManager","ZM/Utils/Manager/ModuleManager","ZM/Utils/Manager/WorkerManager"]}]
|
||||
module.exports = [{"title":"ZM","collapsable":true,"children":["ZM/ZMApplication","ZM/ConsoleApplication"]},{"title":"ZM/Annotation","collapsable":true,"children":["ZM/Annotation/AnnotationHandler","ZM/Annotation/AnnotationMap","ZM/Annotation/AnnotationParser","ZM/Annotation/AnnotationBase"]},{"title":"ZM/Command","collapsable":true,"children":["ZM/Command/InitCommand","ZM/Command/Command","ZM/Command/ProxyServerCommand","ZM/Command/BuildCommand"]},{"title":"ZM/Command/Server","collapsable":true,"children":["ZM/Command/Server/ServerStartCommand","ZM/Command/Server/ServerCommand"]},{"title":"ZM/Config","collapsable":true,"children":["ZM/Config/ZMConfig","ZM/Config/ConfigTracer"]},{"title":"ZM/Container","collapsable":true,"children":["ZM/Container/ContainerServicesProvider","ZM/Container/BoundMethod","ZM/Container/WorkerContainer","ZM/Container/Container"]},{"title":"ZM/Context","collapsable":true,"children":["ZM/Context/Context"]},{"title":"ZM/Event","collapsable":true,"children":["ZM/Event/EventProvider","ZM/Event/EventDispatcher"]},{"title":"ZM/Event/Listener","collapsable":true,"children":["ZM/Event/Listener/MasterEventListener","ZM/Event/Listener/ManagerEventListener","ZM/Event/Listener/HttpEventListener","ZM/Event/Listener/WorkerEventListener","ZM/Event/Listener/SignalListener","ZM/Event/Listener/WSEventListener"]},{"title":"ZM/Middleware","collapsable":true,"children":["ZM/Middleware/MiddlewareHandler","ZM/Middleware/Pipeline"]},{"title":"ZM/Plugin","collapsable":true,"children":["ZM/Plugin/PluginManager","ZM/Plugin/OneBot12Adapter"]},{"title":"ZM/Process","collapsable":true,"children":["ZM/Process/ProcessStateManager"]},{"title":"ZM/Store","collapsable":true,"children":["ZM/Store/FileSystem"]},{"title":"ZM/Store/Database","collapsable":true,"children":["ZM/Store/Database/DBWrapper","ZM/Store/Database/DBStatement","ZM/Store/Database/DBPool","ZM/Store/Database/DBStatementWrapper","ZM/Store/Database/DBConnection","ZM/Store/Database/DBQueryBuilder"]},{"title":"ZM/Store/Lock","collapsable":true,"children":["ZM/Store/Lock/FileLock"]},{"title":"ZM/Utils","collapsable":true,"children":["ZM/Utils/EasterEgg","ZM/Utils/ConnectionUtil","ZM/Utils/ReflectionUtil","ZM/Utils/ZMUtil","ZM/Utils/HttpUtil"]}]
|
||||
@@ -4,7 +4,7 @@
|
||||
<div v-for="i in chat" v-bind="i">
|
||||
<div class="doc-chat-row" v-if="i.type === 0">
|
||||
<div class="doc-chat-box">{{ i.content }}</div>
|
||||
<img class="doc-chat-avatar" src="http://api.btstu.cn/sjtx/api.php" alt=""/>
|
||||
<img class="doc-chat-avatar" src="https://api.btstu.cn/sjtx/api.php" alt=""/>
|
||||
</div>
|
||||
<div class="doc-chat-row doc-chat-row-robot" v-else-if="i.type === 1">
|
||||
<img class="doc-chat-avatar" src="https://docs-v1.zhamao.xin/logo.png" alt=""/>
|
||||
@@ -138,4 +138,4 @@ export default {
|
||||
height: 36px !important;
|
||||
border-radius: 18px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,7 @@ const apiConfig = require('./api')
|
||||
|
||||
module.exports = {
|
||||
title: '炸毛框架',
|
||||
description: '一个聊天机器人 + Web 框架',
|
||||
description: '一个高性能聊天机器人 + Web 框架',
|
||||
theme: 'antdocs',
|
||||
markdown: {
|
||||
lineNumbers: true
|
||||
@@ -189,4 +189,4 @@ module.exports = {
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,17 +21,16 @@ footer: |
|
||||
|
||||
## 安装框架和环境
|
||||
|
||||
此命令可一键以模板安装 `zhamao-framework` 和 `PHP` 独立环境到目录下,无需 root!(仅限 Linux)
|
||||
此命令可一键以模板安装框架!(仅限 Linux 和 macOS)
|
||||
|
||||
```bash
|
||||
mkdir my-app
|
||||
cd my-app
|
||||
bash -c "$(curl -fsSL https://api.zhamao.xin/go.sh)"
|
||||
bash <(curl -fsSL https://zhamao.xin/go.sh)
|
||||
```
|
||||
|
||||
## 运行框架
|
||||
|
||||
```bash
|
||||
cd zhamao-app/
|
||||
./zhamao server
|
||||
```
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## at
|
||||
|
||||
```php
|
||||
public function at(mixed $qq): string
|
||||
public function at(int|string $qq): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,18 +14,19 @@ at一下QQ用户(仅在QQ群支持at全体)
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| qq | mixed | |
|
||||
| qq | int|string | 用户QQ号/ID号 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## face
|
||||
|
||||
```php
|
||||
public function face(mixed $id): string
|
||||
public function face(int|string $id): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -36,18 +37,19 @@ public function face(mixed $id): string
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | mixed | |
|
||||
| id | int|string | 表情ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## image
|
||||
|
||||
```php
|
||||
public function image(mixed $file, bool $cache, bool $flash, bool $proxy, int $timeout): string
|
||||
public function image(string $file, bool $cache, bool $flash, bool $proxy, int $timeout): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -58,22 +60,23 @@ public function image(mixed $file, bool $cache, bool $flash, bool $proxy, int $t
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | mixed | |
|
||||
| cache | bool | |
|
||||
| flash | bool | |
|
||||
| proxy | bool | |
|
||||
| timeout | int | |
|
||||
| file | string | 文件的路径、URL或者base64编码的图片数据 |
|
||||
| cache | bool | 是否缓存(默认为true) |
|
||||
| flash | bool | 是否闪照(默认为false) |
|
||||
| proxy | bool | 是否使用代理(默认为true) |
|
||||
| timeout | int | 超时时间(默认不超时) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## record
|
||||
|
||||
```php
|
||||
public function record(mixed $file, bool $magic, bool $cache, bool $proxy, int $timeout): string
|
||||
public function record(string $file, bool $magic, bool $cache, bool $proxy, int $timeout): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -84,22 +87,23 @@ public function record(mixed $file, bool $magic, bool $cache, bool $proxy, int $
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | mixed | |
|
||||
| magic | bool | |
|
||||
| cache | bool | |
|
||||
| proxy | bool | |
|
||||
| timeout | int | |
|
||||
| file | string | 文件的路径、URL或者base64编码的语音数据 |
|
||||
| magic | bool | 是否加特技(默认为false) |
|
||||
| cache | bool | 是否缓存(默认为true) |
|
||||
| proxy | bool | 是否使用代理(默认为true) |
|
||||
| timeout | int | 超时时间(默认不超时) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## video
|
||||
|
||||
```php
|
||||
public function video(mixed $file, bool $cache, bool $proxy, int $timeout): string
|
||||
public function video(string $file, bool $cache, bool $proxy, int $timeout): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -110,15 +114,16 @@ public function video(mixed $file, bool $cache, bool $proxy, int $timeout): stri
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | mixed | |
|
||||
| cache | bool | |
|
||||
| proxy | bool | |
|
||||
| timeout | int | |
|
||||
| file | string | 文件的路径、URL或者base64编码的短视频数据 |
|
||||
| cache | bool | 是否缓存(默认为true) |
|
||||
| proxy | bool | 是否使用代理(默认为true) |
|
||||
| timeout | int | 超时时间(默认不超时) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## rps
|
||||
@@ -135,7 +140,7 @@ public function rps(): string
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## dice
|
||||
@@ -152,7 +157,7 @@ public function dice(): string
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## shake
|
||||
@@ -169,13 +174,13 @@ public function shake(): string
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## poke
|
||||
|
||||
```php
|
||||
public function poke(mixed $type, mixed $id, string $name): string
|
||||
public function poke(int|string $type, int|string $id, string $name): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -186,14 +191,15 @@ public function poke(mixed $type, mixed $id, string $name): string
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type | mixed | |
|
||||
| id | mixed | |
|
||||
| name | string | |
|
||||
| type | int|string | 焯一戳类型 |
|
||||
| id | int|string | 戳一戳ID号 |
|
||||
| name | string | 戳一戳名称(可选) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## anonymous
|
||||
@@ -210,18 +216,19 @@ public function anonymous(int $ignore): string
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| ignore | int | |
|
||||
| ignore | int | 是否忽略错误(默认为1,0表示不忽略错误) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## share
|
||||
|
||||
```php
|
||||
public function share(mixed $url, mixed $title, null $content, null $image): string
|
||||
public function share(string $url, string $title, null|string $content, null|string $image): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -232,21 +239,22 @@ public function share(mixed $url, mixed $title, null $content, null $image): str
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| url | mixed | |
|
||||
| title | mixed | |
|
||||
| content | null | |
|
||||
| image | null | |
|
||||
| url | string | 分享地址 |
|
||||
| title | string | 标题 |
|
||||
| content | null|string | 卡片内容(可选) |
|
||||
| image | null|string | 卡片图片(可选) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## contact
|
||||
|
||||
```php
|
||||
public function contact(mixed $type, mixed $id): string
|
||||
public function contact(int|string $type, int|string $id): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -257,19 +265,20 @@ public function contact(mixed $type, mixed $id): string
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type | mixed | |
|
||||
| id | mixed | |
|
||||
| type | int|string | 名片类型 |
|
||||
| id | int|string | 好友或群ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## location
|
||||
|
||||
```php
|
||||
public function location(mixed $lat, mixed $lon, string $title, string $content): string
|
||||
public function location(float|string $lat, float|string $lon, string $title, string $content): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -280,56 +289,173 @@ public function location(mixed $lat, mixed $lon, string $title, string $content)
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| lat | mixed | |
|
||||
| lon | mixed | |
|
||||
| title | string | |
|
||||
| content | string | |
|
||||
| lat | float|string | 纬度 |
|
||||
| lon | float|string | 经度 |
|
||||
| title | string | 标题(可选) |
|
||||
| content | string | 卡片内容(可选) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## music
|
||||
|
||||
```php
|
||||
public function music(mixed $type, mixed $id_or_url, null $audio, null $title, null $content, null $image): string
|
||||
public function music(string $type, int|string $id_or_url, null|string $audio, null|string $title, null|string $content, null|string $image): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
发送音乐分享(只能在单条回复中单独使用)
|
||||
qq、163、xiami为内置分享,需要先通过搜索功能获取id后使用
|
||||
custom为自定义分享
|
||||
当为自定义分享时:
|
||||
$id_or_url 为音乐卡片点进去打开的链接(一般是音乐介绍界面啦什么的)
|
||||
$audio 为音乐(如mp3文件)的HTTP链接地址(不可为空)
|
||||
$title 为音乐卡片的标题,建议12字以内(不可为空)
|
||||
$content 为音乐卡片的简介(可忽略)
|
||||
$image 为音乐卡片的图片链接地址(可忽略)
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type | mixed | |
|
||||
| id_or_url | mixed | |
|
||||
| audio | null | |
|
||||
| title | null | |
|
||||
| content | null | |
|
||||
| image | null | |
|
||||
| type | string | 分享类型(仅限 `qq`、`163`、`xiami` 或 `custom`) |
|
||||
| id_or_url | int|string | 当分享类型不是 `custom` 时,表示的是分享音乐的ID(需要先通过搜索功能获取id后使用),反之表示的是音乐卡片点入的链接 |
|
||||
| audio | null|string | 当分享类型是 `custom` 时,表示为音乐(如mp3文件)的HTTP链接地址(不可为空) |
|
||||
| title | null|string | 当分享类型是 `custom` 时,表示为音乐卡片的标题,建议12字以内(不可为空) |
|
||||
| content | null|string | 当分享类型是 `custom` 时,表示为音乐卡片的简介(可忽略) |
|
||||
| image | null|string | 当分享类型是 `custom` 时,表示为音乐卡片的图片链接地址(可忽略) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## forward
|
||||
|
||||
```php
|
||||
public function forward(int|string $id): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
合并转发消息
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | int|string | 合并转发ID, 需要通过 `/get_forward_msg` API获取转发的具体内容 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## node
|
||||
|
||||
```php
|
||||
public function node(int|string $user_id, string $nickname, string $content): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
合并转发消息节点
|
||||
特殊说明: 需要使用单独的API /send_group_forward_msg 发送, 并且由于消息段较为复杂, 仅支持Array形式入参。
|
||||
如果引用消息和自定义消息同时出现, 实际查看顺序将取消息段顺序。
|
||||
另外按 CQHTTP 文档说明, data 应全为字符串, 但由于需要接收message 类型的消息, 所以 仅限此Type的content字段 支持Array套娃
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| user_id | int|string | 转发消息id |
|
||||
| nickname | string | 发送者显示名字 |
|
||||
| content | string | 具体消息 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## xml
|
||||
|
||||
```php
|
||||
public function xml(string $data): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
XML消息
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | string | xml内容, xml中的value部分 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## json
|
||||
|
||||
```php
|
||||
public function json(string $data, int $resid): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
JSON消息
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | string | json内容 |
|
||||
| resid | int | 0为走小程序通道,其他值为富文本通道(默认为0) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## _custom
|
||||
|
||||
```php
|
||||
public function _custom(string $type_name, array $params): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
返回一个自定义扩展的CQ码(支持自定义类型和参数)
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type_name | string | CQ码类型名称 |
|
||||
| params | array | 参数 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | CQ码 |
|
||||
|
||||
|
||||
## decode
|
||||
|
||||
```php
|
||||
public function decode(mixed $msg, mixed $is_content): mixed
|
||||
public function decode(int|string|Stringable $msg, bool $is_content): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -340,19 +466,43 @@ public function decode(mixed $msg, mixed $is_content): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| is_content | mixed | |
|
||||
| msg | int|string|Stringable | 字符串 |
|
||||
| is_content | bool | 如果是解码CQ码本体内容,则为false(默认),如果是参数内的字符串,则为true |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| string | 转义后的CQ码 |
|
||||
|
||||
|
||||
## replace
|
||||
|
||||
```php
|
||||
public function replace(int|string|Stringable $str): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
简单反转义替换CQ码的方括号
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| str | int|string|Stringable | 字符串 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | 字符串 |
|
||||
|
||||
|
||||
## escape
|
||||
|
||||
```php
|
||||
public function escape(mixed $msg, mixed $is_content): mixed
|
||||
public function escape(int|string|Stringable $msg, bool $is_content): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -363,19 +513,20 @@ public function escape(mixed $msg, mixed $is_content): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| is_content | mixed | |
|
||||
| msg | int|string|Stringable | 字符串 |
|
||||
| is_content | bool | 如果是转义CQ码本体内容,则为false(默认),如果是参数内的字符串,则为true |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| string | 转义后的CQ码 |
|
||||
|
||||
|
||||
## encode
|
||||
|
||||
```php
|
||||
public function encode(mixed $msg, mixed $is_content): mixed
|
||||
public function encode(int|string|Stringable $msg, bool $is_content): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -386,19 +537,20 @@ public function encode(mixed $msg, mixed $is_content): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| is_content | mixed | |
|
||||
| msg | int|string|Stringable | 字符串 |
|
||||
| is_content | bool | 如果是转义CQ码本体内容,则为false(默认),如果是参数内的字符串,则为true |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| string | 转义后的CQ码 |
|
||||
|
||||
|
||||
## removeCQ
|
||||
|
||||
```php
|
||||
public function removeCQ(mixed $msg): string
|
||||
public function removeCQ(string $msg): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -409,18 +561,19 @@ public function removeCQ(mixed $msg): string
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| msg | string | 消息 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | 消息内容 |
|
||||
|
||||
|
||||
## getCQ
|
||||
|
||||
```php
|
||||
public function getCQ(mixed $msg, mixed $is_object): mixed
|
||||
public function getCQ(string $msg, bool $is_object): null|array|CQObject
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -431,19 +584,20 @@ public function getCQ(mixed $msg, mixed $is_object): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| is_object | mixed | |
|
||||
| msg | string | 消息内容 |
|
||||
| is_object | bool | 是否以对象形式返回,如果为False的话,返回数组形式(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| null|array|CQObject | 返回的CQ码(数组或对象) |
|
||||
|
||||
|
||||
## getAllCQ
|
||||
|
||||
```php
|
||||
public function getAllCQ(mixed $msg, mixed $is_object): mixed
|
||||
public function getAllCQ(string $msg, bool $is_object): array|CQObject[]
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -454,10 +608,11 @@ public function getAllCQ(mixed $msg, mixed $is_object): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| is_object | mixed | |
|
||||
| msg | string | 消息内容 |
|
||||
| is_object | bool | 是否以对象形式返回,如果为False的话,返回数组形式(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| array|CQObject[] | 返回的CQ码们(数组或对象) |
|
||||
|
||||
@@ -15,7 +15,7 @@ public function getGuildServiceProfile(): array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGuildList
|
||||
@@ -32,13 +32,13 @@ public function getGuildList(): array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGuildMetaByGuest
|
||||
|
||||
```php
|
||||
public function getGuildMetaByGuest(mixed $guild_id): array|bool
|
||||
public function getGuildMetaByGuest(int|string $guild_id): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -49,18 +49,19 @@ public function getGuildMetaByGuest(mixed $guild_id): array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| guild_id | mixed | |
|
||||
| guild_id | int|string | 频道ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGuildChannelList
|
||||
|
||||
```php
|
||||
public function getGuildChannelList(mixed $guild_id, false $no_cache): array|bool
|
||||
public function getGuildChannelList(int|string $guild_id, false $no_cache): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -71,19 +72,20 @@ public function getGuildChannelList(mixed $guild_id, false $no_cache): array|boo
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| guild_id | mixed | |
|
||||
| no_cache | false | |
|
||||
| guild_id | int|string | 频道ID |
|
||||
| no_cache | false | 禁用缓存(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGuildMembers
|
||||
|
||||
```php
|
||||
public function getGuildMembers(mixed $guild_id): array|bool
|
||||
public function getGuildMembers(int|string $guild_id): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -94,18 +96,19 @@ public function getGuildMembers(mixed $guild_id): array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| guild_id | mixed | |
|
||||
| guild_id | int|string | 频道ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## sendGuildChannelMsg
|
||||
|
||||
```php
|
||||
public function sendGuildChannelMsg(mixed $guild_id, mixed $channel_id, mixed $message): array|bool
|
||||
public function sendGuildChannelMsg(int|string $guild_id, int|string $channel_id, string $message): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -116,59 +119,12 @@ public function sendGuildChannelMsg(mixed $guild_id, mixed $channel_id, mixed $m
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| guild_id | mixed | |
|
||||
| channel_id | mixed | |
|
||||
| message | mixed | |
|
||||
| guild_id | int|string | 频道ID |
|
||||
| channel_id | int|string | 子频道ID |
|
||||
| message | string | 信息内容 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
|
||||
|
||||
## processAPI
|
||||
|
||||
```php
|
||||
public function processAPI(mixed $connection, mixed $reply, |null $function): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| connection | mixed | |
|
||||
| reply | mixed | |
|
||||
| function | |null | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
|
||||
|
||||
## processHttpAPI
|
||||
|
||||
```php
|
||||
public function processHttpAPI(mixed $connection, mixed $reply, null $function): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| connection | mixed | |
|
||||
| reply | mixed | |
|
||||
| function | null | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
@@ -3,23 +3,24 @@
|
||||
## get
|
||||
|
||||
```php
|
||||
public function get(mixed $robot_id): ZMRobot
|
||||
public function get(int|string $robot_id): ZMRobot
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
获取机器人Action/API实例
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| robot_id | mixed | |
|
||||
| robot_id | int|string | 机器人ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZMRobot | |
|
||||
| ZMRobot | 机器人实例 |
|
||||
|
||||
|
||||
## getRandom
|
||||
@@ -30,13 +31,13 @@ public function getRandom(): ZMRobot
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
随机获取一个连接到框架的机器人实例
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZMRobot | |
|
||||
| ZMRobot | 机器人实例 |
|
||||
|
||||
|
||||
## getAllRobot
|
||||
@@ -47,19 +48,65 @@ public function getAllRobot(): ZMRobot[]
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
获取所有机器人实例
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZMRobot[] | |
|
||||
| ZMRobot[] | 机器人实例们 |
|
||||
|
||||
|
||||
## setCallback
|
||||
|
||||
```php
|
||||
public function setCallback(bool|Closure $callback): OneBotV11
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
设置回调或启用协程等待API回包
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | bool|Closure | 是否开启协程或设置异步回调函数,如果为true,则协程等待结果,如果为false,则异步执行并不等待结果,如果为回调函数,则异步执行且调用回调 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| OneBotV11 | 返回本身 |
|
||||
|
||||
|
||||
## setPrefix
|
||||
|
||||
```php
|
||||
public function setPrefix(int $prefix): OneBotV11
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
设置API调用类型后缀
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prefix | int | 设置后缀类型,API_NORMAL为不加后缀,API_ASYNC为异步调用,API_RATE_LIMITED为加后缀并且限制调用频率 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| OneBotV11 | 返回本身 |
|
||||
|
||||
|
||||
## sendPrivateMsg
|
||||
|
||||
```php
|
||||
public function sendPrivateMsg(mixed $user_id, mixed $message, bool $auto_escape): null|array|bool
|
||||
public function sendPrivateMsg(int|string $user_id, string $message, bool $auto_escape): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -70,20 +117,21 @@ public function sendPrivateMsg(mixed $user_id, mixed $message, bool $auto_escape
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| user_id | mixed | |
|
||||
| message | mixed | |
|
||||
| auto_escape | bool | |
|
||||
| user_id | int|string | 用户ID |
|
||||
| message | string | 消息内容 |
|
||||
| auto_escape | bool | 是否自动转义(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## sendGroupMsg
|
||||
|
||||
```php
|
||||
public function sendGroupMsg(mixed $group_id, mixed $message, bool $auto_escape): null|array|bool
|
||||
public function sendGroupMsg(int|string $group_id, string $message, bool $auto_escape): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -94,20 +142,21 @@ public function sendGroupMsg(mixed $group_id, mixed $message, bool $auto_escape)
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| message | mixed | |
|
||||
| auto_escape | bool | |
|
||||
| group_id | int|string | 群组ID |
|
||||
| message | string | 消息内容 |
|
||||
| auto_escape | bool | 是否自动转义(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## sendMsg
|
||||
|
||||
```php
|
||||
public function sendMsg(mixed $message_type, mixed $target_id, mixed $message, bool $auto_escape): null|array|bool
|
||||
public function sendMsg(string $message_type, int|string $target_id, string $message, bool $auto_escape): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -118,21 +167,22 @@ public function sendMsg(mixed $message_type, mixed $target_id, mixed $message, b
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message_type | mixed | |
|
||||
| target_id | mixed | |
|
||||
| message | mixed | |
|
||||
| auto_escape | bool | |
|
||||
| message_type | string | 消息类型 |
|
||||
| target_id | int|string | 目标ID |
|
||||
| message | string | 消息内容 |
|
||||
| auto_escape | bool | 是否自动转义(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## deleteMsg
|
||||
|
||||
```php
|
||||
public function deleteMsg(mixed $message_id): null|array|bool
|
||||
public function deleteMsg(int|string $message_id): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -143,18 +193,19 @@ public function deleteMsg(mixed $message_id): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message_id | mixed | |
|
||||
| message_id | int|string | 消息ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getMsg
|
||||
|
||||
```php
|
||||
public function getMsg(mixed $message_id): null|array|bool
|
||||
public function getMsg(int|string $message_id): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -165,18 +216,19 @@ public function getMsg(mixed $message_id): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message_id | mixed | |
|
||||
| message_id | int|string | 消息ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getForwardMsg
|
||||
|
||||
```php
|
||||
public function getForwardMsg(mixed $id): null|array|bool
|
||||
public function getForwardMsg(int|string $id): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -187,18 +239,19 @@ public function getForwardMsg(mixed $id): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | mixed | |
|
||||
| id | int|string | ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## sendLike
|
||||
|
||||
```php
|
||||
public function sendLike(mixed $user_id, int $times): null|array|bool
|
||||
public function sendLike(int|string $user_id, int $times): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -209,19 +262,20 @@ public function sendLike(mixed $user_id, int $times): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| user_id | mixed | |
|
||||
| times | int | |
|
||||
| user_id | int|string | 用户ID |
|
||||
| times | int | 时间 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupKick
|
||||
|
||||
```php
|
||||
public function setGroupKick(mixed $group_id, mixed $user_id, bool $reject_add_request): null|array|bool
|
||||
public function setGroupKick(int|string $group_id, int|string $user_id, bool $reject_add_request): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -232,20 +286,21 @@ public function setGroupKick(mixed $group_id, mixed $user_id, bool $reject_add_r
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| user_id | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| user_id | int|string | 用户ID |
|
||||
| reject_add_request | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupBan
|
||||
|
||||
```php
|
||||
public function setGroupBan(mixed $group_id, mixed $user_id, int $duration): null|array|bool
|
||||
public function setGroupBan(int|string $group_id, int|string $user_id, int $duration): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -256,20 +311,21 @@ public function setGroupBan(mixed $group_id, mixed $user_id, int $duration): nul
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| user_id | mixed | |
|
||||
| duration | int | |
|
||||
| group_id | int|string | 群ID |
|
||||
| user_id | int|string | 用户ID |
|
||||
| duration | int | 禁言时长 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupAnonymousBan
|
||||
|
||||
```php
|
||||
public function setGroupAnonymousBan(mixed $group_id, mixed $anonymous_or_flag, int $duration): null|array|bool
|
||||
public function setGroupAnonymousBan(int|string $group_id, array|int|string $anonymous_or_flag, int $duration): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -280,20 +336,21 @@ public function setGroupAnonymousBan(mixed $group_id, mixed $anonymous_or_flag,
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| anonymous_or_flag | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| anonymous_or_flag | array|int|string | 匿名禁言Flag或匿名用户对象 |
|
||||
| duration | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupWholeBan
|
||||
|
||||
```php
|
||||
public function setGroupWholeBan(mixed $group_id, bool $enable): null|array|bool
|
||||
public function setGroupWholeBan(int|string $group_id, bool $enable): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -304,19 +361,20 @@ public function setGroupWholeBan(mixed $group_id, bool $enable): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| enable | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupAdmin
|
||||
|
||||
```php
|
||||
public function setGroupAdmin(mixed $group_id, mixed $user_id, bool $enable): null|array|bool
|
||||
public function setGroupAdmin(int|string $group_id, int|string $user_id, bool $enable): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -327,20 +385,21 @@ public function setGroupAdmin(mixed $group_id, mixed $user_id, bool $enable): nu
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| user_id | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| user_id | int|string | 用户ID |
|
||||
| enable | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupAnonymous
|
||||
|
||||
```php
|
||||
public function setGroupAnonymous(mixed $group_id, bool $enable): null|array|bool
|
||||
public function setGroupAnonymous(int|string $group_id, bool $enable): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -351,19 +410,20 @@ public function setGroupAnonymous(mixed $group_id, bool $enable): null|array|boo
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| enable | bool | |
|
||||
| group_id | int|string | 群ID |
|
||||
| enable | bool | 是否启用(默认为true) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupCard
|
||||
|
||||
```php
|
||||
public function setGroupCard(mixed $group_id, mixed $user_id, string $card): null|array|bool
|
||||
public function setGroupCard(int|string $group_id, int|string $user_id, string $card): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -374,20 +434,21 @@ public function setGroupCard(mixed $group_id, mixed $user_id, string $card): nul
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| user_id | mixed | |
|
||||
| card | string | |
|
||||
| group_id | int|string | 群ID |
|
||||
| user_id | int|string | 用户ID |
|
||||
| card | string | 名片内容(默认为空) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupName
|
||||
|
||||
```php
|
||||
public function setGroupName(mixed $group_id, mixed $group_name): null|array|bool
|
||||
public function setGroupName(int|string $group_id, string $group_name): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -398,19 +459,20 @@ public function setGroupName(mixed $group_id, mixed $group_name): null|array|boo
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| group_name | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| group_name | string | 群名 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupLeave
|
||||
|
||||
```php
|
||||
public function setGroupLeave(mixed $group_id, bool $is_dismiss): null|array|bool
|
||||
public function setGroupLeave(int|string $group_id, bool $is_dismiss): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -421,19 +483,20 @@ public function setGroupLeave(mixed $group_id, bool $is_dismiss): null|array|boo
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| is_dismiss | bool | |
|
||||
| group_id | int|string | 群ID |
|
||||
| is_dismiss | bool | 是否解散(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupSpecialTitle
|
||||
|
||||
```php
|
||||
public function setGroupSpecialTitle(mixed $group_id, mixed $user_id, string $special_title, int $duration): null|array|bool
|
||||
public function setGroupSpecialTitle(int|string $group_id, int|string $user_id, string $special_title, int $duration): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -444,21 +507,22 @@ public function setGroupSpecialTitle(mixed $group_id, mixed $user_id, string $sp
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| user_id | mixed | |
|
||||
| special_title | string | |
|
||||
| duration | int | |
|
||||
| group_id | int|string | 群ID |
|
||||
| user_id | int|string | 用户ID |
|
||||
| special_title | string | 专属头衔内容 |
|
||||
| duration | int | 持续时间(默认为-1,永久) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setFriendAddRequest
|
||||
|
||||
```php
|
||||
public function setFriendAddRequest(mixed $flag, bool $approve, string $remark): null|array|bool
|
||||
public function setFriendAddRequest(array|int|string $flag, bool $approve, string $remark): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -469,20 +533,21 @@ public function setFriendAddRequest(mixed $flag, bool $approve, string $remark):
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| flag | mixed | |
|
||||
| approve | bool | |
|
||||
| remark | string | |
|
||||
| flag | array|int|string | 处理加好友请求的flag |
|
||||
| approve | bool | 是否同意(默认为true) |
|
||||
| remark | string | 设置昵称(默认不设置) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setGroupAddRequest
|
||||
|
||||
```php
|
||||
public function setGroupAddRequest(mixed $flag, mixed $sub_type, bool $approve, string $reason): null|array|bool
|
||||
public function setGroupAddRequest(array|int|string $flag, string $sub_type, bool $approve, string $reason): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -493,21 +558,22 @@ public function setGroupAddRequest(mixed $flag, mixed $sub_type, bool $approve,
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| flag | mixed | |
|
||||
| sub_type | mixed | |
|
||||
| approve | bool | |
|
||||
| reason | string | |
|
||||
| flag | array|int|string | 处理加群请求的flag |
|
||||
| sub_type | string | 处理请求类型(包含add和invite) |
|
||||
| approve | bool | 是否同意(默认为true) |
|
||||
| reason | string | 拒绝理由(仅在拒绝时有效,默认为空) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getLoginInfo
|
||||
|
||||
```php
|
||||
public function getLoginInfo(): null|array|bool
|
||||
public function getLoginInfo(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -518,13 +584,13 @@ public function getLoginInfo(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getStrangerInfo
|
||||
|
||||
```php
|
||||
public function getStrangerInfo(mixed $user_id, bool $no_cache): null|array|bool
|
||||
public function getStrangerInfo(int|string $user_id, bool $no_cache): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -535,19 +601,20 @@ public function getStrangerInfo(mixed $user_id, bool $no_cache): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| user_id | mixed | |
|
||||
| no_cache | bool | |
|
||||
| user_id | int|string | 用户ID |
|
||||
| no_cache | bool | 是否不使用缓存(默认为false) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getFriendList
|
||||
|
||||
```php
|
||||
public function getFriendList(): null|array|bool
|
||||
public function getFriendList(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -558,13 +625,13 @@ public function getFriendList(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGroupInfo
|
||||
|
||||
```php
|
||||
public function getGroupInfo(mixed $group_id, bool $no_cache): null|array|bool
|
||||
public function getGroupInfo(int|string $group_id, bool $no_cache): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -575,19 +642,20 @@ public function getGroupInfo(mixed $group_id, bool $no_cache): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| no_cache | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGroupList
|
||||
|
||||
```php
|
||||
public function getGroupList(): null|array|bool
|
||||
public function getGroupList(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -598,13 +666,13 @@ public function getGroupList(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGroupMemberInfo
|
||||
|
||||
```php
|
||||
public function getGroupMemberInfo(mixed $group_id, mixed $user_id, bool $no_cache): null|array|bool
|
||||
public function getGroupMemberInfo(int|string $group_id, int|string $user_id, bool $no_cache): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -615,20 +683,21 @@ public function getGroupMemberInfo(mixed $group_id, mixed $user_id, bool $no_cac
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| user_id | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| user_id | int|string | 用户ID |
|
||||
| no_cache | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGroupMemberList
|
||||
|
||||
```php
|
||||
public function getGroupMemberList(mixed $group_id): null|array|bool
|
||||
public function getGroupMemberList(int|string $group_id): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -639,18 +708,19 @@ public function getGroupMemberList(mixed $group_id): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getGroupHonorInfo
|
||||
|
||||
```php
|
||||
public function getGroupHonorInfo(mixed $group_id, mixed $type): null|array|bool
|
||||
public function getGroupHonorInfo(int|string $group_id, string $type): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -661,19 +731,20 @@ public function getGroupHonorInfo(mixed $group_id, mixed $type): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group_id | mixed | |
|
||||
| type | mixed | |
|
||||
| group_id | int|string | 群ID |
|
||||
| type | string | 荣誉类型 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getCsrfToken
|
||||
|
||||
```php
|
||||
public function getCsrfToken(): null|array|bool
|
||||
public function getCsrfToken(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -684,13 +755,13 @@ public function getCsrfToken(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getCredentials
|
||||
|
||||
```php
|
||||
public function getCredentials(string $domain): null|array|bool
|
||||
public function getCredentials(string $domain): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -702,17 +773,18 @@ public function getCredentials(string $domain): null|array|bool
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| domain | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getRecord
|
||||
|
||||
```php
|
||||
public function getRecord(mixed $file, mixed $out_format): null|array|bool
|
||||
public function getRecord(string $file, string $out_format): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -723,19 +795,20 @@ public function getRecord(mixed $file, mixed $out_format): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | mixed | |
|
||||
| out_format | mixed | |
|
||||
| file | string | 文件 |
|
||||
| out_format | string | 输出格式 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getImage
|
||||
|
||||
```php
|
||||
public function getImage(mixed $file): null|array|bool
|
||||
public function getImage(string $file): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -746,18 +819,19 @@ public function getImage(mixed $file): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | mixed | |
|
||||
| file | string | 文件 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## canSendImage
|
||||
|
||||
```php
|
||||
public function canSendImage(): null|array|bool
|
||||
public function canSendImage(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -768,13 +842,13 @@ public function canSendImage(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## canSendRecord
|
||||
|
||||
```php
|
||||
public function canSendRecord(): null|array|bool
|
||||
public function canSendRecord(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -785,13 +859,13 @@ public function canSendRecord(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getStatus
|
||||
|
||||
```php
|
||||
public function getStatus(): null|array|bool
|
||||
public function getStatus(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -802,13 +876,13 @@ public function getStatus(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getVersionInfo
|
||||
|
||||
```php
|
||||
public function getVersionInfo(): null|array|bool
|
||||
public function getVersionInfo(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -819,13 +893,13 @@ public function getVersionInfo(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## setRestart
|
||||
|
||||
```php
|
||||
public function setRestart(int $delay): null|array|bool
|
||||
public function setRestart(int $delay): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -836,18 +910,19 @@ public function setRestart(int $delay): null|array|bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| delay | int | |
|
||||
| delay | int | 延迟时间(毫秒,默认为0) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## cleanCache
|
||||
|
||||
```php
|
||||
public function cleanCache(): null|array|bool
|
||||
public function cleanCache(): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -858,7 +933,7 @@ public function cleanCache(): null|array|bool
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|array|bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
|
||||
## getExtendedAPI
|
||||
@@ -877,17 +952,18 @@ public function getExtendedAPI(string $package_name): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| package_name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| mixed | 返回包的操作对象 |
|
||||
|
||||
|
||||
## processAPI
|
||||
## callExtendedAPI
|
||||
|
||||
```php
|
||||
public function processAPI(mixed $connection, mixed $reply, |null $function): array|bool
|
||||
public function callExtendedAPI(string $action, array $params): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -898,35 +974,11 @@ public function processAPI(mixed $connection, mixed $reply, |null $function): ar
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| connection | mixed | |
|
||||
| reply | mixed | |
|
||||
| function | |null | |
|
||||
| action | string | 动作(API)名称 |
|
||||
| params | array | 参数 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
|
||||
|
||||
## processHttpAPI
|
||||
|
||||
```php
|
||||
public function processHttpAPI(mixed $connection, mixed $reply, null $function): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| connection | mixed | |
|
||||
| reply | mixed | |
|
||||
| function | null | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
| array|bool | 返回API调用结果(数组)或异步API调用状态(bool) |
|
||||
|
||||
117
docs/api/ZM/API/Proxies/Bot/AbstractBotProxy.md
Normal file
117
docs/api/ZM/API/Proxies/Bot/AbstractBotProxy.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# ZM\API\Proxies\Bot\AbstractBotProxy
|
||||
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function __construct(AbstractBotProxy|ZMRobot $bot): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
构造函数
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| bot | AbstractBotProxy|ZMRobot | 调用此代理的机器人实例 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## __call
|
||||
|
||||
```php
|
||||
public function __call(string $name, array $arguments): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
在传入的机器人实例上调用方法
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | 方法名 |
|
||||
| arguments | array | 参数 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## __get
|
||||
|
||||
```php
|
||||
public function __get(string $name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
获取传入的机器人实例的属性
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | 属性名 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## __set
|
||||
|
||||
```php
|
||||
public function __set(string $name, mixed $value): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
设置传入的机器人实例的属性
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | 属性名 |
|
||||
| value | mixed | 属性值 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## __isset
|
||||
|
||||
```php
|
||||
public function __isset(string $name): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
判断传入的机器人实例的属性是否存在
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | 属性名 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
24
docs/api/ZM/API/Proxies/Bot/AllBotsProxy.md
Normal file
24
docs/api/ZM/API/Proxies/Bot/AllBotsProxy.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# ZM\API\Proxies\Bot\AllBotsProxy
|
||||
|
||||
## __call
|
||||
|
||||
```php
|
||||
public function __call(string $name, array $arguments): array<mixed>
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
在所有机器人实例上调用方法
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | 方法名 |
|
||||
| arguments | array | 参数 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array<mixed> | 返回一个包含所有执行结果的数组,键名为机器人ID |
|
||||
24
docs/api/ZM/API/Proxies/Bot/AllGroupsProxy.md
Normal file
24
docs/api/ZM/API/Proxies/Bot/AllGroupsProxy.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# ZM\API\Proxies\Bot\AllGroupsProxy
|
||||
|
||||
## __call
|
||||
|
||||
```php
|
||||
public function __call(string $name, array $arguments): array<mixed>
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
在传入的机器人实例上调用方法
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | 方法名 |
|
||||
| arguments | array | 参数 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array<mixed> | 返回一个包含所有执行结果的数组,键名为群号 |
|
||||
@@ -3,7 +3,7 @@
|
||||
## getTuringMsg
|
||||
|
||||
```php
|
||||
public function getTuringMsg(mixed $msg, mixed $user_id, mixed $api): string
|
||||
public function getTuringMsg(string $msg, int|string $user_id, string $api): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,11 +14,35 @@ public function getTuringMsg(mixed $msg, mixed $user_id, mixed $api): string
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| user_id | mixed | |
|
||||
| api | mixed | |
|
||||
| msg | string | 消息 |
|
||||
| user_id | int|string | 用户ID |
|
||||
| api | string | API Key |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| string | 图灵的回复 |
|
||||
|
||||
|
||||
## getResultStatus
|
||||
|
||||
```php
|
||||
public function getResultStatus(array $r): bool|string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| r | array | 数据API回包 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool|string | 错误消息或成功鸥鸟 |
|
||||
|
||||
@@ -1 +1,46 @@
|
||||
# ZM\API\ZMRobot
|
||||
# ZM\API\ZMRobot
|
||||
|
||||
## all
|
||||
|
||||
```php
|
||||
public function all(ZM\API\Proxies\Bot\AbstractBotProxy $proxy): ZM\API\Proxies\Bot\AllBotsProxy
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
获取一个会在所有机器人实例上执行的代理
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| proxy | ZM\API\Proxies\Bot\AbstractBotProxy | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\API\Proxies\Bot\AllBotsProxy | |
|
||||
|
||||
|
||||
## allGroups
|
||||
|
||||
```php
|
||||
public function allGroups(ZM\API\Proxies\Bot\AbstractBotProxy $proxy): ZM\API\Proxies\Bot\AllGroupsProxy
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
获取一个会在所有群上执行的代理
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| proxy | ZM\API\Proxies\Bot\AbstractBotProxy | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\API\Proxies\Bot\AllGroupsProxy | |
|
||||
|
||||
293
docs/api/ZM/Adapters/OneBot11Adapter.md
Normal file
293
docs/api/ZM/Adapters/OneBot11Adapter.md
Normal file
@@ -0,0 +1,293 @@
|
||||
# ZM\Adapters\OneBot11Adapter
|
||||
|
||||
## getName
|
||||
|
||||
```php
|
||||
public function getName(): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
{@inheritDoc}
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## getVersion
|
||||
|
||||
```php
|
||||
public function getVersion(): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
{@inheritDoc}
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## handleIncomingRequest
|
||||
|
||||
```php
|
||||
public function handleIncomingRequest(ZM\Context\ContextInterface $context): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
{@inheritDoc}
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| context | ZM\Context\ContextInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## handleAPIResponse
|
||||
|
||||
```php
|
||||
public function handleAPIResponse(array $data, ContextInterface $context): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理 API 响应
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 数据 |
|
||||
| context | ContextInterface | 上下文 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## handleMessageEvent
|
||||
|
||||
```php
|
||||
public function handleMessageEvent(array $data, ContextInterface $context): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理消息事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 消息数据 |
|
||||
| context | ContextInterface | 上下文 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## handleMetaEvent
|
||||
|
||||
```php
|
||||
public function handleMetaEvent(array $data, ContextInterface $context): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理元事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 消息数据 |
|
||||
| context | ContextInterface | 上下文 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## handleNoticeEvent
|
||||
|
||||
```php
|
||||
public function handleNoticeEvent(array $data, ContextInterface $context): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理通知事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 消息数据 |
|
||||
| context | ContextInterface | 上下文 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## handleRequestEvent
|
||||
|
||||
```php
|
||||
public function handleRequestEvent(array $data, ContextInterface $context): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理请求事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 消息数据 |
|
||||
| context | ContextInterface | 上下文 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## handleBeforeEvent
|
||||
|
||||
```php
|
||||
public function handleBeforeEvent(array $data, string $time): ZM\Event\EventDispatcher
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理前置事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 消息数据 |
|
||||
| time | string | 执行时机 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Event\EventDispatcher | |
|
||||
|
||||
|
||||
## handleAfterEvent
|
||||
|
||||
```php
|
||||
public function handleAfterEvent(array $data): ZM\Event\EventDispatcher
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
处理后置事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | 消息数据 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Event\EventDispatcher | |
|
||||
|
||||
|
||||
## isAPIResponse
|
||||
|
||||
```php
|
||||
public function isAPIResponse(array $data): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
判断是否为 API 回调
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## isEvent
|
||||
|
||||
```php
|
||||
public function isEvent(array $data): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
判断是否为事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## isMetaEvent
|
||||
|
||||
```php
|
||||
public function isMetaEvent(array $data): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
判断是否为元事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
@@ -1 +1,23 @@
|
||||
# ZM\Annotation\AnnotationBase
|
||||
# ZM\Annotation\AnnotationBase
|
||||
|
||||
## on
|
||||
|
||||
```php
|
||||
public function on(mixed $method): ZM\Annotation\AnnotationBase
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| method | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Annotation\AnnotationBase | |
|
||||
|
||||
174
docs/api/ZM/Annotation/AnnotationHandler.md
Normal file
174
docs/api/ZM/Annotation/AnnotationHandler.md
Normal file
@@ -0,0 +1,174 @@
|
||||
# ZM\Annotation\AnnotationHandler
|
||||
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function __construct(string $annotation_class): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| annotation_class | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## interrupt
|
||||
|
||||
```php
|
||||
public function interrupt(mixed $return_var): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| return_var | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## setRuleCallback
|
||||
|
||||
```php
|
||||
public function setRuleCallback(callable $rule): ZM\Annotation\AnnotationHandler
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| rule | callable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Annotation\AnnotationHandler | |
|
||||
|
||||
|
||||
## setReturnCallback
|
||||
|
||||
```php
|
||||
public function setReturnCallback(callable $return): ZM\Annotation\AnnotationHandler
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| return | callable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Annotation\AnnotationHandler | |
|
||||
|
||||
|
||||
## handleAll
|
||||
|
||||
```php
|
||||
public function handleAll(mixed $params): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| params | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## handle
|
||||
|
||||
```php
|
||||
public function handle(ZM\Annotation\AnnotationBase $v, callable $rule_callback, mixed $args): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| v | ZM\Annotation\AnnotationBase | |
|
||||
| rule_callback | callable | |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getStatus
|
||||
|
||||
```php
|
||||
public function getStatus(): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
|
||||
## getReturnVal
|
||||
|
||||
```php
|
||||
public function getReturnVal(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
40
docs/api/ZM/Annotation/AnnotationMap.md
Normal file
40
docs/api/ZM/Annotation/AnnotationMap.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# ZM\Annotation\AnnotationMap
|
||||
|
||||
## loadAnnotationByParser
|
||||
|
||||
```php
|
||||
public function loadAnnotationByParser(ZM\Annotation\AnnotationParser $parser): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parser | ZM\Annotation\AnnotationParser | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## sortAnnotationList
|
||||
|
||||
```php
|
||||
public function sortAnnotationList(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
@@ -3,12 +3,18 @@
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function __construct(): mixed
|
||||
public function __construct(bool $with_internal_parsers): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
AnnotationParser constructor.
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| with_internal_parsers | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -17,27 +23,68 @@ AnnotationParser constructor.
|
||||
| mixed | |
|
||||
|
||||
|
||||
## registerMods
|
||||
## addSpecialParser
|
||||
|
||||
```php
|
||||
public function registerMods(): mixed
|
||||
public function addSpecialParser(string $class_name, callable $callback): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
注册各个模块类的注解和模块level的排序
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| class_name | string | |
|
||||
| callback | callable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| void | |
|
||||
|
||||
|
||||
## parseAll
|
||||
|
||||
```php
|
||||
public function parseAll(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## generateAnnotationList
|
||||
|
||||
```php
|
||||
public function generateAnnotationList(): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## addRegisterPath
|
||||
|
||||
```php
|
||||
public function addRegisterPath(mixed $path, mixed $indoor_name): mixed
|
||||
public function addRegisterPath(string $path, string $indoor_name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -48,8 +95,9 @@ public function addRegisterPath(mixed $path, mixed $indoor_name): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| path | mixed | |
|
||||
| indoor_name | mixed | |
|
||||
| path | string | |
|
||||
| indoor_name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -57,10 +105,44 @@ public function addRegisterPath(mixed $path, mixed $indoor_name): mixed
|
||||
| mixed | |
|
||||
|
||||
|
||||
## sortByLevel
|
||||
## getUsedTime
|
||||
|
||||
```php
|
||||
public function sortByLevel(mixed $events, string $class_name, string $prefix): mixed
|
||||
public function getUsedTime(): float
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| float | |
|
||||
|
||||
|
||||
## getAnnotationMap
|
||||
|
||||
```php
|
||||
public function getAnnotationMap(): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## addRouteAnnotation
|
||||
|
||||
```php
|
||||
public function addRouteAnnotation(ZM\Annotation\Http\Route $vss, array $same_method_annotations): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -71,25 +153,8 @@ public function sortByLevel(mixed $events, string $class_name, string $prefix):
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| events | mixed | |
|
||||
| class_name | string | |
|
||||
| prefix | string | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## verifyMiddlewares
|
||||
|
||||
```php
|
||||
public function verifyMiddlewares(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
| vss | ZM\Annotation\Http\Route | |
|
||||
| same_method_annotations | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ public function setLevel(int $level): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| level | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -1 +1,17 @@
|
||||
# ZM\Command\BuildCommand
|
||||
# ZM\Command\BuildCommand
|
||||
|
||||
## configure
|
||||
|
||||
```php
|
||||
public function configure(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## check
|
||||
|
||||
```php
|
||||
public function check(mixed $remote, mixed $local, Symfony\Component\Console\Output\OutputInterface $out): mixed
|
||||
public function check(mixed $remote, mixed $local): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -16,7 +16,7 @@ public function check(mixed $remote, mixed $local, Symfony\Component\Console\Out
|
||||
| -------- | ---- | ----------- |
|
||||
| remote | mixed | |
|
||||
| local | mixed | |
|
||||
| out | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
226
docs/api/ZM/Command/Command.md
Normal file
226
docs/api/ZM/Command/Command.md
Normal file
@@ -0,0 +1,226 @@
|
||||
# ZM\Command\Command
|
||||
|
||||
## execute
|
||||
|
||||
```php
|
||||
public function execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| input | Symfony\Component\Console\Input\InputInterface | |
|
||||
| output | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
|
||||
## shouldExecute
|
||||
|
||||
```php
|
||||
public function shouldExecute(): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## handle
|
||||
|
||||
```php
|
||||
public function handle(): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
|
||||
## write
|
||||
|
||||
```php
|
||||
public function write(string $message, bool $newline): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| newline | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## info
|
||||
|
||||
```php
|
||||
public function info(string $message, bool $newline): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| newline | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## error
|
||||
|
||||
```php
|
||||
public function error(string $message, bool $newline): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| newline | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## comment
|
||||
|
||||
```php
|
||||
public function comment(string $message, bool $newline): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| newline | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## question
|
||||
|
||||
```php
|
||||
public function question(string $message, bool $newline): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| newline | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## detail
|
||||
|
||||
```php
|
||||
public function detail(string $message, bool $newline): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| newline | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## section
|
||||
|
||||
```php
|
||||
public function section(string $message, callable $callback): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
| callback | callable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
@@ -1 +1,40 @@
|
||||
# ZM\Command\InitCommand
|
||||
# ZM\Command\InitCommand
|
||||
|
||||
## setBasePath
|
||||
|
||||
```php
|
||||
public function setBasePath(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## extractFile
|
||||
|
||||
```php
|
||||
public function extractFile(string $file): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
@@ -1 +1,24 @@
|
||||
# ZM\Command\Module\ModuleListCommand
|
||||
# ZM\Command\Module\ModuleListCommand
|
||||
|
||||
## execute
|
||||
|
||||
```php
|
||||
public function execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| input | Symfony\Component\Console\Input\InputInterface | |
|
||||
| output | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
@@ -1 +1,24 @@
|
||||
# ZM\Command\Module\ModulePackCommand
|
||||
# ZM\Command\Module\ModulePackCommand
|
||||
|
||||
## execute
|
||||
|
||||
```php
|
||||
public function execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| input | Symfony\Component\Console\Input\InputInterface | |
|
||||
| output | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
41
docs/api/ZM/Command/ProxyServerCommand.md
Normal file
41
docs/api/ZM/Command/ProxyServerCommand.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# ZM\Command\ProxyServerCommand
|
||||
|
||||
## configure
|
||||
|
||||
```php
|
||||
public function configure(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## startSocksProxy
|
||||
|
||||
```php
|
||||
public function startSocksProxy(string $address, mixed $port): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| address | string | |
|
||||
| port | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
24
docs/api/ZM/Command/Server/ServerCommand.md
Normal file
24
docs/api/ZM/Command/Server/ServerCommand.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# ZM\Command\Server\ServerCommand
|
||||
|
||||
## execute
|
||||
|
||||
```php
|
||||
public function execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| input | Symfony\Component\Console\Input\InputInterface | |
|
||||
| output | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
24
docs/api/ZM/Command/Server/ServerStartCommand.md
Normal file
24
docs/api/ZM/Command/Server/ServerStartCommand.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# ZM\Command\Server\ServerStartCommand
|
||||
|
||||
## execute
|
||||
|
||||
```php
|
||||
public function execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| input | Symfony\Component\Console\Input\InputInterface | |
|
||||
| output | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
73
docs/api/ZM/Config/ConfigTracer.md
Normal file
73
docs/api/ZM/Config/ConfigTracer.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# ZM\Config\ConfigTracer
|
||||
|
||||
## addTracesOf
|
||||
|
||||
```php
|
||||
public function addTracesOf(string $group, array $traces, string $source): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| group | string | |
|
||||
| traces | array | |
|
||||
| source | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getTraceOf
|
||||
|
||||
```php
|
||||
public function getTraceOf(string $key): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## flatten
|
||||
|
||||
```php
|
||||
public function flatten(string $prefix, array $array, string $source): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prefix | string | |
|
||||
| array | array | |
|
||||
| source | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
348
docs/api/ZM/Config/ZMConfig.md
Normal file
348
docs/api/ZM/Config/ZMConfig.md
Normal file
@@ -0,0 +1,348 @@
|
||||
# ZM\Config\ZMConfig
|
||||
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function __construct(array $config_paths, string $environment): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| config_paths | array | |
|
||||
| environment | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## loadFiles
|
||||
|
||||
```php
|
||||
public function loadFiles(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## merge
|
||||
|
||||
```php
|
||||
public function merge(string $key, array $config): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | string | |
|
||||
| config | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## get
|
||||
|
||||
```php
|
||||
public function get(string $key, mixed $default): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | string | |
|
||||
| default | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## set
|
||||
|
||||
```php
|
||||
public function set(mixed $key, mixed $value): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | mixed | |
|
||||
| value | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## addConfigPath
|
||||
|
||||
```php
|
||||
public function addConfigPath(string $path): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| path | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getEnvironment
|
||||
|
||||
```php
|
||||
public function getEnvironment(): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## setEnvironment
|
||||
|
||||
```php
|
||||
public function setEnvironment(string $environment): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| environment | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## reload
|
||||
|
||||
```php
|
||||
public function reload(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getHolder
|
||||
|
||||
```php
|
||||
public function getHolder(): OneBot\Config\Config
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| OneBot\Config\Config | |
|
||||
|
||||
|
||||
## getTrace
|
||||
|
||||
```php
|
||||
public function getTrace(string $key): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## getFileMeta
|
||||
|
||||
```php
|
||||
public function getFileMeta(string $name): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## getFileLoadType
|
||||
|
||||
```php
|
||||
public function getFileLoadType(string $name): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## shouldLoadFile
|
||||
|
||||
```php
|
||||
public function shouldLoadFile(string $path): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| path | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## loadConfigFromPath
|
||||
|
||||
```php
|
||||
public function loadConfigFromPath(string $path): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| path | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
@@ -1,9 +1,9 @@
|
||||
# ZM\ConsoleApplication
|
||||
|
||||
## __construct
|
||||
## run
|
||||
|
||||
```php
|
||||
public function __construct(string $name): mixed
|
||||
public function run(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,31 +14,11 @@ public function __construct(string $name): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | |
|
||||
| input | Symfony\Component\Console\Input\InputInterface | |
|
||||
| output | Symfony\Component\Console\Output\OutputInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## initEnv
|
||||
|
||||
```php
|
||||
public function initEnv(string $with_default_cmd): ZM\ConsoleApplication
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| with_default_cmd | string | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\ConsoleApplication | |
|
||||
| int | |
|
||||
|
||||
77
docs/api/ZM/Container/BoundMethod.md
Normal file
77
docs/api/ZM/Container/BoundMethod.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# ZM\Container\BoundMethod
|
||||
|
||||
## call
|
||||
|
||||
```php
|
||||
public function call(ZM\Container\ContainerInterface $container, mixed $callback, array $parameters, string $default_method): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
| callback | mixed | |
|
||||
| parameters | array | |
|
||||
| default_method | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getMethodDependencies
|
||||
|
||||
```php
|
||||
public function getMethodDependencies(ZM\Container\ContainerInterface $container, mixed $callback, array $parameters): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
| callback | mixed | |
|
||||
| parameters | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## addDependencyForCallParameter
|
||||
|
||||
```php
|
||||
public function addDependencyForCallParameter(ZM\Container\ContainerInterface $container, ReflectionParameter $parameter, array $parameters, array $dependencies): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
| parameter | ReflectionParameter | |
|
||||
| parameters | array | |
|
||||
| dependencies | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
883
docs/api/ZM/Container/Container.md
Normal file
883
docs/api/ZM/Container/Container.md
Normal file
@@ -0,0 +1,883 @@
|
||||
# ZM\Container\Container
|
||||
|
||||
## getParent
|
||||
|
||||
```php
|
||||
public function getParent(): ZM\Container\ContainerInterface
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Container\ContainerInterface | |
|
||||
|
||||
|
||||
## has
|
||||
|
||||
```php
|
||||
public function has(string $id): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## make
|
||||
|
||||
```php
|
||||
public function make(string $abstract, array $parameters): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| parameters | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
|
||||
|
||||
## bound
|
||||
|
||||
```php
|
||||
public function bound(string $abstract): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getAlias
|
||||
|
||||
```php
|
||||
public function getAlias(string $abstract): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## alias
|
||||
|
||||
```php
|
||||
public function alias(string $abstract, string $alias): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| alias | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## bind
|
||||
|
||||
```php
|
||||
public function bind(string $abstract, mixed $concrete, bool $shared): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
| shared | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## bindIf
|
||||
|
||||
```php
|
||||
public function bindIf(string $abstract, mixed $concrete, bool $shared): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
| shared | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## singleton
|
||||
|
||||
```php
|
||||
public function singleton(string $abstract, mixed $concrete): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## singletonIf
|
||||
|
||||
```php
|
||||
public function singletonIf(string $abstract, mixed $concrete): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## instance
|
||||
|
||||
```php
|
||||
public function instance(string $abstract, mixed $instance): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| instance | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## factory
|
||||
|
||||
```php
|
||||
public function factory(string $abstract): Closure
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Closure | |
|
||||
|
||||
|
||||
## flush
|
||||
|
||||
```php
|
||||
public function flush(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## traitMake
|
||||
|
||||
```php
|
||||
public function traitMake(string $abstract, array $parameters): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| parameters | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## build
|
||||
|
||||
```php
|
||||
public function build(mixed $concrete): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| concrete | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## call
|
||||
|
||||
```php
|
||||
public function call(mixed $callback, array $parameters, string $default_method): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | mixed | |
|
||||
| parameters | array | |
|
||||
| default_method | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## get
|
||||
|
||||
```php
|
||||
public function get(string $id): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## extend
|
||||
|
||||
```php
|
||||
public function extend(string $abstract, Closure $closure): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| closure | Closure | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getLogPrefix
|
||||
|
||||
```php
|
||||
public function getLogPrefix(): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## setLogPrefix
|
||||
|
||||
```php
|
||||
public function setLogPrefix(string $prefix): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prefix | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getExtenders
|
||||
|
||||
```php
|
||||
public function getExtenders(string $abstract): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## isAlias
|
||||
|
||||
```php
|
||||
public function isAlias(string $name): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## dropStaleInstances
|
||||
|
||||
```php
|
||||
public function dropStaleInstances(string $abstract): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getClosure
|
||||
|
||||
```php
|
||||
public function getClosure(string $abstract, string $concrete): Closure
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Closure | |
|
||||
|
||||
|
||||
## getLastParameterOverride
|
||||
|
||||
```php
|
||||
public function getLastParameterOverride(): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## notInstantiable
|
||||
|
||||
```php
|
||||
public function notInstantiable(string $concrete, string $reason): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| concrete | string | |
|
||||
| reason | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## resolveDependencies
|
||||
|
||||
```php
|
||||
public function resolveDependencies(array $dependencies): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| dependencies | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## hasParameterOverride
|
||||
|
||||
```php
|
||||
public function hasParameterOverride(ReflectionParameter $parameter): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getParameterOverride
|
||||
|
||||
```php
|
||||
public function getParameterOverride(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## hasParameterTypeOverride
|
||||
|
||||
```php
|
||||
public function hasParameterTypeOverride(ReflectionParameter $parameter): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getParameterTypeOverride
|
||||
|
||||
```php
|
||||
public function getParameterTypeOverride(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## resolvePrimitive
|
||||
|
||||
```php
|
||||
public function resolvePrimitive(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## resolveClass
|
||||
|
||||
```php
|
||||
public function resolveClass(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getConcrete
|
||||
|
||||
```php
|
||||
public function getConcrete(string $abstract): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## isBuildable
|
||||
|
||||
```php
|
||||
public function isBuildable(mixed $concrete, string $abstract): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| concrete | mixed | |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## isShared
|
||||
|
||||
```php
|
||||
public function isShared(string $abstract): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## shouldLog
|
||||
|
||||
```php
|
||||
public function shouldLog(): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## log
|
||||
|
||||
```php
|
||||
public function log(string $message): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
134
docs/api/ZM/Container/ContainerServicesProvider.md
Normal file
134
docs/api/ZM/Container/ContainerServicesProvider.md
Normal file
@@ -0,0 +1,134 @@
|
||||
# ZM\Container\ContainerServicesProvider
|
||||
|
||||
## registerServices
|
||||
|
||||
```php
|
||||
public function registerServices(string $scope, mixed $params): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| scope | string | |
|
||||
| params | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## cleanup
|
||||
|
||||
```php
|
||||
public function cleanup(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## registerGlobalServices
|
||||
|
||||
```php
|
||||
public function registerGlobalServices(ZM\Container\ContainerInterface $container): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## registerRequestServices
|
||||
|
||||
```php
|
||||
public function registerRequestServices(ZM\Container\ContainerInterface $container, OneBot\Driver\Event\Http\HttpRequestEvent $event): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
| event | OneBot\Driver\Event\Http\HttpRequestEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## registerMessageServices
|
||||
|
||||
```php
|
||||
public function registerMessageServices(ZM\Container\ContainerInterface $container): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## registerConnectionServices
|
||||
|
||||
```php
|
||||
public function registerConnectionServices(ZM\Container\ContainerInterface $container): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| container | ZM\Container\ContainerInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
842
docs/api/ZM/Container/WorkerContainer.md
Normal file
842
docs/api/ZM/Container/WorkerContainer.md
Normal file
@@ -0,0 +1,842 @@
|
||||
# ZM\Container\WorkerContainer
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
|
||||
|
||||
## bound
|
||||
|
||||
```php
|
||||
public function bound(string $abstract): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getAlias
|
||||
|
||||
```php
|
||||
public function getAlias(string $abstract): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## alias
|
||||
|
||||
```php
|
||||
public function alias(string $abstract, string $alias): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| alias | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## bind
|
||||
|
||||
```php
|
||||
public function bind(string $abstract, mixed $concrete, bool $shared): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
| shared | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## bindIf
|
||||
|
||||
```php
|
||||
public function bindIf(string $abstract, mixed $concrete, bool $shared): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
| shared | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## singleton
|
||||
|
||||
```php
|
||||
public function singleton(string $abstract, mixed $concrete): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## singletonIf
|
||||
|
||||
```php
|
||||
public function singletonIf(string $abstract, mixed $concrete): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## instance
|
||||
|
||||
```php
|
||||
public function instance(string $abstract, mixed $instance): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| instance | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## factory
|
||||
|
||||
```php
|
||||
public function factory(string $abstract): Closure
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Closure | |
|
||||
|
||||
|
||||
## flush
|
||||
|
||||
```php
|
||||
public function flush(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## make
|
||||
|
||||
```php
|
||||
public function make(string $abstract, array $parameters): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| parameters | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## build
|
||||
|
||||
```php
|
||||
public function build(mixed $concrete): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| concrete | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## call
|
||||
|
||||
```php
|
||||
public function call(mixed $callback, array $parameters, string $default_method): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | mixed | |
|
||||
| parameters | array | |
|
||||
| default_method | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## get
|
||||
|
||||
```php
|
||||
public function get(string $id): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## has
|
||||
|
||||
```php
|
||||
public function has(string $id): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## extend
|
||||
|
||||
```php
|
||||
public function extend(string $abstract, Closure $closure): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| closure | Closure | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getLogPrefix
|
||||
|
||||
```php
|
||||
public function getLogPrefix(): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## setLogPrefix
|
||||
|
||||
```php
|
||||
public function setLogPrefix(string $prefix): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prefix | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getExtenders
|
||||
|
||||
```php
|
||||
public function getExtenders(string $abstract): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## isAlias
|
||||
|
||||
```php
|
||||
public function isAlias(string $name): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## dropStaleInstances
|
||||
|
||||
```php
|
||||
public function dropStaleInstances(string $abstract): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getClosure
|
||||
|
||||
```php
|
||||
public function getClosure(string $abstract, string $concrete): Closure
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
| concrete | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Closure | |
|
||||
|
||||
|
||||
## getLastParameterOverride
|
||||
|
||||
```php
|
||||
public function getLastParameterOverride(): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## notInstantiable
|
||||
|
||||
```php
|
||||
public function notInstantiable(string $concrete, string $reason): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| concrete | string | |
|
||||
| reason | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## resolveDependencies
|
||||
|
||||
```php
|
||||
public function resolveDependencies(array $dependencies): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| dependencies | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## hasParameterOverride
|
||||
|
||||
```php
|
||||
public function hasParameterOverride(ReflectionParameter $parameter): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getParameterOverride
|
||||
|
||||
```php
|
||||
public function getParameterOverride(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## hasParameterTypeOverride
|
||||
|
||||
```php
|
||||
public function hasParameterTypeOverride(ReflectionParameter $parameter): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## getParameterTypeOverride
|
||||
|
||||
```php
|
||||
public function getParameterTypeOverride(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## resolvePrimitive
|
||||
|
||||
```php
|
||||
public function resolvePrimitive(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## resolveClass
|
||||
|
||||
```php
|
||||
public function resolveClass(ReflectionParameter $parameter): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parameter | ReflectionParameter | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getConcrete
|
||||
|
||||
```php
|
||||
public function getConcrete(string $abstract): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## isBuildable
|
||||
|
||||
```php
|
||||
public function isBuildable(mixed $concrete, string $abstract): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| concrete | mixed | |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## isShared
|
||||
|
||||
```php
|
||||
public function isShared(string $abstract): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| abstract | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## shouldLog
|
||||
|
||||
```php
|
||||
public function shouldLog(): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## log
|
||||
|
||||
```php
|
||||
public function log(string $message): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| message | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
@@ -1,9 +1,9 @@
|
||||
# ZM\Context\Context
|
||||
|
||||
## getServer
|
||||
## getRequest
|
||||
|
||||
```php
|
||||
public function getServer(): Server
|
||||
public function getRequest(): Psr\Http\Message\ServerRequestInterface
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,189 +14,13 @@ public function getServer(): Server
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Server | |
|
||||
| Psr\Http\Message\ServerRequestInterface | |
|
||||
|
||||
|
||||
## getData
|
||||
## getHttpRequestEvent
|
||||
|
||||
```php
|
||||
public function getData(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## reply
|
||||
|
||||
```php
|
||||
public function reply(mixed $msg, bool $yield): array|bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
only can used by cq->message event function
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| yield | bool | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|bool | |
|
||||
|
||||
|
||||
## finalReply
|
||||
|
||||
```php
|
||||
public function finalReply(mixed $msg, bool $yield): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| yield | bool | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## waitMessage
|
||||
|
||||
```php
|
||||
public function waitMessage(string $prompt, int $timeout, string $timeout_prompt): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prompt | string | |
|
||||
| timeout | int | |
|
||||
| timeout_prompt | string | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## getArgs
|
||||
|
||||
```php
|
||||
public function getArgs(mixed $mode, mixed $prompt_msg): mixed|string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| mode | mixed | |
|
||||
| prompt_msg | mixed | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed|string | |
|
||||
|
||||
|
||||
## getNextArg
|
||||
|
||||
```php
|
||||
public function getNextArg(string $prompt_msg): int|mixed|string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prompt_msg | string | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int|mixed|string | |
|
||||
|
||||
|
||||
## getFullArg
|
||||
|
||||
```php
|
||||
public function getFullArg(string $prompt_msg): int|mixed|string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prompt_msg | string | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int|mixed|string | |
|
||||
|
||||
|
||||
## getNumArg
|
||||
|
||||
```php
|
||||
public function getNumArg(string $prompt_msg): int|mixed|string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| prompt_msg | string | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int|mixed|string | |
|
||||
|
||||
|
||||
## cloneFromParent
|
||||
|
||||
```php
|
||||
public function cloneFromParent(): mixed
|
||||
public function getHttpRequestEvent(): OneBot\Driver\Event\Http\HttpRequestEvent
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -205,6 +29,29 @@ public function cloneFromParent(): mixed
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| OneBot\Driver\Event\Http\HttpRequestEvent | |
|
||||
|
||||
|
||||
## withResponse
|
||||
|
||||
```php
|
||||
public function withResponse(Psr\Http\Message\ResponseInterface $response): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| response | Psr\Http\Message\ResponseInterface | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## initTableList
|
||||
|
||||
```php
|
||||
public function initTableList(mixed $db_name): mixed
|
||||
public function initTableList(string $db_name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,7 +14,8 @@ public function initTableList(mixed $db_name): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| db_name | mixed | |
|
||||
| db_name | string | 数据库名称 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -25,7 +26,7 @@ public function initTableList(mixed $db_name): mixed
|
||||
## table
|
||||
|
||||
```php
|
||||
public function table(mixed $table_name): ZM\DB\Table
|
||||
public function table(string $table_name): Table
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -36,18 +37,19 @@ public function table(mixed $table_name): ZM\DB\Table
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| table_name | mixed | |
|
||||
| table_name | string | 表名 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\DB\Table | |
|
||||
| Table | 返回表对象 |
|
||||
|
||||
|
||||
## statement
|
||||
|
||||
```php
|
||||
public function statement(mixed $line): mixed
|
||||
public function statement(string $line): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -58,7 +60,8 @@ public function statement(mixed $line): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| line | mixed | |
|
||||
| line | string | SQL语句 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -69,7 +72,7 @@ public function statement(mixed $line): mixed
|
||||
## unprepared
|
||||
|
||||
```php
|
||||
public function unprepared(mixed $line): bool
|
||||
public function unprepared(string $line): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -80,9 +83,35 @@ public function unprepared(mixed $line): bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| line | mixed | |
|
||||
| line | string | SQL语句 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
| bool | 返回查询是否成功的结果 |
|
||||
|
||||
|
||||
## rawQuery
|
||||
|
||||
```php
|
||||
public function rawQuery(string $line, array $params, int $fetch_mode): array|false
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| line | string | SQL语句 |
|
||||
| params | array | 查询参数 |
|
||||
| fetch_mode | int | fetch规则 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|false | 返回结果集或false |
|
||||
|
||||
@@ -15,6 +15,7 @@ DeleteBody constructor.
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| table | ZM\DB\Table | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function __construct(mixed $row, ZM\DB\Table $table): mixed
|
||||
public function __construct(Table $table, array|string $row): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,8 +14,9 @@ InsertBody constructor.
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| row | mixed | |
|
||||
| table | ZM\DB\Table | |
|
||||
| table | Table | 表对象 |
|
||||
| row | array|string | 行数据 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -37,7 +37,7 @@ public function count(): int
|
||||
## fetchAll
|
||||
|
||||
```php
|
||||
public function fetchAll(int $fetch_mode): mixed
|
||||
public function fetchAll(mixed $fetch_mode): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -48,7 +48,8 @@ public function fetchAll(int $fetch_mode): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| fetch_mode | int | |
|
||||
| fetch_mode | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -76,7 +77,7 @@ public function fetchFirst(): null|mixed
|
||||
## value
|
||||
|
||||
```php
|
||||
public function value(null $key): null|mixed
|
||||
public function value(null|mixed $key): null|mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -87,7 +88,8 @@ public function value(null $key): null|mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | null | |
|
||||
| key | null|mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -110,6 +112,7 @@ public function execute(int $fetch_mode): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| fetch_mode | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -16,6 +16,7 @@ UpdateBody constructor.
|
||||
| -------- | ---- | ----------- |
|
||||
| table | ZM\DB\Table | |
|
||||
| set_value | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# ZM\Event\EventDispatcher
|
||||
|
||||
## interrupt
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function interrupt(mixed $return_var): mixed
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,9 +14,10 @@ public function interrupt(mixed $return_var): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| return_var | mixed | |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
| object | |
|
||||
|
||||
@@ -15,6 +15,7 @@ public function loadEventByParser(ZM\Annotation\AnnotationParser $parser): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| parser | ZM\Annotation\AnnotationParser | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
117
docs/api/ZM/Event/EventProvider.md
Normal file
117
docs/api/ZM/Event/EventProvider.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# ZM\Event\EventProvider
|
||||
|
||||
## addEventListener
|
||||
|
||||
```php
|
||||
public function addEventListener(mixed $event, callable $callback, int $level): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | mixed | |
|
||||
| callback | callable | |
|
||||
| level | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getEventListeners
|
||||
|
||||
```php
|
||||
public function getEventListeners(string $event_name): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event_name | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## getListenersForEvent
|
||||
|
||||
```php
|
||||
public function getListenersForEvent(object $event): iterable
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | object | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| iterable | |
|
||||
|
||||
|
||||
## sortEvents
|
||||
|
||||
```php
|
||||
public function sortEvents(mixed $name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
69
docs/api/ZM/Event/Listener/HttpEventListener.md
Normal file
69
docs/api/ZM/Event/Listener/HttpEventListener.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# ZM\Event\Listener\HttpEventListener
|
||||
|
||||
## onRequest999
|
||||
|
||||
```php
|
||||
public function onRequest999(OneBot\Driver\Event\Http\HttpRequestEvent $event): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | OneBot\Driver\Event\Http\HttpRequestEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## onRequest1
|
||||
|
||||
```php
|
||||
public function onRequest1(OneBot\Driver\Event\Http\HttpRequestEvent $event): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | OneBot\Driver\Event\Http\HttpRequestEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
57
docs/api/ZM/Event/Listener/ManagerEventListener.md
Normal file
57
docs/api/ZM/Event/Listener/ManagerEventListener.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# ZM\Event\Listener\ManagerEventListener
|
||||
|
||||
## onManagerStart
|
||||
|
||||
```php
|
||||
public function onManagerStart(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## onManagerStop
|
||||
|
||||
```php
|
||||
public function onManagerStop(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
40
docs/api/ZM/Event/Listener/MasterEventListener.md
Normal file
40
docs/api/ZM/Event/Listener/MasterEventListener.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# ZM\Event\Listener\MasterEventListener
|
||||
|
||||
## onMasterStop
|
||||
|
||||
```php
|
||||
public function onMasterStop(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
57
docs/api/ZM/Event/Listener/SignalListener.md
Normal file
57
docs/api/ZM/Event/Listener/SignalListener.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# ZM\Event\Listener\SignalListener
|
||||
|
||||
## signalWorker
|
||||
|
||||
```php
|
||||
public function signalWorker(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## processKillerPrompt
|
||||
|
||||
```php
|
||||
public function processKillerPrompt(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
69
docs/api/ZM/Event/Listener/WSEventListener.md
Normal file
69
docs/api/ZM/Event/Listener/WSEventListener.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# ZM\Event\Listener\WSEventListener
|
||||
|
||||
## onWebSocketOpen
|
||||
|
||||
```php
|
||||
public function onWebSocketOpen(OneBot\Driver\Event\WebSocket\WebSocketOpenEvent $event): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | OneBot\Driver\Event\WebSocket\WebSocketOpenEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## onWebSocketClose
|
||||
|
||||
```php
|
||||
public function onWebSocketClose(OneBot\Driver\Event\WebSocket\WebSocketCloseEvent $event): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | OneBot\Driver\Event\WebSocket\WebSocketCloseEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
108
docs/api/ZM/Event/Listener/WorkerEventListener.md
Normal file
108
docs/api/ZM/Event/Listener/WorkerEventListener.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# ZM\Event\Listener\WorkerEventListener
|
||||
|
||||
## onWorkerStart999
|
||||
|
||||
```php
|
||||
public function onWorkerStart999(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## onWorkerStop999
|
||||
|
||||
```php
|
||||
public function onWorkerStop999(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## initUserPlugins
|
||||
|
||||
```php
|
||||
public function initUserPlugins(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## dispatchInit
|
||||
|
||||
```php
|
||||
public function dispatchInit(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## initConnectionPool
|
||||
|
||||
```php
|
||||
public function initConnectionPool(): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
@@ -1 +1,24 @@
|
||||
# ZM\Event\SwooleEvent\OnMessage
|
||||
# ZM\Event\SwooleEvent\OnMessage
|
||||
|
||||
## registerRequestContainerBindings
|
||||
|
||||
```php
|
||||
public function registerRequestContainerBindings(Swoole\WebSocket\Frame $frame, ZM\ConnectionManager\ConnectionObject $conn): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
注册请求容器绑定
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| frame | Swoole\WebSocket\Frame | |
|
||||
| conn | ZM\ConnectionManager\ConnectionObject | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
@@ -16,6 +16,7 @@ public function onCall(Swoole\Server $server, Swoole\Server\Task $task): mixed
|
||||
| -------- | ---- | ----------- |
|
||||
| server | Swoole\Server | |
|
||||
| task | Swoole\Server\Task | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -15,3 +15,26 @@ public function loadAnnotations(): mixed
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## registerWorkerContainerBindings
|
||||
|
||||
```php
|
||||
public function registerWorkerContainerBindings(Swoole\WebSocket\Server $server): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
注册进程容器绑定
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| server | Swoole\WebSocket\Server | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# ZM\Framework
|
||||
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function __construct(array $args, bool $instant_mode): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
创建一个新的框架实例
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | array | 运行参数 |
|
||||
| instant_mode | bool | 是否为单文件模式 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## saveProcessState
|
||||
|
||||
```php
|
||||
@@ -17,6 +41,7 @@ public function saveProcessState(int|string $pid, int $type, array $data): mixed
|
||||
| pid | int|string | |
|
||||
| type | int | |
|
||||
| data | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -40,6 +65,7 @@ public function getProcessState(mixed $id_or_name, int $type): false|int|mixed
|
||||
| -------- | ---- | ----------- |
|
||||
| id_or_name | mixed | |
|
||||
| type | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -50,7 +76,7 @@ public function getProcessState(mixed $id_or_name, int $type): false|int|mixed
|
||||
## removeProcessState
|
||||
|
||||
```php
|
||||
public function removeProcessState(null $id_or_name, int $type): mixed
|
||||
public function removeProcessState(null|int|string $id_or_name, int $type): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -61,8 +87,9 @@ public function removeProcessState(null $id_or_name, int $type): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| id_or_name | null | |
|
||||
| id_or_name | null|int|string | |
|
||||
| type | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -107,7 +134,7 @@ public function registerServerEvents(): mixed
|
||||
## parseCliArgs
|
||||
|
||||
```php
|
||||
public function parseCliArgs(mixed $args, mixed $add_port): mixed
|
||||
public function parseCliArgs(array $args, bool|string $add_port): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -118,8 +145,9 @@ public function parseCliArgs(mixed $args, mixed $add_port): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
| add_port | mixed | |
|
||||
| args | array | 命令行参数 |
|
||||
| add_port | bool|string | 是否添加端口号 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -17,58 +17,10 @@ public function initHeader(): mixed
|
||||
| mixed | |
|
||||
|
||||
|
||||
## status
|
||||
|
||||
```php
|
||||
public function status(mixed $http_code, mixed $reason, mixed $params): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| http_code | mixed | |
|
||||
| reason | mixed | |
|
||||
| params | mixed | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## setStatusCode
|
||||
|
||||
```php
|
||||
public function setStatusCode(mixed $http_code, mixed $reason, mixed $params): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| http_code | mixed | |
|
||||
| reason | mixed | |
|
||||
| params | mixed | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## header
|
||||
|
||||
```php
|
||||
public function header(mixed $key, mixed $value, mixed $ucwords): mixed
|
||||
public function header(array|string $value, null|array|string $ucwords, string $key): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -79,9 +31,10 @@ public function header(mixed $key, mixed $value, mixed $ucwords): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | mixed | |
|
||||
| value | mixed | |
|
||||
| ucwords | mixed | |
|
||||
| value | array|string | |
|
||||
| ucwords | null|array|string | |
|
||||
| key | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -92,7 +45,7 @@ public function header(mixed $key, mixed $value, mixed $ucwords): mixed
|
||||
## setHeader
|
||||
|
||||
```php
|
||||
public function setHeader(mixed $key, mixed $value, mixed $ucwords): mixed
|
||||
public function setHeader(array|string $value, null|array|string $ucwords, string $key): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -103,9 +56,10 @@ public function setHeader(mixed $key, mixed $value, mixed $ucwords): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | mixed | |
|
||||
| value | mixed | |
|
||||
| ucwords | mixed | |
|
||||
| value | array|string | |
|
||||
| ucwords | null|array|string | |
|
||||
| key | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -116,7 +70,7 @@ public function setHeader(mixed $key, mixed $value, mixed $ucwords): mixed
|
||||
## trailer
|
||||
|
||||
```php
|
||||
public function trailer(mixed $key, mixed $value): mixed
|
||||
public function trailer(array|string $value, string $key): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -127,8 +81,9 @@ public function trailer(mixed $key, mixed $value): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| key | mixed | |
|
||||
| value | mixed | |
|
||||
| value | array|string | |
|
||||
| key | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -156,7 +111,7 @@ public function ping(): mixed
|
||||
## write
|
||||
|
||||
```php
|
||||
public function write(mixed $content): mixed
|
||||
public function write(string|Stringable $content): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -167,7 +122,8 @@ public function write(mixed $content): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| content | mixed | |
|
||||
| content | string|Stringable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -178,7 +134,7 @@ public function write(mixed $content): mixed
|
||||
## end
|
||||
|
||||
```php
|
||||
public function end(mixed $content): mixed
|
||||
public function end(null|string|Stringable $content): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -189,7 +145,8 @@ public function end(mixed $content): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| content | mixed | |
|
||||
| content | null|string|Stringable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -200,7 +157,7 @@ public function end(mixed $content): mixed
|
||||
## sendfile
|
||||
|
||||
```php
|
||||
public function sendfile(mixed $filename, mixed $offset, mixed $length): mixed
|
||||
public function sendfile(null|int|string $offset, null|int|string $length, string $filename): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -211,9 +168,10 @@ public function sendfile(mixed $filename, mixed $offset, mixed $length): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| filename | mixed | |
|
||||
| offset | mixed | |
|
||||
| length | mixed | |
|
||||
| offset | null|int|string | |
|
||||
| length | null|int|string | |
|
||||
| filename | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -224,7 +182,7 @@ public function sendfile(mixed $filename, mixed $offset, mixed $length): mixed
|
||||
## redirect
|
||||
|
||||
```php
|
||||
public function redirect(mixed $location, mixed $http_code): mixed
|
||||
public function redirect(string $location, int $http_code): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -235,8 +193,9 @@ public function redirect(mixed $location, mixed $http_code): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| location | mixed | |
|
||||
| http_code | mixed | |
|
||||
| location | string | |
|
||||
| http_code | int | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -276,6 +235,7 @@ public function create(mixed $fd): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| fd | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -303,7 +263,7 @@ public function upgrade(): mixed
|
||||
## push
|
||||
|
||||
```php
|
||||
public function push(mixed $data, null $opcode, null $flags): mixed
|
||||
public function push(mixed $data, mixed $opcode, mixed $flags): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -315,8 +275,9 @@ public function push(mixed $data, null $opcode, null $flags): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | mixed | |
|
||||
| opcode | null | |
|
||||
| flags | null | |
|
||||
| opcode | mixed | |
|
||||
| flags | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
17
docs/api/ZM/InstantApplication.md
Normal file
17
docs/api/ZM/InstantApplication.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# ZM\InstantApplication
|
||||
|
||||
## run
|
||||
|
||||
```php
|
||||
public function run(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
112
docs/api/ZM/Middleware/MiddlewareHandler.md
Normal file
112
docs/api/ZM/Middleware/MiddlewareHandler.md
Normal file
@@ -0,0 +1,112 @@
|
||||
# ZM\Middleware\MiddlewareHandler
|
||||
|
||||
## bindMiddleware
|
||||
|
||||
```php
|
||||
public function bindMiddleware(callable $callback, string $name, array $params): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | callable | |
|
||||
| name | string | |
|
||||
| params | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## process
|
||||
|
||||
```php
|
||||
public function process(callable $callback, mixed $args): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | callable | |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getCurrentCallable
|
||||
|
||||
```php
|
||||
public function getCurrentCallable(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getStackId
|
||||
|
||||
```php
|
||||
public function getStackId(callable $callback): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | callable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(mixed $args): object
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| object | |
|
||||
69
docs/api/ZM/Middleware/Pipeline.md
Normal file
69
docs/api/ZM/Middleware/Pipeline.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# ZM\Middleware\Pipeline
|
||||
|
||||
## send
|
||||
|
||||
```php
|
||||
public function send(mixed $value): ZM\Middleware\Pipeline
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| value | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Middleware\Pipeline | |
|
||||
|
||||
|
||||
## through
|
||||
|
||||
```php
|
||||
public function through(array $middlewares): ZM\Middleware\Pipeline
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| middlewares | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Middleware\Pipeline | |
|
||||
|
||||
|
||||
## then
|
||||
|
||||
```php
|
||||
public function then(callable $callback): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| callback | callable | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
@@ -1,17 +1,57 @@
|
||||
# ZM\Module\ModuleBase
|
||||
|
||||
## getModuleName
|
||||
## __construct
|
||||
|
||||
```php
|
||||
public function getModuleName(): mixed
|
||||
public function __construct(string $module_name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| module_name | string | 模块名称 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getModuleName
|
||||
|
||||
```php
|
||||
public function getModuleName(): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
获取模块名称
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
|
||||
|
||||
## getEvents
|
||||
|
||||
```php
|
||||
public function getEvents(): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
获取事件列表
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
@@ -15,6 +15,7 @@ public function __construct(array $module): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| module | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -25,7 +26,7 @@ public function __construct(array $module): mixed
|
||||
## setOutputPath
|
||||
|
||||
```php
|
||||
public function setOutputPath(mixed $path): mixed
|
||||
public function setOutputPath(string $path): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -36,7 +37,8 @@ public function setOutputPath(mixed $path): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| path | mixed | |
|
||||
| path | string | 输出路径 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -59,6 +61,7 @@ public function setOverride(bool $override): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| override | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -18,6 +18,7 @@ public function unpack(mixed $ignore_depends, bool $override_light_cache, bool $
|
||||
| override_light_cache | bool | |
|
||||
| override_data_files | bool | |
|
||||
| override_source | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -57,6 +58,7 @@ public function checkDepends(mixed $ignore_depends): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| ignore_depends | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -113,6 +115,7 @@ public function copyZMDataStore(mixed $override_data): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| override_data | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -1,9 +1,26 @@
|
||||
# ZM\Module\QQBot
|
||||
|
||||
## handleByEvent
|
||||
|
||||
```php
|
||||
public function handleByEvent(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## handle
|
||||
|
||||
```php
|
||||
public function handle(mixed $data, int $level): mixed
|
||||
public function handle(array|Iterator $data, int $level): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,8 +31,9 @@ public function handle(mixed $data, int $level): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | mixed | |
|
||||
| level | int | |
|
||||
| data | array|Iterator | 数据包 |
|
||||
| level | int | 递归等级 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -26,7 +44,7 @@ public function handle(mixed $data, int $level): mixed
|
||||
## dispatchBeforeEvents
|
||||
|
||||
```php
|
||||
public function dispatchBeforeEvents(mixed $data, mixed $time): ZM\Event\EventDispatcher
|
||||
public function dispatchBeforeEvents(array|Iterator $data, string $time): ZM\Event\EventDispatcher
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -37,8 +55,9 @@ public function dispatchBeforeEvents(mixed $data, mixed $time): ZM\Event\EventDi
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | mixed | |
|
||||
| time | mixed | |
|
||||
| data | array|Iterator | 数据包 |
|
||||
| time | string | 类型(pre或post) |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -49,7 +68,7 @@ public function dispatchBeforeEvents(mixed $data, mixed $time): ZM\Event\EventDi
|
||||
## dispatchEvents
|
||||
|
||||
```php
|
||||
public function dispatchEvents(mixed $data): mixed
|
||||
public function dispatchEvents(array|Iterator $data): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -60,7 +79,8 @@ public function dispatchEvents(mixed $data): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | mixed | |
|
||||
| data | array|Iterator | 数据包 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -68,6 +88,29 @@ public function dispatchEvents(mixed $data): mixed
|
||||
| mixed | |
|
||||
|
||||
|
||||
## dispatchAfterEvents
|
||||
|
||||
```php
|
||||
public function dispatchAfterEvents(mixed $data): ZM\Event\EventDispatcher
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| data | mixed | 分发事件数据包 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\Event\EventDispatcher | |
|
||||
|
||||
|
||||
## dispatchAPIResponse
|
||||
|
||||
```php
|
||||
@@ -83,6 +126,7 @@ public function dispatchAPIResponse(mixed $req): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| req | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -93,15 +137,15 @@ public function dispatchAPIResponse(mixed $req): mixed
|
||||
## getInstance
|
||||
|
||||
```php
|
||||
public function getInstance(): self
|
||||
public function getInstance(): static
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
获取类实例
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| self | |
|
||||
| static | |
|
||||
|
||||
@@ -1 +1,93 @@
|
||||
# ZM\MySQL\MySQLConnection
|
||||
# ZM\MySQL\MySQLConnection
|
||||
|
||||
## prepare
|
||||
|
||||
```php
|
||||
public function prepare(mixed $sql, mixed $options): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
| options | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## query
|
||||
|
||||
```php
|
||||
public function query(mixed $args): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## exec
|
||||
|
||||
```php
|
||||
public function exec(mixed $sql): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## lastInsertId
|
||||
|
||||
```php
|
||||
public function lastInsertId(null|mixed $name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | null|mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
@@ -32,6 +32,7 @@ public function putConnection(PDO|PDOProxy $connection): mixed
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| connection | PDO|PDOProxy | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
@@ -1 +1,17 @@
|
||||
# ZM\MySQL\MySQLStatement
|
||||
# ZM\MySQL\MySQLStatement
|
||||
|
||||
## current
|
||||
|
||||
```php
|
||||
public function current(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
@@ -54,7 +54,7 @@ wrapper method
|
||||
## setAutoCommit
|
||||
|
||||
```php
|
||||
public function setAutoCommit(mixed $autoCommit): mixed
|
||||
public function setAutoCommit(bool $auto_commit): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -65,7 +65,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| autoCommit | mixed | |
|
||||
| auto_commit | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -90,6 +91,7 @@ wrapper method
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -114,6 +116,7 @@ wrapper method
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -138,6 +141,7 @@ public function fetchOne(string $query, array $params, array $types): false|mixe
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -165,7 +169,7 @@ wrapper method
|
||||
## delete
|
||||
|
||||
```php
|
||||
public function delete(mixed $table, array $criteria, array $types): int
|
||||
public function delete(string $table, array $criteria, array $types): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -176,9 +180,10 @@ public function delete(mixed $table, array $criteria, array $types): int
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| table | mixed | |
|
||||
| table | string | 表 |
|
||||
| criteria | array | |
|
||||
| types | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -189,7 +194,7 @@ public function delete(mixed $table, array $criteria, array $types): int
|
||||
## setTransactionIsolation
|
||||
|
||||
```php
|
||||
public function setTransactionIsolation(mixed $level): int
|
||||
public function setTransactionIsolation(int $level): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -200,7 +205,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| level | mixed | |
|
||||
| level | int | Sets the transaction isolation level |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -228,7 +234,7 @@ wrapper method
|
||||
## update
|
||||
|
||||
```php
|
||||
public function update(mixed $table, array $data, array $criteria, array $types): int
|
||||
public function update(string $table, array $data, array $criteria, array $types): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -239,10 +245,11 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| table | mixed | |
|
||||
| table | string | 表名 |
|
||||
| data | array | |
|
||||
| criteria | array | |
|
||||
| types | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -253,7 +260,7 @@ wrapper method
|
||||
## insert
|
||||
|
||||
```php
|
||||
public function insert(mixed $table, array $data, array $types): int
|
||||
public function insert(string $table, array $data, array $types): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -264,9 +271,10 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| table | mixed | |
|
||||
| table | string | 表名 |
|
||||
| data | array | |
|
||||
| types | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -277,7 +285,7 @@ wrapper method
|
||||
## quoteIdentifier
|
||||
|
||||
```php
|
||||
public function quoteIdentifier(mixed $str): string
|
||||
public function quoteIdentifier(string $str): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -288,7 +296,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| str | mixed | |
|
||||
| str | string | The name to be quoted |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -299,7 +308,7 @@ wrapper method
|
||||
## quote
|
||||
|
||||
```php
|
||||
public function quote(mixed $value, int $type): mixed
|
||||
public function quote(mixed $value, null|int|string|Type $type): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -311,7 +320,8 @@ wrapper method
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| value | mixed | |
|
||||
| type | int | |
|
||||
| type | null|int|string|Type | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -319,320 +329,6 @@ wrapper method
|
||||
| mixed | |
|
||||
|
||||
|
||||
## fetchAllNumeric
|
||||
|
||||
```php
|
||||
public function fetchAllNumeric(string $query, array $params, array $types): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## fetchAllAssociative
|
||||
|
||||
```php
|
||||
public function fetchAllAssociative(string $query, array $params, array $types): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## fetchAllKeyValue
|
||||
|
||||
```php
|
||||
public function fetchAllKeyValue(string $query, array $params, array $types): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## fetchAllAssociativeIndexed
|
||||
|
||||
```php
|
||||
public function fetchAllAssociativeIndexed(string $query, array $params, array $types): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## fetchFirstColumn
|
||||
|
||||
```php
|
||||
public function fetchFirstColumn(string $query, array $params, array $types): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
|
||||
|
||||
## iterateNumeric
|
||||
|
||||
```php
|
||||
public function iterateNumeric(string $query, array $params, array $types): Traversable
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Traversable | |
|
||||
|
||||
|
||||
## iterateAssociative
|
||||
|
||||
```php
|
||||
public function iterateAssociative(string $query, array $params, array $types): Traversable
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Traversable | |
|
||||
|
||||
|
||||
## iterateKeyValue
|
||||
|
||||
```php
|
||||
public function iterateKeyValue(string $query, array $params, array $types): Traversable
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Traversable | |
|
||||
|
||||
|
||||
## iterateAssociativeIndexed
|
||||
|
||||
```php
|
||||
public function iterateAssociativeIndexed(string $query, array $params, array $types): Traversable
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Traversable | |
|
||||
|
||||
|
||||
## iterateColumn
|
||||
|
||||
```php
|
||||
public function iterateColumn(string $query, array $params, array $types): Traversable
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| query | string | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| Traversable | |
|
||||
|
||||
|
||||
## executeQuery
|
||||
|
||||
```php
|
||||
public function executeQuery(mixed $sql, array $types, array $params, Doctrine\DBAL\Cache\QueryCacheProfile $qcp): ZM\MySQL\MySQLStatementWrapper
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
| types | array | |
|
||||
| params | array | |
|
||||
| qcp | Doctrine\DBAL\Cache\QueryCacheProfile | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\MySQL\MySQLStatementWrapper | |
|
||||
|
||||
|
||||
## executeCacheQuery
|
||||
|
||||
```php
|
||||
public function executeCacheQuery(mixed $sql, mixed $params, mixed $types, Doctrine\DBAL\Cache\QueryCacheProfile $qcp): ZM\MySQL\MySQLStatementWrapper
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
| params | mixed | |
|
||||
| types | mixed | |
|
||||
| qcp | Doctrine\DBAL\Cache\QueryCacheProfile | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| ZM\MySQL\MySQLStatementWrapper | |
|
||||
|
||||
|
||||
## executeStatement
|
||||
|
||||
```php
|
||||
public function executeStatement(mixed $sql, array $params, array $types): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
wrapper method
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
| params | array | |
|
||||
| types | array | |
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
|
||||
## getTransactionNestingLevel
|
||||
|
||||
```php
|
||||
@@ -653,7 +349,7 @@ wrapper method
|
||||
## lastInsertId
|
||||
|
||||
```php
|
||||
public function lastInsertId(null $name): string
|
||||
public function lastInsertId(null|string $name): false|int|string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -664,12 +360,13 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | null | |
|
||||
| name | null|string | name of the sequence object from which the ID should be returned |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| string | |
|
||||
| false|int|string | a string representation of the last inserted ID |
|
||||
|
||||
|
||||
## transactional
|
||||
@@ -687,6 +384,7 @@ overwrite method to $this->connection->transactional()
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| func | Closure | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -697,7 +395,7 @@ overwrite method to $this->connection->transactional()
|
||||
## setNestTransactionsWithSavepoints
|
||||
|
||||
```php
|
||||
public function setNestTransactionsWithSavepoints(mixed $nestTransactionsWithSavepoints): mixed
|
||||
public function setNestTransactionsWithSavepoints(bool $nest_transactions_with_savepoints): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -708,7 +406,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| nestTransactionsWithSavepoints | mixed | |
|
||||
| nest_transactions_with_savepoints | bool | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -787,7 +486,7 @@ wrapper method
|
||||
## createSavepoint
|
||||
|
||||
```php
|
||||
public function createSavepoint(mixed $savepoint): mixed
|
||||
public function createSavepoint(string $savepoint): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -798,7 +497,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| savepoint | mixed | |
|
||||
| savepoint | string | the name of the savepoint to create |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -809,7 +509,7 @@ wrapper method
|
||||
## releaseSavepoint
|
||||
|
||||
```php
|
||||
public function releaseSavepoint(mixed $savepoint): mixed
|
||||
public function releaseSavepoint(string $savepoint): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -820,7 +520,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| savepoint | mixed | |
|
||||
| savepoint | string | the name of the savepoint to release |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
@@ -831,7 +532,7 @@ wrapper method
|
||||
## rollbackSavepoint
|
||||
|
||||
```php
|
||||
public function rollbackSavepoint(mixed $savepoint): mixed
|
||||
public function rollbackSavepoint(string $savepoint): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -842,7 +543,8 @@ wrapper method
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| savepoint | mixed | |
|
||||
| savepoint | string | the name of the savepoint to rollback to |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
|
||||
87
docs/api/ZM/Plugin/OneBot12Adapter.md
Normal file
87
docs/api/ZM/Plugin/OneBot12Adapter.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# ZM\Plugin\OneBot12Adapter
|
||||
|
||||
## parseBotCommand
|
||||
|
||||
```php
|
||||
public function parseBotCommand(ZM\Annotation\OneBot\BotCommand $command, array $same_method_annotations): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| command | ZM\Annotation\OneBot\BotCommand | |
|
||||
| same_method_annotations | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## parseCommandArgument
|
||||
|
||||
```php
|
||||
public function parseCommandArgument(): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
|
||||
|
||||
## handleUnknownWSReverseInput
|
||||
|
||||
```php
|
||||
public function handleUnknownWSReverseInput(OneBot\Driver\Event\WebSocket\WebSocketOpenEvent $event): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | OneBot\Driver\Event\WebSocket\WebSocketOpenEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## handleWSReverseInput
|
||||
|
||||
```php
|
||||
public function handleWSReverseInput(OneBot\Driver\Event\WebSocket\WebSocketOpenEvent $event): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| event | OneBot\Driver\Event\WebSocket\WebSocketOpenEvent | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
46
docs/api/ZM/Plugin/PluginManager.md
Normal file
46
docs/api/ZM/Plugin/PluginManager.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# ZM\Plugin\PluginManager
|
||||
|
||||
## addPluginsFromDir
|
||||
|
||||
```php
|
||||
public function addPluginsFromDir(string $dir): int
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| dir | string | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| int | |
|
||||
|
||||
|
||||
## addPlugin
|
||||
|
||||
```php
|
||||
public function addPlugin(array $meta): void
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| meta | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| void | |
|
||||
73
docs/api/ZM/Process/ProcessStateManager.md
Normal file
73
docs/api/ZM/Process/ProcessStateManager.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# ZM\Process\ProcessStateManager
|
||||
|
||||
## removeProcessState
|
||||
|
||||
```php
|
||||
public function removeProcessState(int $type, mixed $id_or_name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type | int | |
|
||||
| id_or_name | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getProcessState
|
||||
|
||||
```php
|
||||
public function getProcessState(int $type, mixed $id_or_name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type | int | |
|
||||
| id_or_name | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## saveProcessState
|
||||
|
||||
```php
|
||||
public function saveProcessState(int $type, mixed $pid, array $data): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| type | int | |
|
||||
| pid | mixed | |
|
||||
| data | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
110
docs/api/ZM/Store/Database/DBConnection.md
Normal file
110
docs/api/ZM/Store/Database/DBConnection.md
Normal file
@@ -0,0 +1,110 @@
|
||||
# ZM\Store\Database\DBConnection
|
||||
|
||||
## prepare
|
||||
|
||||
```php
|
||||
public function prepare(mixed $sql, mixed $options): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
| options | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## query
|
||||
|
||||
```php
|
||||
public function query(mixed $args): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| args | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## exec
|
||||
|
||||
```php
|
||||
public function exec(mixed $sql): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| sql | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## lastInsertId
|
||||
|
||||
```php
|
||||
public function lastInsertId(mixed $name): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| name | mixed | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
|
||||
|
||||
## getPoolName
|
||||
|
||||
```php
|
||||
public function getPoolName(): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| mixed | |
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user