mirror of
https://github.com/cachethq/cachet.git
synced 2026-03-05 10:37:01 +00:00
Compare commits
1020 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bbba6e897 | ||
|
|
0f5008f301 | ||
|
|
0d614fe0c3 | ||
|
|
d8ed965282 | ||
|
|
39092ff18e | ||
|
|
7d297a5c96 | ||
|
|
785fdea56d | ||
|
|
b8198c0d4f | ||
|
|
58f755d136 | ||
|
|
207361d227 | ||
|
|
de5b5bdda5 | ||
|
|
e25472fc18 | ||
|
|
537017925f | ||
|
|
1ddd868449 | ||
|
|
4a6e47c86b | ||
|
|
02b893cc89 | ||
|
|
b8f89e97cd | ||
|
|
42c8ee8adf | ||
|
|
9d0a49b2be | ||
|
|
5de5a5cd91 | ||
|
|
c72974de27 | ||
|
|
676e7be9fb | ||
|
|
cfca0434ba | ||
|
|
8264f72a5a | ||
|
|
3cb6ba237c | ||
|
|
e8e8dc2828 | ||
|
|
8a5b07f8d2 | ||
|
|
98f0d7ed31 | ||
|
|
dc45f7625a | ||
|
|
694727f6d6 | ||
|
|
3f991ddb63 | ||
|
|
17b7aa1ca7 | ||
|
|
62bed608cb | ||
|
|
c089d9f5a5 | ||
|
|
45843a2c89 | ||
|
|
d812485386 | ||
|
|
0746abd2f1 | ||
|
|
534a546efb | ||
|
|
e5166ca42a | ||
|
|
8368c669ce | ||
|
|
b33c31eb81 | ||
|
|
27d97c1287 | ||
|
|
314a310dce | ||
|
|
f2365e6e67 | ||
|
|
025373aa1a | ||
|
|
248918f875 | ||
|
|
9666dc67f9 | ||
|
|
c7af76af56 | ||
|
|
9fe1d2ee50 | ||
|
|
c11daf2898 | ||
|
|
992627f1f2 | ||
|
|
4d27b189d7 | ||
|
|
221735cd40 | ||
|
|
94c768c823 | ||
|
|
9d31926401 | ||
|
|
6b875b8218 | ||
|
|
6806c018af | ||
|
|
26f6bdeaca | ||
|
|
50a7441808 | ||
|
|
ced993af1f | ||
|
|
3f664ca6f6 | ||
|
|
3f59a11ddc | ||
|
|
ab2ab5d606 | ||
|
|
a0e1845658 | ||
|
|
69e1bc3948 | ||
|
|
02816f99c0 | ||
|
|
9edba5aacc | ||
|
|
921116a198 | ||
|
|
4923a59b76 | ||
|
|
705b9e62dc | ||
|
|
149ea9a3ff | ||
|
|
87c261a42d | ||
|
|
ff6d26cc59 | ||
|
|
6c098cc1fa | ||
|
|
47bba0b927 | ||
|
|
7f80b13e2d | ||
|
|
3e834f0104 | ||
|
|
2c26bd7396 | ||
|
|
a1206af764 | ||
|
|
9c4c3d3843 | ||
|
|
a82f1ce09a | ||
|
|
0a6f16a5b9 | ||
|
|
deee3b75ff | ||
|
|
7c19ab8ca0 | ||
|
|
66cb4eed97 | ||
|
|
35c1c603b5 | ||
|
|
6ff497f9f5 | ||
|
|
d1e22ecc56 | ||
|
|
13da2e766d | ||
|
|
ff4720217a | ||
|
|
c678e5e2a6 | ||
|
|
1d52b18c88 | ||
|
|
2a40965ba0 | ||
|
|
e8b5a8268f | ||
|
|
ce6a72c71c | ||
|
|
d766341bb3 | ||
|
|
b18f76c4db | ||
|
|
879e176aa9 | ||
|
|
63ffe93902 | ||
|
|
b968c38605 | ||
|
|
6869d6b257 | ||
|
|
dc8b8eae78 | ||
|
|
1b24cdb1c5 | ||
|
|
51e850ddc2 | ||
|
|
abcb01163d | ||
|
|
224d44a50a | ||
|
|
c691aa0b47 | ||
|
|
5768640c2b | ||
|
|
8533eeda2f | ||
|
|
3a27d21dc1 | ||
|
|
bdef1b1440 | ||
|
|
21fac30350 | ||
|
|
900475c53c | ||
|
|
f19b0d1a46 | ||
|
|
54621631e6 | ||
|
|
a32f50fd5e | ||
|
|
2358f54c3c | ||
|
|
da7af1fca0 | ||
|
|
d907d1eecc | ||
|
|
c80a12f2a3 | ||
|
|
117cf27177 | ||
|
|
ac3888f7c8 | ||
|
|
e5c137f82b | ||
|
|
b224c6ab82 | ||
|
|
2b76a61178 | ||
|
|
0466da8fe9 | ||
|
|
bc50e86948 | ||
|
|
43ac827d5b | ||
|
|
55e20de0a4 | ||
|
|
454a4c5548 | ||
|
|
4209e7fac3 | ||
|
|
f19eff244f | ||
|
|
61673153d5 | ||
|
|
f777f4af6c | ||
|
|
714297e786 | ||
|
|
0a3b2c4be9 | ||
|
|
6d97c2e3ee | ||
|
|
ba99e37380 | ||
|
|
40cb874969 | ||
|
|
aa0b1845e3 | ||
|
|
49820acb47 | ||
|
|
b77722f241 | ||
|
|
5d28a884fb | ||
|
|
b87c6fb835 | ||
|
|
8cc807cfe5 | ||
|
|
5ee7513ed6 | ||
|
|
47edd1bd55 | ||
|
|
1a2d6bac39 | ||
|
|
7f8b1ca787 | ||
|
|
1078bdbb1c | ||
|
|
5761baf3f9 | ||
|
|
ab2d02edea | ||
|
|
fcebd0a454 | ||
|
|
e4f1081155 | ||
|
|
e48230ee70 | ||
|
|
54efdf75fe | ||
|
|
b928c849e9 | ||
|
|
8cf399dd9b | ||
|
|
b73f00c644 | ||
|
|
2cf90be995 | ||
|
|
b4f5df945e | ||
|
|
30f45cd045 | ||
|
|
cf3ff6164c | ||
|
|
cd055cf429 | ||
|
|
45c6c37c65 | ||
|
|
83d6011345 | ||
|
|
44456fbb7a | ||
|
|
4c924ad13d | ||
|
|
63afe19f77 | ||
|
|
6e51e259bb | ||
|
|
23ac8071bc | ||
|
|
90ab166ffa | ||
|
|
30c1653862 | ||
|
|
2c5216aaee | ||
|
|
c117550a8d | ||
|
|
df5eb24efd | ||
|
|
1d399b27ba | ||
|
|
a1b68bb1a5 | ||
|
|
934ccec329 | ||
|
|
75ee24d154 | ||
|
|
76ca6c2db9 | ||
|
|
d099074288 | ||
|
|
9c200c9742 | ||
|
|
7bf96cb07f | ||
|
|
15419507a3 | ||
|
|
0ef759188e | ||
|
|
4fbb0ad83a | ||
|
|
fe43a2ad5b | ||
|
|
d738b6a9c2 | ||
|
|
5ccd601695 | ||
|
|
3e15b84867 | ||
|
|
b2b724969b | ||
|
|
1d619cd892 | ||
|
|
cf4cbfa605 | ||
|
|
1ec12b7702 | ||
|
|
e04cd6b3d0 | ||
|
|
ecae37d613 | ||
|
|
315068f77c | ||
|
|
a9217379ec | ||
|
|
05e8e49035 | ||
|
|
646638e2cd | ||
|
|
cbdfcaad0d | ||
|
|
2b560309a7 | ||
|
|
240062176d | ||
|
|
6e9d5f5e8a | ||
|
|
1c27cf7360 | ||
|
|
0d406b8360 | ||
|
|
617a8da93f | ||
|
|
1c1c80c051 | ||
|
|
5ec5054c08 | ||
|
|
ec2d071a2c | ||
|
|
751859461b | ||
|
|
06962c6ded | ||
|
|
0ba49b2a7c | ||
|
|
a369d4cb08 | ||
|
|
073484076b | ||
|
|
68d5a5c29e | ||
|
|
f71e9c0cc5 | ||
|
|
db9a6cd8f8 | ||
|
|
eb874ade0f | ||
|
|
af51fe8b99 | ||
|
|
2a8dcb7bf0 | ||
|
|
c8d0a7dd39 | ||
|
|
f5fa14ba7a | ||
|
|
e5037429e5 | ||
|
|
f4cc43fc64 | ||
|
|
2905c1339d | ||
|
|
d1152d5d3e | ||
|
|
2f9cc373ce | ||
|
|
586d42ebde | ||
|
|
137dfb2b3c | ||
|
|
43fa00ae1d | ||
|
|
41af00603d | ||
|
|
9cfb1e1ebe | ||
|
|
b1f94b965f | ||
|
|
aa58312454 | ||
|
|
a1b7bb8cce | ||
|
|
9957e2ec15 | ||
|
|
445f5c662a | ||
|
|
fa235857b7 | ||
|
|
2441a23871 | ||
|
|
cdc107fcb2 | ||
|
|
3951f0116a | ||
|
|
24668b768b | ||
|
|
e4518f7039 | ||
|
|
696b0d83c6 | ||
|
|
dbb71e2ae3 | ||
|
|
cfbf1945dd | ||
|
|
3fdf5dc5f7 | ||
|
|
34ca408770 | ||
|
|
7ff9147b30 | ||
|
|
00968ceefe | ||
|
|
c026adb9d6 | ||
|
|
5557edc342 | ||
|
|
98795c8220 | ||
|
|
22158c3250 | ||
|
|
65f0ac62fe | ||
|
|
f730729cf4 | ||
|
|
3a0c052f8b | ||
|
|
b4173d827a | ||
|
|
8c80565535 | ||
|
|
eabe95a00c | ||
|
|
459e79d261 | ||
|
|
48ae3eb3e9 | ||
|
|
a69509b145 | ||
|
|
b5a7919aab | ||
|
|
632582998f | ||
|
|
27f85d941b | ||
|
|
667cb7f155 | ||
|
|
eab75ae831 | ||
|
|
94ffa5462f | ||
|
|
4718d07561 | ||
|
|
869ebcfdff | ||
|
|
61ea28b1aa | ||
|
|
9f8db2255b | ||
|
|
cb18362241 | ||
|
|
d4614d8162 | ||
|
|
8bf9db6155 | ||
|
|
73eb5b000e | ||
|
|
ba3d015093 | ||
|
|
92bda66c12 | ||
|
|
a6f6753fa0 | ||
|
|
e64f3bf8c3 | ||
|
|
2951f9a0db | ||
|
|
53bc4a559a | ||
|
|
7d57b09371 | ||
|
|
9182c61011 | ||
|
|
a3ecfe8d5f | ||
|
|
0507ff3937 | ||
|
|
250676ce89 | ||
|
|
5e3ab3b6ea | ||
|
|
8a47dd873f | ||
|
|
d5a71976d2 | ||
|
|
f072f58cb6 | ||
|
|
a4cd04fd11 | ||
|
|
61b01d7c2d | ||
|
|
6a492b68ad | ||
|
|
857ec067b9 | ||
|
|
03b28a0252 | ||
|
|
0ae45bfca0 | ||
|
|
95caffe82b | ||
|
|
ab370be1c0 | ||
|
|
b1b98f9b55 | ||
|
|
d176cb9b8f | ||
|
|
a78a5ddb04 | ||
|
|
09b4912801 | ||
|
|
e1fa49d1f7 | ||
|
|
83c4a57acc | ||
|
|
78b7582b8d | ||
|
|
2e48fe919a | ||
|
|
ee886cddfd | ||
|
|
1607275d2d | ||
|
|
c1ab3a175c | ||
|
|
666da0125e | ||
|
|
7ff5da78b9 | ||
|
|
4886bb9815 | ||
|
|
d2beb6263e | ||
|
|
dabed137ab | ||
|
|
0d9ec1c164 | ||
|
|
804d661c31 | ||
|
|
f75c9f5500 | ||
|
|
cfe0cefeb3 | ||
|
|
57491b8062 | ||
|
|
3a5405e032 | ||
|
|
b9b282ba7b | ||
|
|
5f2e2d5925 | ||
|
|
89c708de07 | ||
|
|
c57c9db54a | ||
|
|
04af799052 | ||
|
|
7f02aa2bce | ||
|
|
7de9440731 | ||
|
|
9e11f5eba0 | ||
|
|
8035ba81f8 | ||
|
|
d9a885647b | ||
|
|
53889efa8d | ||
|
|
821870f496 | ||
|
|
409d34f251 | ||
|
|
68b0d35d1a | ||
|
|
37598fac3d | ||
|
|
4c5a12ec89 | ||
|
|
2f526d6cb3 | ||
|
|
2fce5f6d6a | ||
|
|
f1772a2108 | ||
|
|
e5c90b25b2 | ||
|
|
412c119131 | ||
|
|
e099b45495 | ||
|
|
8ca809d5a0 | ||
|
|
9cde8277ad | ||
|
|
945f9cdc78 | ||
|
|
be5672c352 | ||
|
|
7759f128d2 | ||
|
|
c84c49c761 | ||
|
|
385391bf1f | ||
|
|
c48f54ec28 | ||
|
|
17ad609424 | ||
|
|
be793a9fd1 | ||
|
|
ffeaed336e | ||
|
|
408e66f793 | ||
|
|
8b9adfb9f8 | ||
|
|
cf19fecdbe | ||
|
|
f5617abd9e | ||
|
|
991b3e68aa | ||
|
|
ef220b1c40 | ||
|
|
e92cb7fb01 | ||
|
|
6efe100064 | ||
|
|
b9ca5f7066 | ||
|
|
66c6460bab | ||
|
|
c73c5d28a1 | ||
|
|
3c1f5cfdf5 | ||
|
|
5fd3abcbd0 | ||
|
|
f3d2b5ba9c | ||
|
|
bc211f2f55 | ||
|
|
39422f060f | ||
|
|
19e3804227 | ||
|
|
036c819922 | ||
|
|
cce211159b | ||
|
|
8c72cb8fa0 | ||
|
|
2a0efac1da | ||
|
|
cf9627ce99 | ||
|
|
d559c47aa0 | ||
|
|
30943eb331 | ||
|
|
ff91bc4de3 | ||
|
|
4be7dc9635 | ||
|
|
6508ebb34a | ||
|
|
f3fec2c58c | ||
|
|
f92b9ff6cb | ||
|
|
65566a51df | ||
|
|
0eee495a38 | ||
|
|
9d3e36cdab | ||
|
|
ce279202c8 | ||
|
|
b25db21444 | ||
|
|
860407533f | ||
|
|
a35430a4fd | ||
|
|
b5b60fff45 | ||
|
|
e46ee644ae | ||
|
|
d8156b0ee3 | ||
|
|
4c49f61376 | ||
|
|
1c4d7f4be3 | ||
|
|
73d1a989ec | ||
|
|
413abe4446 | ||
|
|
41238611b6 | ||
|
|
83fd397818 | ||
|
|
fc015757a7 | ||
|
|
589f1a9562 | ||
|
|
e78c9261f6 | ||
|
|
6bffb66ed2 | ||
|
|
fb4509c8b8 | ||
|
|
b11831d2e0 | ||
|
|
74ec24120e | ||
|
|
7c5e10f367 | ||
|
|
ad9c6fd39a | ||
|
|
1f6e6ff592 | ||
|
|
3572451f1e | ||
|
|
6a3ea90b27 | ||
|
|
7bd93e0170 | ||
|
|
4b668a83ef | ||
|
|
dab47820e0 | ||
|
|
a04d067005 | ||
|
|
81e990b460 | ||
|
|
0771273049 | ||
|
|
963c94a3e7 | ||
|
|
bba87f6c46 | ||
|
|
03f6a786ee | ||
|
|
18281a65ac | ||
|
|
13695c5b1e | ||
|
|
7f6f74419d | ||
|
|
620378b1f2 | ||
|
|
a593dabeb9 | ||
|
|
24d09ccefd | ||
|
|
0817704c25 | ||
|
|
58e00d9fe2 | ||
|
|
f814d13a64 | ||
|
|
66c410a7c4 | ||
|
|
9c15134387 | ||
|
|
73735ab4b4 | ||
|
|
c64df7eed7 | ||
|
|
51a4a1789e | ||
|
|
970d903b48 | ||
|
|
a025ffb915 | ||
|
|
b31cab0654 | ||
|
|
a2d7c49c2a | ||
|
|
49e33d0556 | ||
|
|
ace02a5fa9 | ||
|
|
4c9cae3142 | ||
|
|
61ada5c07d | ||
|
|
f5b6aa42b6 | ||
|
|
6f1d0ceda4 | ||
|
|
5eb1d376cf | ||
|
|
dff9faaa5d | ||
|
|
e5a46a71e7 | ||
|
|
7a09667cc0 | ||
|
|
236d52714d | ||
|
|
0e6ac90f7b | ||
|
|
2e1e7a383d | ||
|
|
44fea779df | ||
|
|
d76fa9465e | ||
|
|
4c793590b2 | ||
|
|
1a9dbe2979 | ||
|
|
e806ef0663 | ||
|
|
a8dd60063e | ||
|
|
bf20a324ac | ||
|
|
34d2191140 | ||
|
|
edb0f4b5cd | ||
|
|
27f1e6b8a4 | ||
|
|
bf88dfced0 | ||
|
|
fb7a15aaa7 | ||
|
|
beca42b532 | ||
|
|
c266a419e0 | ||
|
|
75deb97059 | ||
|
|
7a322d6032 | ||
|
|
025b92c51c | ||
|
|
60108fb7cc | ||
|
|
8ecefc65fb | ||
|
|
1bd54696c9 | ||
|
|
13391165bc | ||
|
|
cc393df964 | ||
|
|
857d91c9ef | ||
|
|
d08283f8a5 | ||
|
|
bcd7763f84 | ||
|
|
043b02c8b2 | ||
|
|
4015f4f150 | ||
|
|
e89c75d8bc | ||
|
|
fcc21ce337 | ||
|
|
5a499cdc76 | ||
|
|
499584a110 | ||
|
|
5307e1014c | ||
|
|
b60c1a9b05 | ||
|
|
46fc1dbc63 | ||
|
|
32b66df5f0 | ||
|
|
031d89ea4a | ||
|
|
e14ebe80e9 | ||
|
|
72233ff4ac | ||
|
|
1db5dcbfe6 | ||
|
|
638f5d0862 | ||
|
|
1bf6f8e8c9 | ||
|
|
a9d9f7ba03 | ||
|
|
ee7d6fc9eb | ||
|
|
a8d60edb6a | ||
|
|
da30282843 | ||
|
|
899065b8e8 | ||
|
|
03eace0b00 | ||
|
|
c765e22164 | ||
|
|
14e1c3d11d | ||
|
|
28893f4702 | ||
|
|
7ddf4277f7 | ||
|
|
94c46d15cf | ||
|
|
147a6add23 | ||
|
|
2a1bd732bd | ||
|
|
4149ee86bf | ||
|
|
9cf600f36c | ||
|
|
d4020aed29 | ||
|
|
cc3f08260e | ||
|
|
696eb48472 | ||
|
|
73820735f5 | ||
|
|
2a12b0ca85 | ||
|
|
af176d7c7a | ||
|
|
1483863dae | ||
|
|
3064663350 | ||
|
|
ce71d7f3ac | ||
|
|
54d1aca33e | ||
|
|
5ef28fba01 | ||
|
|
1a5ef0750a | ||
|
|
fe45d2411c | ||
|
|
819fc9563f | ||
|
|
4c10cb2df9 | ||
|
|
d93ecc85e3 | ||
|
|
cf89f5fcec | ||
|
|
326183311e | ||
|
|
30a4d6e85b | ||
|
|
4c67bf70ff | ||
|
|
ccbc114f62 | ||
|
|
a35ccfdc8b | ||
|
|
4a5c810341 | ||
|
|
de1be2eefe | ||
|
|
76a6500c26 | ||
|
|
3b2359db1d | ||
|
|
be1fccd682 | ||
|
|
37011ad1ff | ||
|
|
62918ee526 | ||
|
|
3ddbc792f4 | ||
|
|
73ddafc935 | ||
|
|
67304c9eb3 | ||
|
|
1c1674d5b4 | ||
|
|
110a6394d9 | ||
|
|
9b0901e161 | ||
|
|
30194967e5 | ||
|
|
77cec21dc5 | ||
|
|
29c3bcf183 | ||
|
|
0b12d4e0c3 | ||
|
|
a88140ed53 | ||
|
|
d82bc57796 | ||
|
|
448f13e671 | ||
|
|
f6318409a7 | ||
|
|
6d52f49461 | ||
|
|
15d00d24ea | ||
|
|
e1581d5388 | ||
|
|
ce1b9e7fe9 | ||
|
|
07c37f13c5 | ||
|
|
a38a29bc2d | ||
|
|
5f1f6d3c04 | ||
|
|
66061d9a8c | ||
|
|
434a7b7b5b | ||
|
|
ba6f9fee43 | ||
|
|
8cd8c35125 | ||
|
|
dd6a1fa956 | ||
|
|
bb691ec427 | ||
|
|
2d648e44ae | ||
|
|
d379e41edf | ||
|
|
6a73d6268d | ||
|
|
592b62b399 | ||
|
|
1a23d84488 | ||
|
|
82e9a94ac7 | ||
|
|
c89691cb2c | ||
|
|
a70d9ce530 | ||
|
|
c75579779f | ||
|
|
ca2b6a7ba4 | ||
|
|
46845f1a8f | ||
|
|
addbe53e2b | ||
|
|
b4d33f2bcb | ||
|
|
210568ff1a | ||
|
|
4775ef43b7 | ||
|
|
b8fa1f0111 | ||
|
|
3b7308dccd | ||
|
|
f5964bef8e | ||
|
|
e6c24ce9f8 | ||
|
|
b8e3dcff55 | ||
|
|
0fed178c34 | ||
|
|
fbc4041bf7 | ||
|
|
32d4aae76e | ||
|
|
b7eac45968 | ||
|
|
39157a74a1 | ||
|
|
b414a4e391 | ||
|
|
87bcd0c87b | ||
|
|
fcac32a67d | ||
|
|
ccc23fa70d | ||
|
|
468f156ceb | ||
|
|
013f873500 | ||
|
|
edd111451e | ||
|
|
e8a3e18d55 | ||
|
|
2e26f6641d | ||
|
|
809c17e7e6 | ||
|
|
b4977e7ada | ||
|
|
7f00501d10 | ||
|
|
3862a8a2f0 | ||
|
|
6cfe07c4fa | ||
|
|
f2fb5b66c1 | ||
|
|
f454172dc8 | ||
|
|
4ab6cd5b1b | ||
|
|
c354c7cc3d | ||
|
|
36c8f086e9 | ||
|
|
4c32a394fe | ||
|
|
4ed8d9b7d5 | ||
|
|
148268d294 | ||
|
|
7076b92003 | ||
|
|
8af729e426 | ||
|
|
6a1048d6a5 | ||
|
|
555dda4bac | ||
|
|
a23bdad59c | ||
|
|
b67419e073 | ||
|
|
8569101551 | ||
|
|
a8e1713fab | ||
|
|
bb106d35fe | ||
|
|
4a07bb4a7f | ||
|
|
d7e10f087b | ||
|
|
09ed3b3e7a | ||
|
|
b1d013e997 | ||
|
|
3649b58fbe | ||
|
|
6cd37a5ab6 | ||
|
|
390a2d289e | ||
|
|
bb77dafea9 | ||
|
|
854679e55e | ||
|
|
d40ffed287 | ||
|
|
ef8f90bc4d | ||
|
|
8d02a5a3a2 | ||
|
|
964a5fc514 | ||
|
|
ce633c6b29 | ||
|
|
8131e21a67 | ||
|
|
36f0f9f2cb | ||
|
|
69bab99855 | ||
|
|
85a49e6386 | ||
|
|
5e9b52d534 | ||
|
|
edfd0156a9 | ||
|
|
6d3294415b | ||
|
|
61d5554c7c | ||
|
|
cd2829ba5b | ||
|
|
5e97ae4398 | ||
|
|
df8e9ea101 | ||
|
|
a8b279c2e6 | ||
|
|
3a76953ed8 | ||
|
|
48e0a775e0 | ||
|
|
728ad547b5 | ||
|
|
ffa6a8f3d6 | ||
|
|
1271470da3 | ||
|
|
152c46e430 | ||
|
|
974fd5015d | ||
|
|
bd6b9fcabf | ||
|
|
77245c3b71 | ||
|
|
efee85685b | ||
|
|
f1c613249a | ||
|
|
e8a5926dfe | ||
|
|
5860678eb5 | ||
|
|
1480385c04 | ||
|
|
4771a134c4 | ||
|
|
6d231fb68a | ||
|
|
be6fdf6890 | ||
|
|
c832aba80a | ||
|
|
24e125857c | ||
|
|
95d9c2424d | ||
|
|
7507a362bd | ||
|
|
d46007c536 | ||
|
|
59967bca9a | ||
|
|
1c9021884a | ||
|
|
1ce7f3d569 | ||
|
|
decc16a72c | ||
|
|
5af115daac | ||
|
|
c3646fd64a | ||
|
|
4e7d4c4581 | ||
|
|
49e4113159 | ||
|
|
654c0265aa | ||
|
|
0eda950dc7 | ||
|
|
2d55697cf4 | ||
|
|
1248c4042f | ||
|
|
9bf6d31131 | ||
|
|
134dfa0b0e | ||
|
|
02d59e3424 | ||
|
|
4897453f5f | ||
|
|
ee1c23b2c9 | ||
|
|
e1ae1a1316 | ||
|
|
66779c3f0b | ||
|
|
7a998f2b69 | ||
|
|
6ba1b1188a | ||
|
|
39b6bfc6d0 | ||
|
|
9ad3b7e606 | ||
|
|
3988cfb6c0 | ||
|
|
9d20e7b3a4 | ||
|
|
d62598dd45 | ||
|
|
746b7aeb2a | ||
|
|
41b8b9660b | ||
|
|
019bb6b7ea | ||
|
|
bda07ea0dd | ||
|
|
9d91e19863 | ||
|
|
9887df6987 | ||
|
|
63d5161010 | ||
|
|
1a783d71f8 | ||
|
|
a288f84fc5 | ||
|
|
1e2b80d8d3 | ||
|
|
d3fcffce72 | ||
|
|
22c39df73f | ||
|
|
8bd46105e6 | ||
|
|
35679a23d0 | ||
|
|
6c048d45d6 | ||
|
|
995fdd4049 | ||
|
|
b6fbe53b28 | ||
|
|
22204811c2 | ||
|
|
a374ae9abd | ||
|
|
b68efe0631 | ||
|
|
ce8e710173 | ||
|
|
8bd510a653 | ||
|
|
efdddfb847 | ||
|
|
22b6af8f0f | ||
|
|
04321db166 | ||
|
|
9bef541057 | ||
|
|
af62c5683f | ||
|
|
238dcbcaeb | ||
|
|
4e9f8772e8 | ||
|
|
710348c0b6 | ||
|
|
7909465e98 | ||
|
|
9fac22b863 | ||
|
|
55429283c0 | ||
|
|
32063510fb | ||
|
|
814fcd844c | ||
|
|
715adda424 | ||
|
|
9ea4698f21 | ||
|
|
a91d0be1a8 | ||
|
|
2091f0ddf0 | ||
|
|
674be657c7 | ||
|
|
2dd393a569 | ||
|
|
9d4ec9c711 | ||
|
|
bc16eda3ec | ||
|
|
1cf63e025b | ||
|
|
92c08b63d7 | ||
|
|
4793617f9b | ||
|
|
d4745ebb7b | ||
|
|
1ba807c724 | ||
|
|
5bbbb4ec58 | ||
|
|
5c3e935b13 | ||
|
|
6afea3674c | ||
|
|
ef159b38e7 | ||
|
|
752d353900 | ||
|
|
5b897f18b9 | ||
|
|
532a7139a3 | ||
|
|
54d3419d5e | ||
|
|
021a842520 | ||
|
|
a08f39f351 | ||
|
|
753fa00d92 | ||
|
|
677caf86c5 | ||
|
|
01ed08dcb1 | ||
|
|
af7258d54f | ||
|
|
127d0d0d55 | ||
|
|
939bdf0c4e | ||
|
|
e9702e4292 | ||
|
|
b4f7adfdfd | ||
|
|
4d7d5b5734 | ||
|
|
43fa49bdd8 | ||
|
|
f16c17c824 | ||
|
|
0f353a3db3 | ||
|
|
4baaf69907 | ||
|
|
1914e54def | ||
|
|
130dc11740 | ||
|
|
ac429b1e2a | ||
|
|
9426c7a9de | ||
|
|
be3a8c4c85 | ||
|
|
bc730a5d95 | ||
|
|
26c0ff9af7 | ||
|
|
dedfda2dc2 | ||
|
|
dbcf567505 | ||
|
|
52119f97cf | ||
|
|
e9e5768406 | ||
|
|
14aea5a1f0 | ||
|
|
ea8531ddc1 | ||
|
|
254c81af1b | ||
|
|
1fc1cd7cba | ||
|
|
b6056faa72 | ||
|
|
4c0fb53ba7 | ||
|
|
bd6b3f09d0 | ||
|
|
b511a91a7f | ||
|
|
093bd8c55c | ||
|
|
a21fae88d4 | ||
|
|
e6a8e25eed | ||
|
|
3c2388e83b | ||
|
|
4fc31445ff | ||
|
|
97cbbc2830 | ||
|
|
2f332a193e | ||
|
|
3fca767624 | ||
|
|
e59a490878 | ||
|
|
c2ad8e14f3 | ||
|
|
1ceaed3911 | ||
|
|
a688b495d7 | ||
|
|
59937229b2 | ||
|
|
1c892f64f0 | ||
|
|
66bd80d080 | ||
|
|
db6faa70d3 | ||
|
|
65023ec7da | ||
|
|
6b4b71552d | ||
|
|
7bd158bb6c | ||
|
|
b408036c76 | ||
|
|
75020a6576 | ||
|
|
c75bdad4fa | ||
|
|
2a15991e16 | ||
|
|
6aedf27300 | ||
|
|
102457b491 | ||
|
|
afa2b3ca7e | ||
|
|
282e61d202 | ||
|
|
e8427cb06b | ||
|
|
3e0d38aa4c | ||
|
|
df0acb40de | ||
|
|
3e9336c598 | ||
|
|
e8bc3fb818 | ||
|
|
08e9705088 | ||
|
|
3ca1ae5d70 | ||
|
|
f7f01c5059 | ||
|
|
c13aece3a4 | ||
|
|
051e26e653 | ||
|
|
3f8471d8da | ||
|
|
eadedeecbf | ||
|
|
8c03c80582 | ||
|
|
4ae9d96f25 | ||
|
|
354bfffc97 | ||
|
|
4384438d46 | ||
|
|
18f98d19f0 | ||
|
|
b8b81f7e1c | ||
|
|
30b05f360d | ||
|
|
d4c1b23b3f | ||
|
|
d3cd8201a6 | ||
|
|
80caeea86a | ||
|
|
a9a5eef275 | ||
|
|
92ab7c8451 | ||
|
|
935fb9c7c1 | ||
|
|
ba57d51142 | ||
|
|
e735dd5dc4 | ||
|
|
49a7b55a12 | ||
|
|
a6d3b69f75 | ||
|
|
91fe0ed72f | ||
|
|
45784c3720 | ||
|
|
c2f8f23159 | ||
|
|
3af02f725b | ||
|
|
d2d605e884 | ||
|
|
7e5ec12c05 | ||
|
|
0973930710 | ||
|
|
a02afa2d28 | ||
|
|
6a18554768 | ||
|
|
00d7c715ff | ||
|
|
8fad9f567b | ||
|
|
6d983a1b21 | ||
|
|
9a964a9aee | ||
|
|
f4b569f2fd | ||
|
|
d40b6cef57 | ||
|
|
cf14483577 | ||
|
|
687b46389d | ||
|
|
b0ec13fa13 | ||
|
|
536ae3502d | ||
|
|
2fbc044057 | ||
|
|
45181bfe5c | ||
|
|
68a0839e13 | ||
|
|
4dd839719f | ||
|
|
600493f1cb | ||
|
|
c4e4035fea | ||
|
|
7ab139f82e | ||
|
|
6b362fd88d | ||
|
|
4f05f910e9 | ||
|
|
fa1a5fff0e | ||
|
|
d20ee2987b | ||
|
|
99cd275a9d | ||
|
|
1478a25008 | ||
|
|
60e9a64a3e | ||
|
|
75588db98e | ||
|
|
082062fa1b | ||
|
|
37d7908606 | ||
|
|
25a3626de5 | ||
|
|
6ee697cf7f | ||
|
|
698b05980d | ||
|
|
32b2a56573 | ||
|
|
be080a10ef | ||
|
|
c466620435 | ||
|
|
7be3aa2552 | ||
|
|
b80b53191b | ||
|
|
a239c34892 | ||
|
|
4a5110ae53 | ||
|
|
30eec9da24 | ||
|
|
5bc7a3e6f7 | ||
|
|
7c1f27c4a1 | ||
|
|
9581c5a394 | ||
|
|
64ff4d73c2 | ||
|
|
a93472f544 | ||
|
|
924eee9752 | ||
|
|
8250e4ebca | ||
|
|
11b4ab5c6c | ||
|
|
77ce0e21f4 | ||
|
|
cd9828275d | ||
|
|
ae7ab7ddc0 | ||
|
|
69e9d75037 | ||
|
|
70a5022740 | ||
|
|
f13b8debe4 | ||
|
|
57f0bebbc5 | ||
|
|
9414456fd1 | ||
|
|
77f19da9b0 | ||
|
|
7136457b49 | ||
|
|
062a16ca5b | ||
|
|
3de15fc5e8 | ||
|
|
f1b54bfe57 | ||
|
|
ba558e69a3 | ||
|
|
bf4ebcde45 | ||
|
|
a77efc12e0 | ||
|
|
92192232ed | ||
|
|
da3e561217 | ||
|
|
885c17054f | ||
|
|
d47121b93d | ||
|
|
a72033ffa2 | ||
|
|
1a7cec53ac | ||
|
|
bab843b4b1 | ||
|
|
889dd47a14 | ||
|
|
9a0d823c9a | ||
|
|
b037965c35 | ||
|
|
b4f1a8af61 | ||
|
|
5e69f23783 | ||
|
|
46cd61e3fe | ||
|
|
63ccab3eff | ||
|
|
82d0e88f68 | ||
|
|
8a3f9196d3 | ||
|
|
c2c815ab14 | ||
|
|
c928c99c8f | ||
|
|
9515d874bf | ||
|
|
532852f943 | ||
|
|
8fb5a3f992 | ||
|
|
59e1b22e18 | ||
|
|
a294b34d64 | ||
|
|
3d0aec3899 | ||
|
|
ed09ca46b8 | ||
|
|
905445d0ca | ||
|
|
1b953038be | ||
|
|
87563640ff | ||
|
|
61d8fb8759 | ||
|
|
d99f95b2d6 | ||
|
|
4a22b1b053 | ||
|
|
912c9e7c04 | ||
|
|
0bff2f9215 | ||
|
|
808bc5201d | ||
|
|
0194dbb634 | ||
|
|
ee0899f5c3 | ||
|
|
8b0f1033e5 | ||
|
|
b68647df8e | ||
|
|
1965dbb3e7 | ||
|
|
8c69123ce2 | ||
|
|
565e686f8c | ||
|
|
68a41ae49f | ||
|
|
bef736e865 | ||
|
|
308ee1bd81 | ||
|
|
3b487ea2ec | ||
|
|
b393557c8a | ||
|
|
bee4055228 | ||
|
|
7cd513a6bd | ||
|
|
cefabcef2d | ||
|
|
5858d8063b | ||
|
|
ade85e24bd | ||
|
|
88efff58cc | ||
|
|
82a9dc9a4e | ||
|
|
4f0383b62b | ||
|
|
73c80992ae | ||
|
|
4b3ec45b03 | ||
|
|
065b1fd168 | ||
|
|
0a682a00f7 | ||
|
|
fcf0cd675a | ||
|
|
32de1d512b | ||
|
|
b1eb57e573 | ||
|
|
3c4ccf00f1 | ||
|
|
79f66fc090 | ||
|
|
a05496f7d0 | ||
|
|
55ffbd74d4 | ||
|
|
91ba722405 | ||
|
|
c5a0ded808 | ||
|
|
3f2f5cd25b | ||
|
|
bbaa1fbfa6 | ||
|
|
0e83999f7d | ||
|
|
3c07529693 | ||
|
|
669fb4857a | ||
|
|
4693faa64f | ||
|
|
0802da8e01 | ||
|
|
f839bc06f5 | ||
|
|
bba4cf8cce | ||
|
|
701f947c33 | ||
|
|
36b36925c9 | ||
|
|
76d3692d9e | ||
|
|
3f7f4e7624 | ||
|
|
e76ecd493e | ||
|
|
d68b248fd7 | ||
|
|
5813364ccb | ||
|
|
8d0a716c2d | ||
|
|
e471796742 | ||
|
|
593dd04a4f | ||
|
|
fcbbfdd84e | ||
|
|
5d958bac81 | ||
|
|
5ce767dccc | ||
|
|
e5ddb65298 | ||
|
|
0c99204016 | ||
|
|
11d68ee3e5 | ||
|
|
2284bc5d3b | ||
|
|
a847cdc97e | ||
|
|
01c690608f | ||
|
|
5aee46d6b7 | ||
|
|
2615efc052 | ||
|
|
e5c6d6af70 | ||
|
|
29e045c458 | ||
|
|
d2c8f414f6 | ||
|
|
fb55beb47b | ||
|
|
84e1770e51 | ||
|
|
7f222677cc | ||
|
|
ec12ab07af | ||
|
|
0094246ee8 | ||
|
|
58a371b10b | ||
|
|
b626b5ee27 |
@@ -8,10 +8,12 @@ DB_HOST=localhost
|
||||
DB_DATABASE=cachet
|
||||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=secret
|
||||
DB_PORT=null
|
||||
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=database
|
||||
CACHET_EMOJI=false
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
@@ -20,7 +22,10 @@ MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ADDRESS=null
|
||||
MAIL_NAME=null
|
||||
MAIL_ENCRYPTION=tls
|
||||
|
||||
REDIS_HOST=null
|
||||
REDIS_DATABASE=null
|
||||
REDIS_PORT=null
|
||||
|
||||
GITHUB_TOKEN=null
|
||||
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1,3 @@
|
||||
* text=auto
|
||||
*.css linguist-vendored
|
||||
*.less linguist-vendored
|
||||
*.scss linguist-vendored
|
||||
|
||||
12
.travis.yml
12
.travis.yml
@@ -4,16 +4,18 @@ php:
|
||||
- 5.5.9
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
sudo: false
|
||||
|
||||
install: travis_retry composer install --no-interaction --ignore-platform-reqs --no-scripts --prefer-source
|
||||
install:
|
||||
- travis_retry composer install --no-interaction --no-scripts --prefer-source
|
||||
|
||||
script:
|
||||
- bash -c 'if [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then vendor/bin/phpunit; fi;'
|
||||
- bash -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi;'
|
||||
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ] || [ "$TRAVIS_PULL_REQUEST" != false ]; then vendor/bin/phpunit; fi
|
||||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi
|
||||
|
||||
after_script:
|
||||
- bash -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi;'
|
||||
- bash -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi;'
|
||||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
|
||||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
|
||||
|
||||
@@ -8,9 +8,7 @@ Feature requests and bug reports should be made by using the [issue tracker](htt
|
||||
|
||||
## Languages
|
||||
|
||||
When needing to add labels, placeholders or general text, you **must not** write directly into the source file, rather make use of the `./resources/lang/` directory.
|
||||
|
||||
Always provide the English translation and copy your English string to all other languages - making sure that the indentation and alignment of the arrays are updated.
|
||||
Any non-English translations must be made on the [Cachet CrowdIn](https://translate.cachethq.io) project. This makes syncing translations much easier.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
@@ -59,7 +57,7 @@ class Foo extends Bar
|
||||
|
||||
If you're still unsure, then take a look at existing code.
|
||||
|
||||
## Introduction into to Git and GitHub
|
||||
## Introduction into Git and GitHub
|
||||
|
||||
If you are new to Git, GitHub and the whole open source software community, welcome! Here are some resources for getting started and understanding what it's all about.
|
||||
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2015 Alt Three Services Limited.
|
||||
Copyright (c) 2015-2016 Alt Three Services Limited.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
16
README.md
16
README.md
@@ -1,8 +1,8 @@
|
||||
# Cachet
|
||||
|
||||
[](https://styleci.io/repos/26730195/)
|
||||
[](https://travis-ci.org/cachethq/Cachet)
|
||||
[](https://scrutinizer-ci.com/g/cachethq/Cachet)
|
||||
[](https://travis-ci.org/CachetHQ/Cachet)
|
||||
[](https://scrutinizer-ci.com/g/CachetHQ/Cachet)
|
||||
[](LICENSE)
|
||||
[](http://translate.cachethq.io/project/cachet)
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
- Subscriber notifications via Email
|
||||
- Two factor authentication, with Google Authenticator
|
||||
|
||||
## Usage in production
|
||||
|
||||
The `master` branch of this repository is a development branch and **should not** be used in production. Instead, please check out the latest tag release.
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 5.5.9+ or newer
|
||||
@@ -28,7 +32,7 @@
|
||||
|
||||
### Development Requirements
|
||||
|
||||
Theses extra dependencies are required to develop Cachet:
|
||||
These extra dependencies are required to develop Cachet:
|
||||
|
||||
- Node.js
|
||||
- Bower
|
||||
@@ -46,7 +50,7 @@ You can now find our documentation at [https://docs.cachethq.io](https://docs.ca
|
||||
|
||||
To test out the demo, you may login to the [Dashboard](https://demo.cachethq.io/dashboard) with the following:
|
||||
|
||||
- **Username:** test@test.com
|
||||
- **Username:** test or test@test.com
|
||||
- **Password:** test123
|
||||
|
||||
The demo is reset every half hour.
|
||||
@@ -54,3 +58,7 @@ The demo is reset every half hour.
|
||||
## Translations
|
||||
|
||||
A special thank you to our [translators](https://crowdin.com/project/cachet/activity_stream), who have allowed us to share Cachet with the world. If you'd like to contribute translations, please check out our [CrowdIn project](https://crowdin.com/project/cachet).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to us at support@alt-three.com. All security vulnerabilities will be promptly addressed.
|
||||
|
||||
103
app/Bus/Commands/Component/AddComponentCommand.php
Normal file
103
app/Bus/Commands/Component/AddComponentCommand.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Component;
|
||||
|
||||
final class AddComponentCommand
|
||||
{
|
||||
/**
|
||||
* The component name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The component description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* The component status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The component link.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $link;
|
||||
|
||||
/**
|
||||
* The component order.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* The component group.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $group_id;
|
||||
|
||||
/**
|
||||
* Is the component enabled?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $enabled;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'description' => 'string',
|
||||
'status' => 'int|min:1|max:4',
|
||||
'link' => 'url',
|
||||
'order' => 'int',
|
||||
'group_id' => 'int',
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new add component command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @param int $status
|
||||
* @param string $link
|
||||
* @param int $order
|
||||
* @param int $group_id
|
||||
* @param bool $enabled
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $description, $status, $link, $order, $group_id, $enabled)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
$this->status = (int) $status;
|
||||
$this->link = $link;
|
||||
$this->order = $order;
|
||||
$this->group_id = $group_id;
|
||||
$this->enabled = $enabled;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/Component/RemoveComponentCommand.php
Normal file
36
app/Bus/Commands/Component/RemoveComponentCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
final class RemoveComponentCommand
|
||||
{
|
||||
/**
|
||||
* The component to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new remove component command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
114
app/Bus/Commands/Component/UpdateComponentCommand.php
Normal file
114
app/Bus/Commands/Component/UpdateComponentCommand.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
final class UpdateComponentCommand
|
||||
{
|
||||
/**
|
||||
* The component to update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* The component name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The component description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* The component status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The component link.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $link;
|
||||
|
||||
/**
|
||||
* The component order.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* The component group.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $group_id;
|
||||
|
||||
/**
|
||||
* Is the component enabled?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $enabled;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'string',
|
||||
'description' => 'string',
|
||||
'status' => 'int|min:1|max:4',
|
||||
'link' => 'url',
|
||||
'order' => 'int',
|
||||
'group_id' => 'int',
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update component command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @param int $status
|
||||
* @param string $link
|
||||
* @param int $order
|
||||
* @param int $group_id
|
||||
* @param bool $enabled
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component, $name, $description, $status, $link, $order, $group_id, $enabled)
|
||||
{
|
||||
$this->component = $component;
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
$this->status = (int) $status;
|
||||
$this->link = $link;
|
||||
$this->order = $order;
|
||||
$this->group_id = $group_id;
|
||||
$this->enabled = $enabled;
|
||||
}
|
||||
}
|
||||
63
app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php
Normal file
63
app/Bus/Commands/ComponentGroup/AddComponentGroupCommand.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
|
||||
|
||||
final class AddComponentGroupCommand
|
||||
{
|
||||
/**
|
||||
* The component group name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The component group description.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* Is the component group collapsed?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $collapsed;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'order' => 'int',
|
||||
'collapsed' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a add component group command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $order
|
||||
* @param bool $collapsed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $order, $collapsed)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->order = (int) $order;
|
||||
$this->collapsed = $collapsed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
final class RemoveComponentGroupCommand
|
||||
{
|
||||
/**
|
||||
* The component group to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new remove component group command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
final class UpdateComponentGroupCommand
|
||||
{
|
||||
/**
|
||||
* The component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* The component group name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The component group description.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* Is the component group collapsed?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $collapsed;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'string',
|
||||
'order' => 'int',
|
||||
'collapsed' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a add component group command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
* @param string $name
|
||||
* @param int $order
|
||||
* @param bool $collapsed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group, $name, $order, $collapsed)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->name = $name;
|
||||
$this->order = (int) $order;
|
||||
$this->collapsed = $collapsed;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/Incident/RemoveIncidentCommand.php
Normal file
36
app/Bus/Commands/Incident/RemoveIncidentCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
final class RemoveIncidentCommand
|
||||
{
|
||||
/**
|
||||
* The incident to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new remove incident command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
132
app/Bus/Commands/Incident/ReportIncidentCommand.php
Normal file
132
app/Bus/Commands/Incident/ReportIncidentCommand.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
final class ReportIncidentCommand
|
||||
{
|
||||
/**
|
||||
* The incident name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The incident status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The incident message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The incident visibility.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $visible;
|
||||
|
||||
/**
|
||||
* The incident component.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $component_id;
|
||||
|
||||
/**
|
||||
* The component status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $component_status;
|
||||
|
||||
/**
|
||||
* Whether to notify about the incident or not.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* The date at which the incident occurred.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $incident_date;
|
||||
|
||||
/**
|
||||
* A given incident template.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $template;
|
||||
|
||||
/**
|
||||
* Variables for the incident template.
|
||||
*
|
||||
* @var string[]|null
|
||||
*/
|
||||
public $template_vars;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'status' => 'required|int|min:0|max:4',
|
||||
'message' => 'string',
|
||||
'visible' => 'bool',
|
||||
'component_id' => 'int|required_with:component_status',
|
||||
'component_status' => 'int|min:1|max:4|required_with:component_id',
|
||||
'notify' => 'bool',
|
||||
'incident_date' => 'string',
|
||||
'template' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new report incident command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $status
|
||||
* @param string $message
|
||||
* @param int $visible
|
||||
* @param int $component_id
|
||||
* @param int $component_status
|
||||
* @param bool $notify
|
||||
* @param string|null $incident_date
|
||||
* @param string|null $template
|
||||
* @param array|null $template_vars
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, array $template_vars = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->status = $status;
|
||||
$this->message = $message;
|
||||
$this->visible = $visible;
|
||||
$this->component_id = $component_id;
|
||||
$this->component_status = $component_status;
|
||||
$this->notify = $notify;
|
||||
$this->incident_date = $incident_date;
|
||||
$this->template = $template;
|
||||
$this->template_vars = $template_vars;
|
||||
}
|
||||
}
|
||||
73
app/Bus/Commands/Incident/ReportMaintenanceCommand.php
Normal file
73
app/Bus/Commands/Incident/ReportMaintenanceCommand.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
final class ReportMaintenanceCommand
|
||||
{
|
||||
/**
|
||||
* The maintenance name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The maintenance message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* Whether to notify about the maintenance or not.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* Timestamp of when the maintenance is due to start.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $timestamp;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'message' => 'string',
|
||||
'notify' => 'bool',
|
||||
'timestamp' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new report maintenance command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $message
|
||||
* @param bool $notify
|
||||
* @param string $timestamp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $message, $notify, $timestamp)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->message = $message;
|
||||
$this->notify = $notify;
|
||||
$this->timestamp = $timestamp;
|
||||
}
|
||||
}
|
||||
142
app/Bus/Commands/Incident/UpdateIncidentCommand.php
Normal file
142
app/Bus/Commands/Incident/UpdateIncidentCommand.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
final class UpdateIncidentCommand
|
||||
{
|
||||
/**
|
||||
* The incident to update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* The incident name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The incident status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The incident message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The incident visibility.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $visible;
|
||||
|
||||
/**
|
||||
* The incident component.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $component_id;
|
||||
|
||||
/**
|
||||
* The component status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $component_status;
|
||||
|
||||
/**
|
||||
* Whether to notify about the incident or not.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* The date that the incident occurred on.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $incident_date;
|
||||
|
||||
/**
|
||||
* A given incident template.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $template;
|
||||
|
||||
/**
|
||||
* Variables for the incident template.
|
||||
*
|
||||
* @var string[]|null
|
||||
*/
|
||||
public $template_vars;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'string',
|
||||
'status' => 'int|min:0|max:4',
|
||||
'message' => 'string',
|
||||
'visible' => 'bool',
|
||||
'component_id' => 'int',
|
||||
'component_status' => 'int|min:1|max:4|required_with:component_id',
|
||||
'notify' => 'bool',
|
||||
'template' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update incident command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param string $name
|
||||
* @param int $status
|
||||
* @param string $message
|
||||
* @param int $visible
|
||||
* @param int $component_id
|
||||
* @param int $component_status
|
||||
* @param bool $notify
|
||||
* @param string|null $incident_date
|
||||
* @param string|null $template
|
||||
* @param array|null $template_vars
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, array $template_vars = null)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
$this->name = $name;
|
||||
$this->status = $status;
|
||||
$this->message = $message;
|
||||
$this->visible = $visible;
|
||||
$this->component_id = $component_id;
|
||||
$this->component_status = $component_status;
|
||||
$this->notify = $notify;
|
||||
$this->incident_date = $incident_date;
|
||||
$this->template = $template;
|
||||
$this->template_vars = $template_vars;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/Invite/ClaimInviteCommand.php
Normal file
36
app/Bus/Commands/Invite/ClaimInviteCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class ClaimInviteCommand
|
||||
{
|
||||
/**
|
||||
* The invite to mark as claimed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new claim invite command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Invite $invite
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Invite $invite)
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
}
|
||||
114
app/Bus/Commands/Metric/AddMetricCommand.php
Normal file
114
app/Bus/Commands/Metric/AddMetricCommand.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
final class AddMetricCommand
|
||||
{
|
||||
/**
|
||||
* The metric name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The metric suffix.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $suffix;
|
||||
|
||||
/**
|
||||
* The metric description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* The metric default value.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $default_value;
|
||||
|
||||
/**
|
||||
* The metric calculation type.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $calc_type;
|
||||
|
||||
/**
|
||||
* The metric display chart.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $display_chart;
|
||||
|
||||
/**
|
||||
* The metric decimal places.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $places;
|
||||
|
||||
/**
|
||||
* The view to show the metric points in.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $default_view;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'suffix' => 'required|string',
|
||||
'description' => 'string',
|
||||
'display_chart' => 'bool',
|
||||
'default_value' => 'int',
|
||||
'calc_type' => 'int',
|
||||
'display_chart' => 'int',
|
||||
'places' => 'int|between:0,4',
|
||||
'default_view' => 'int|between:0,3',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new add metric command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $suffix
|
||||
* @param string $description
|
||||
* @param float $default_value
|
||||
* @param int $calc_type
|
||||
* @param int $display_chart
|
||||
* @param int $places
|
||||
* @param int $default_view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->suffix = $suffix;
|
||||
$this->description = $description;
|
||||
$this->default_value = $default_value;
|
||||
$this->calc_type = $calc_type;
|
||||
$this->display_chart = $display_chart;
|
||||
$this->places = $places;
|
||||
$this->default_view = $default_view;
|
||||
}
|
||||
}
|
||||
64
app/Bus/Commands/Metric/AddMetricPointCommand.php
Normal file
64
app/Bus/Commands/Metric/AddMetricPointCommand.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class AddMetricPointCommand
|
||||
{
|
||||
/**
|
||||
* The metric to add.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* The metric point value.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* The metric point created at.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $created_at;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'value' => 'int',
|
||||
'created_at' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new add metric point command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
* @param int $value
|
||||
* @param string $created_at
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric, $value, $created_at)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
$this->value = $value;
|
||||
$this->created_at = $created_at;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/Metric/RemoveMetricCommand.php
Normal file
36
app/Bus/Commands/Metric/RemoveMetricCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class RemoveMetricCommand
|
||||
{
|
||||
/**
|
||||
* The metric to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new remove metric command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/Metric/RemoveMetricPointCommand.php
Normal file
36
app/Bus/Commands/Metric/RemoveMetricPointCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
final class RemoveMetricPointCommand
|
||||
{
|
||||
/**
|
||||
* The metric point to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new remove metric point command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
}
|
||||
125
app/Bus/Commands/Metric/UpdateMetricCommand.php
Normal file
125
app/Bus/Commands/Metric/UpdateMetricCommand.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class UpdateMetricCommand
|
||||
{
|
||||
/**
|
||||
* The metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* The metric name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The metric suffix.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $suffix;
|
||||
|
||||
/**
|
||||
* The metric description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* The metric default value.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $default_value;
|
||||
|
||||
/**
|
||||
* The metric calculation type.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $calc_type;
|
||||
|
||||
/**
|
||||
* The metric display chart.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $display_chart;
|
||||
|
||||
/**
|
||||
* The metric decimal places.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $places;
|
||||
|
||||
/**
|
||||
* The view to show the metric points in.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $default_view;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'string',
|
||||
'suffix' => 'string',
|
||||
'description' => 'string',
|
||||
'display_chart' => 'bool',
|
||||
'default_value' => 'numeric',
|
||||
'calc_type' => 'int|in:0,1',
|
||||
'display_chart' => 'int',
|
||||
'places' => 'numeric|between:0,4',
|
||||
'default_view' => 'numeric|between:0,4',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update metric command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
* @param string $name
|
||||
* @param string $suffix
|
||||
* @param string $description
|
||||
* @param float $default_value
|
||||
* @param int $calc_type
|
||||
* @param int $display_chart
|
||||
* @param int $places
|
||||
* @param int $default_view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
$this->name = $name;
|
||||
$this->suffix = $suffix;
|
||||
$this->description = $description;
|
||||
$this->default_value = $default_value;
|
||||
$this->calc_type = $calc_type;
|
||||
$this->display_chart = $display_chart;
|
||||
$this->places = $places;
|
||||
$this->default_view = $default_view;
|
||||
}
|
||||
}
|
||||
74
app/Bus/Commands/Metric/UpdateMetricPointCommand.php
Normal file
74
app/Bus/Commands/Metric/UpdateMetricPointCommand.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
final class UpdateMetricPointCommand
|
||||
{
|
||||
/**
|
||||
* The metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $point;
|
||||
|
||||
/**
|
||||
* The metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* The metric point value.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* The metric point created at.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $created_at;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'value' => 'int',
|
||||
'created_at' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update metric point command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $point
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
* @param int $value
|
||||
* @param string $created_at
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $point, Metric $metric, $value, $created_at)
|
||||
{
|
||||
$this->point = $point;
|
||||
$this->metric = $metric;
|
||||
$this->value = $value;
|
||||
$this->created_at = $created_at;
|
||||
}
|
||||
}
|
||||
66
app/Bus/Commands/Subscriber/SubscribeSubscriberCommand.php
Normal file
66
app/Bus/Commands/Subscriber/SubscribeSubscriberCommand.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Subscriber;
|
||||
|
||||
/**
|
||||
* This is the subscribe subscriber command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class SubscribeSubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The subscriber email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The subscriber auto verification.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $verified;
|
||||
|
||||
/**
|
||||
* The subscriptions that we want to add.
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
public $subscriptions;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $rules = [
|
||||
'email' => 'required|email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new subscribe subscriber command instance.
|
||||
*
|
||||
* @param string $email
|
||||
* @param bool $verified
|
||||
* @param null|array $subscriptions
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($email, $verified = false, $subscriptions = null)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->verified = $verified;
|
||||
$this->subscriptions = $subscriptions;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/Subscriber/UnsubscribeSubscriberCommand.php
Normal file
36
app/Bus/Commands/Subscriber/UnsubscribeSubscriberCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
final class UnsubscribeSubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The subscriber to unsubscribe.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a unsubscribe subscriber command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
|
||||
final class UnsubscribeSubscriptionCommand
|
||||
{
|
||||
/**
|
||||
* The subscription to unsubscribe.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscription
|
||||
*/
|
||||
public $subscription;
|
||||
|
||||
/**
|
||||
* Create a unsubscribe subscription command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscription $subscription
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscription $subscription)
|
||||
{
|
||||
$this->subscription = $subscription;
|
||||
}
|
||||
}
|
||||
@@ -9,21 +9,25 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Events;
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class CustomerHasSubscribedEvent
|
||||
final class VerifySubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The customer who has subscribed.
|
||||
* The subscriber to verify.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new customer has subscribed event instance.
|
||||
* Create a verify subscriber command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
72
app/Bus/Commands/User/AddTeamMemberCommand.php
Normal file
72
app/Bus/Commands/User/AddTeamMemberCommand.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class AddTeamMemberCommand
|
||||
{
|
||||
/**
|
||||
* The user username.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $username;
|
||||
|
||||
/**
|
||||
* The user password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $password;
|
||||
|
||||
/**
|
||||
* The user email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The user level.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $level;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'password' => 'string',
|
||||
'level' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new add team member command instance.
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string $email
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($username, $password, $email, $level)
|
||||
{
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
$this->email = $email;
|
||||
$this->level = $level;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/User/GenerateApiTokenCommand.php
Normal file
36
app/Bus/Commands/User/GenerateApiTokenCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class GenerateApiTokenCommand
|
||||
{
|
||||
/**
|
||||
* The user to generate the token.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new generate api token command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
43
app/Bus/Commands/User/InviteTeamMemberCommand.php
Normal file
43
app/Bus/Commands/User/InviteTeamMemberCommand.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class InviteTeamMemberCommand
|
||||
{
|
||||
/**
|
||||
* The invite emails.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $emails;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'emails' => 'required|array|email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new invite team member command instance.
|
||||
*
|
||||
* @param string[] $emails
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(array $emails)
|
||||
{
|
||||
$this->emails = $emails;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Commands/User/RemoveUserCommand.php
Normal file
36
app/Bus/Commands/User/RemoveUserCommand.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class RemoveUserCommand
|
||||
{
|
||||
/**
|
||||
* The user to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new remove user command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
73
app/Bus/Commands/User/SignupUserCommand.php
Normal file
73
app/Bus/Commands/User/SignupUserCommand.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class SignupUserCommand
|
||||
{
|
||||
/**
|
||||
* The user username.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $username;
|
||||
|
||||
/**
|
||||
* The user password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $password;
|
||||
|
||||
/**
|
||||
* The user email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The user level.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $level;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'username' => 'required|string',
|
||||
'password' => 'string',
|
||||
'email' => 'required|string|email',
|
||||
'level' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new signup user command instance.
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string $email
|
||||
* @param int $level
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($username, $password, $email, $level)
|
||||
{
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
$this->email = $email;
|
||||
$this->level = $level;
|
||||
}
|
||||
}
|
||||
19
app/Bus/Events/Component/ComponentEventInterface.php
Normal file
19
app/Bus/Events/Component/ComponentEventInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface ComponentEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
36
app/Bus/Events/Component/ComponentWasAddedEvent.php
Normal file
36
app/Bus/Events/Component/ComponentWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
final class ComponentWasAddedEvent implements ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The component that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Component/ComponentWasRemovedEvent.php
Normal file
36
app/Bus/Events/Component/ComponentWasRemovedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
final class ComponentWasRemovedEvent implements ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The component that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Component/ComponentWasUpdatedEvent.php
Normal file
36
app/Bus/Events/Component/ComponentWasUpdatedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
final class ComponentWasUpdatedEvent implements ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The component that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface ComponentGroupEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
final class ComponentGroupWasAddedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The component group that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
final class ComponentGroupWasRemovedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The component group that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
final class ComponentGroupWasUpdatedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The component group that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
17
app/Bus/Events/EventInterface.php
Normal file
17
app/Bus/Events/EventInterface.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events;
|
||||
|
||||
interface EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
19
app/Bus/Events/Incident/IncidentEventInterface.php
Normal file
19
app/Bus/Events/Incident/IncidentEventInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface IncidentEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
36
app/Bus/Events/Incident/IncidentWasRemovedEvent.php
Normal file
36
app/Bus/Events/Incident/IncidentWasRemovedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
final class IncidentWasRemovedEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident that has been removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new incident was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,11 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Events;
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class IncidentHasReportedEvent
|
||||
final class IncidentWasReportedEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
@@ -24,6 +24,10 @@ class IncidentHasReportedEvent
|
||||
|
||||
/**
|
||||
* Create a new incident has reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
36
app/Bus/Events/Incident/IncidentWasUpdatedEvent.php
Normal file
36
app/Bus/Events/Incident/IncidentWasUpdatedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
final class IncidentWasUpdatedEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident that has been updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new incident has updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,11 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Events;
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class MaintenanceHasScheduledEvent
|
||||
final class MaintenanceWasScheduledEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
@@ -24,6 +24,10 @@ class MaintenanceHasScheduledEvent
|
||||
|
||||
/**
|
||||
* Create a new maintenance has scheduled event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
19
app/Bus/Events/Invite/InviteEventInterface.php
Normal file
19
app/Bus/Events/Invite/InviteEventInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface InviteEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
34
app/Bus/Events/Invite/InviteWasClaimedEvent.php
Normal file
34
app/Bus/Events/Invite/InviteWasClaimedEvent.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class InviteWasClaimedEvent implements InviteEventInterface
|
||||
{
|
||||
/**
|
||||
* The invite that has been claimed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new invite was claimed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Invite $invite)
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
}
|
||||
19
app/Bus/Events/Metric/MetricEventInterface.php
Normal file
19
app/Bus/Events/Metric/MetricEventInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface MetricEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
36
app/Bus/Events/Metric/MetricPointWasAddedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricPointWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
final class MetricPointWasAddedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric point that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new metric point was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Metric/MetricPointWasRemovedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricPointWasRemovedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
final class MetricPointWasRemovedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric point that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new metric point was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $memtricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Metric/MetricPointWasUpdatedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricPointWasUpdatedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
final class MetricPointWasUpdatedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric point that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new metric point was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Metric/MetricWasAddedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class MetricWasAddedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Metric/MetricWasRemovedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricWasRemovedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class MetricWasRemovedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Metric/MetricWasUpdatedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricWasUpdatedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class MetricWasUpdatedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
19
app/Bus/Events/Subscriber/SubscriberEventInterface.php
Normal file
19
app/Bus/Events/Subscriber/SubscriberEventInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface SubscriberEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
36
app/Bus/Events/Subscriber/SubscriberHasSubscribedEvent.php
Normal file
36
app/Bus/Events/Subscriber/SubscriberHasSubscribedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
final class SubscriberHasSubscribedEvent implements SubscriberEventInterface
|
||||
{
|
||||
/**
|
||||
* The subscriber who has subscribed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has subscribed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Subscriber/SubscriberHasUnsubscribedEvent.php
Normal file
36
app/Bus/Events/Subscriber/SubscriberHasUnsubscribedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
final class SubscriberHasUnsubscribedEvent implements SubscriberEventInterface
|
||||
{
|
||||
/**
|
||||
* The subscriber who has unsubscribed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has unsubscribed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
/**
|
||||
* This is the subscriber has updated subscriptions event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class SubscriberHasUpdatedSubscriptionsEvent implements SubscriberEventInterface
|
||||
{
|
||||
/**
|
||||
* The subscriber.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has updated subscriptions event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Subscriber/SubscriberHasVerifiedEvent.php
Normal file
36
app/Bus/Events/Subscriber/SubscriberHasVerifiedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
final class SubscriberHasVerifiedEvent implements SubscriberEventInterface
|
||||
{
|
||||
/**
|
||||
* The subscriber who has verified.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has subscribed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
19
app/Bus/Events/User/UserEventInterface.php
Normal file
19
app/Bus/Events/User/UserEventInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
interface UserEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
36
app/Bus/Events/User/UserWasAddedEvent.php
Normal file
36
app/Bus/Events/User/UserWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class UserWasAddedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/User/UserWasInvitedEvent.php
Normal file
36
app/Bus/Events/User/UserWasInvitedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class UserWasInvitedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The invite that has been added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new user was invite event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Invite $invite
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Invite $invite)
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/User/UserWasRemovedEvent.php
Normal file
36
app/Bus/Events/User/UserWasRemovedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class UserWasRemovedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
23
app/Bus/Exceptions/ExceptionInterface.php
Normal file
23
app/Bus/Exceptions/ExceptionInterface.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Exceptions;
|
||||
|
||||
/**
|
||||
* This is the exception interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ExceptionInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
26
app/Bus/Exceptions/Subscriber/AlreadySubscribedException.php
Normal file
26
app/Bus/Exceptions/Subscriber/AlreadySubscribedException.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Exceptions\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Exceptions\ExceptionInterface;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* This is the already subscribed exception class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class AlreadySubscribedException extends Exception implements ExceptionInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class AddComponentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add component command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public function handle(AddComponentCommand $command)
|
||||
{
|
||||
$component = Component::create($this->filter($command));
|
||||
|
||||
event(new ComponentWasAddedEvent($component));
|
||||
|
||||
return $component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\AddComponentCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(AddComponentCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'name' => $command->name,
|
||||
'description' => $command->description,
|
||||
'link' => $command->link,
|
||||
'status' => $command->status,
|
||||
'enabled' => $command->enabled,
|
||||
'order' => $command->order,
|
||||
'group_id' => $command->group_id,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Component\RemoveComponentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasRemovedEvent;
|
||||
|
||||
class RemoveComponentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove component command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Component\RemoveComponentCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveComponentCommand $command)
|
||||
{
|
||||
$component = $command->component;
|
||||
|
||||
event(new ComponentWasRemovedEvent($component));
|
||||
|
||||
$component->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class UpdateComponentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update component command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public function handle(UpdateComponentCommand $command)
|
||||
{
|
||||
$component = $command->component;
|
||||
|
||||
$component->update($this->filter($command));
|
||||
|
||||
event(new ComponentWasUpdatedEvent($component));
|
||||
|
||||
return $component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateComponentCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateComponentCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'name' => $command->name,
|
||||
'description' => $command->description,
|
||||
'link' => $command->link,
|
||||
'status' => $command->status,
|
||||
'enabled' => $command->enabled,
|
||||
'order' => $command->order,
|
||||
'group_id' => $command->group_id,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class AddComponentGroupCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add component group command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public function handle(AddComponentGroupCommand $command)
|
||||
{
|
||||
$group = ComponentGroup::create([
|
||||
'name' => $command->name,
|
||||
'order' => $command->order,
|
||||
'collapsed' => $command->collapsed,
|
||||
]);
|
||||
|
||||
event(new ComponentGroupWasAddedEvent($group));
|
||||
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\RemoveComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasRemovedEvent;
|
||||
|
||||
class RemoveComponentGroupCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove component group command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\RemoveComponentGroupCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveComponentGroupCommand $command)
|
||||
{
|
||||
$group = $command->group;
|
||||
|
||||
event(new ComponentGroupWasRemovedEvent($group));
|
||||
|
||||
// Remove the group id from all component.
|
||||
$group->components->map(function ($component) {
|
||||
$component->update(['group_id' => 0]);
|
||||
});
|
||||
|
||||
$group->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasUpdatedEvent;
|
||||
|
||||
class UpdateComponentGroupCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update component group command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public function handle(UpdateComponentGroupCommand $command)
|
||||
{
|
||||
$group = $command->group;
|
||||
$group->update($this->filter($command));
|
||||
|
||||
event(new ComponentGroupWasUpdatedEvent($group));
|
||||
|
||||
return $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\UpdateComponentGroupCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateComponentGroupCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'name' => $command->name,
|
||||
'order' => $command->order,
|
||||
'collapsed' => $command->collapsed,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent;
|
||||
|
||||
class RemoveIncidentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveIncidentCommand $command)
|
||||
{
|
||||
$incident = $command->incident;
|
||||
|
||||
event(new IncidentWasRemovedEvent($incident));
|
||||
|
||||
$incident->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use Twig_Loader_String;
|
||||
use TwigBridge\Facade\Twig;
|
||||
|
||||
class ReportIncidentCommandHandler
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new report incident command handler instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the report incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\ReportIncidentCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public function handle(ReportIncidentCommand $command)
|
||||
{
|
||||
$data = [
|
||||
'name' => $command->name,
|
||||
'status' => $command->status,
|
||||
'visible' => $command->visible,
|
||||
];
|
||||
|
||||
if ($command->template) {
|
||||
$data['message'] = $this->parseIncidentTemplate($command->template, $command->template_vars);
|
||||
} else {
|
||||
$data['message'] = $command->message;
|
||||
}
|
||||
|
||||
// Link with the component.
|
||||
if ($command->component_id) {
|
||||
$data['component_id'] = $command->component_id;
|
||||
}
|
||||
|
||||
// The incident occurred at a different time.
|
||||
if ($command->incident_date) {
|
||||
$incidentDate = $this->dates->create('d/m/Y H:i', $command->incident_date);
|
||||
|
||||
$data['created_at'] = $incidentDate;
|
||||
$data['updated_at'] = $incidentDate;
|
||||
}
|
||||
|
||||
// Create the incident
|
||||
$incident = Incident::create($data);
|
||||
|
||||
// Update the component.
|
||||
if ($command->component_id) {
|
||||
Component::find($command->component_id)->update([
|
||||
'status' => $command->component_status,
|
||||
]);
|
||||
}
|
||||
|
||||
$incident->notify = (bool) $command->notify;
|
||||
|
||||
event(new IncidentWasReportedEvent($incident));
|
||||
|
||||
return $incident;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles an incident template into an incident message.
|
||||
*
|
||||
* @param string $templateSlug
|
||||
* @param array $vars
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseIncidentTemplate($templateSlug, $vars)
|
||||
{
|
||||
if ($vars === null) {
|
||||
$vars = [];
|
||||
}
|
||||
|
||||
Twig::setLoader(new Twig_Loader_String());
|
||||
$template = IncidentTemplate::forSlug($templateSlug)->first();
|
||||
|
||||
return Twig::render($template->template, $vars);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\ReportMaintenanceCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class ReportMaintenanceCommandHandler
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new report maintenance command handler instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the report maintenance command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\ReportMaintenanceCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public function handle(ReportMaintenanceCommand $command)
|
||||
{
|
||||
$scheduledAt = $this->dates->create('d/m/Y H:i', $command->timestamp);
|
||||
|
||||
$maintenanceEvent = Incident::create([
|
||||
'name' => $command->name,
|
||||
'message' => $command->message,
|
||||
'scheduled_at' => $scheduledAt,
|
||||
'status' => 0,
|
||||
'visible' => 1,
|
||||
]);
|
||||
|
||||
$maintenanceEvent->notify = (bool) $command->notify;
|
||||
|
||||
event(new MaintenanceWasScheduledEvent($maintenanceEvent));
|
||||
|
||||
return $maintenanceEvent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use Twig_Loader_String;
|
||||
use TwigBridge\Facade\Twig;
|
||||
|
||||
class UpdateIncidentCommandHandler
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new update incident command handler instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the update incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public function handle(UpdateIncidentCommand $command)
|
||||
{
|
||||
if ($command->template) {
|
||||
$command->message = $this->parseIncidentTemplate($command->template, $command->template_vars);
|
||||
}
|
||||
|
||||
$incident = $command->incident;
|
||||
$incident->update($this->filter($command));
|
||||
|
||||
// The incident occurred at a different time.
|
||||
if ($command->incident_date) {
|
||||
$incidentDate = $this->dates->create('d/m/Y H:i', $command->incident_date);
|
||||
|
||||
$incident->update([
|
||||
'created_at' => $incidentDate,
|
||||
'updated_at' => $incidentDate,
|
||||
]);
|
||||
}
|
||||
|
||||
// Update the component.
|
||||
if ($command->component_id) {
|
||||
Component::find($command->component_id)->update([
|
||||
'status' => $command->component_status,
|
||||
]);
|
||||
}
|
||||
|
||||
event(new IncidentWasUpdatedEvent($incident));
|
||||
|
||||
return $incident;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateIncidentCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'name' => $command->name,
|
||||
'status' => $command->status,
|
||||
'message' => $command->message,
|
||||
'visible' => $command->visible,
|
||||
'component_id' => $command->component_id,
|
||||
'component_status' => $command->component_status,
|
||||
'notify' => $command->notify,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles an incident template into an incident message.
|
||||
*
|
||||
* @param string $templateSlug
|
||||
* @param array $vars
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseIncidentTemplate($templateSlug, $vars)
|
||||
{
|
||||
Twig::setLoader(new Twig_Loader_String());
|
||||
$template = IncidentTemplate::forSlug($templateSlug)->first();
|
||||
|
||||
return Twig::render($template->template, $vars);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Invite\ClaimInviteCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Invite\InviteWasClaimedEvent;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ClaimInviteCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the claim invite command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\ClaimInviteCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(ClaimInviteCommand $command)
|
||||
{
|
||||
$invite = $command->invite;
|
||||
|
||||
$invite->claimed_at = Carbon::now();
|
||||
$invite->save();
|
||||
|
||||
event(new InviteWasClaimedEvent($invite));
|
||||
}
|
||||
}
|
||||
44
app/Bus/Handlers/Commands/Metric/AddMetricCommandHandler.php
Normal file
44
app/Bus/Handlers/Commands/Metric/AddMetricCommandHandler.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class AddMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add metric command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public function handle(AddMetricCommand $command)
|
||||
{
|
||||
$metric = Metric::create([
|
||||
'name' => $command->name,
|
||||
'suffix' => $command->suffix,
|
||||
'description' => $command->description,
|
||||
'default_value' => $command->default_value,
|
||||
'calc_type' => $command->calc_type,
|
||||
'display_chart' => $command->display_chart,
|
||||
'places' => $command->places,
|
||||
'default_view' => $command->default_view,
|
||||
]);
|
||||
|
||||
event(new MetricWasAddedEvent($metric));
|
||||
|
||||
return $metric;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
class AddMetricPointCommandHandler
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new add metric point command handler instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the add metric point command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public function handle(AddMetricPointCommand $command)
|
||||
{
|
||||
$metric = $command->metric;
|
||||
$createdAt = $command->created_at;
|
||||
|
||||
$data = [
|
||||
'metric_id' => $metric->id,
|
||||
'value' => $command->value,
|
||||
];
|
||||
|
||||
if ($createdAt) {
|
||||
$data['created_at'] = $this->dates->create('U', $createdAt)->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$metricPoint = MetricPoint::create($data);
|
||||
|
||||
event(new MetricPointWasAddedEvent($metricPoint));
|
||||
|
||||
return $metricPoint;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class RemoveMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove metric command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveMetricCommand $command)
|
||||
{
|
||||
$metric = $command->metric;
|
||||
|
||||
event(new MetricWasRemovedEvent($metric));
|
||||
|
||||
$metric->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricPointCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class RemoveMetricPointCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove metric point command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricPointCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveMetricPointCommand $command)
|
||||
{
|
||||
$metricPoint = $command->metricPoint;
|
||||
|
||||
event(new MetricPointWasRemovedEvent($metricPoint));
|
||||
|
||||
$metricPoint->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class UpdateMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update metric command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public function handle(UpdateMetricCommand $command)
|
||||
{
|
||||
$metric = $command->metric;
|
||||
|
||||
$metric->update($this->filter($command));
|
||||
|
||||
event(new MetricWasUpdatedEvent($metric));
|
||||
|
||||
return $metric;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the command data.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricCommand $command
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filter(UpdateMetricCommand $command)
|
||||
{
|
||||
$params = [
|
||||
'name' => $command->name,
|
||||
'suffix' => $command->suffix,
|
||||
'description' => $command->description,
|
||||
'default_value' => $command->default_value,
|
||||
'calc_type' => $command->calc_type,
|
||||
'display_chart' => $command->display_chart,
|
||||
'places' => $command->places,
|
||||
'default_view' => $command->default_view,
|
||||
];
|
||||
|
||||
return array_filter($params, function ($val) {
|
||||
return $val !== null;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricPointCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
|
||||
class UpdateMetricPointCommandHandler
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new update metric point command handler instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the update metric point command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricPointCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public function handle(UpdateMetricPointCommand $command)
|
||||
{
|
||||
$point = $command->point;
|
||||
$metric = $command->metric;
|
||||
$createdAt = $command->created_at;
|
||||
|
||||
$data = [
|
||||
'metric_id' => $metric->id,
|
||||
'value' => $command->value,
|
||||
];
|
||||
|
||||
if ($createdAt) {
|
||||
$data['created_at'] = $this->dates->create('U', $createdAt)->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$point->update($data);
|
||||
|
||||
event(new MetricPointWasUpdatedEvent($point));
|
||||
|
||||
return $point;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\VerifySubscriberCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUpdatedSubscriptionsEvent;
|
||||
use CachetHQ\Cachet\Bus\Exceptions\Subscriber\AlreadySubscribedException;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
|
||||
/**
|
||||
* This is the subscribe subscriber command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class SubscribeSubscriberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the subscribe subscriber command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand $command
|
||||
*
|
||||
* @throws \CachetHQ\Cachet\Exceptions\AlreadySubscribedException
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public function handle(SubscribeSubscriberCommand $command)
|
||||
{
|
||||
if (Subscriber::where('email', $command->email)->first() && $command->subscriptions === null) {
|
||||
throw new AlreadySubscribedException("Cannot subscribe {$command->email} because they're already subscribed.");
|
||||
}
|
||||
|
||||
$subscriber = Subscriber::firstOrCreate(['email' => $command->email]);
|
||||
|
||||
if ($subscriptions = $command->subscriptions) {
|
||||
foreach ($subscriptions as $subscription => $subscriptionValue) {
|
||||
Subscription::firstOrCreate([
|
||||
'subscriber_id' => $subscriber->id,
|
||||
$subscription => $subscriptionValue,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($subscriber->is_verified === false) {
|
||||
if ($command->verified) {
|
||||
dispatch(new VerifySubscriberCommand($subscriber));
|
||||
} else {
|
||||
event(new SubscriberHasSubscribedEvent($subscriber));
|
||||
}
|
||||
} else {
|
||||
event(new SubscriberHasUpdatedSubscriptionsEvent($subscriber));
|
||||
}
|
||||
|
||||
return $subscriber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUnsubscribedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class UnsubscribeSubscriberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the subscribe customer command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriberCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UnsubscribeSubscriberCommand $command)
|
||||
{
|
||||
$subscriber = $command->subscriber;
|
||||
|
||||
event(new SubscriberHasUnsubscribedEvent($subscriber));
|
||||
|
||||
$subscriber->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasUnsubscribedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
|
||||
class UnsubscribeSubscriptionCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the unsubscribe subscription command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriptionCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UnsubscribeSubscriptionCommand $command)
|
||||
{
|
||||
$subscription = $command->subscription;
|
||||
|
||||
event(new SubscriberHasUnsubscribedEvent($subscription->subscriber));
|
||||
|
||||
$subscription->delete();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\VerifySubscriberCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasVerifiedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class VerifySubscriberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the subscribe customer command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\Subscriber\VerifySubscriberCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(VerifySubscriberCommand $command)
|
||||
{
|
||||
$subscriber = $command->subscriber;
|
||||
|
||||
// Mark the subscriber as verified.
|
||||
$subscriber->verified_at = Carbon::now();
|
||||
$subscriber->save();
|
||||
|
||||
event(new SubscriberHasVerifiedEvent($subscriber));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
class AddTeamMemberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add team member command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public function handle(AddTeamMemberCommand $command)
|
||||
{
|
||||
$user = User::create([
|
||||
'username' => $command->username,
|
||||
'password' => $command->password,
|
||||
'email' => $command->email,
|
||||
'level' => $command->level,
|
||||
]);
|
||||
|
||||
event(new UserWasAddedEvent($user));
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\GenerateApiTokenCommand;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
class GenerateApiTokenCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the generate api key command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\GenerateApiTokenCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(GenerateApiTokenCommand $command)
|
||||
{
|
||||
$user = $command->user;
|
||||
|
||||
$user->api_key = User::generateApiKey();
|
||||
$user->save();
|
||||
|
||||
//event(new GeneratedApiTokenEvent($user));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
class InviteTeamMemberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the invite team member command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(InviteTeamMemberCommand $command)
|
||||
{
|
||||
foreach ($command->emails as $email) {
|
||||
$invite = Invite::create([
|
||||
'email' => $email,
|
||||
]);
|
||||
|
||||
event(new UserWasInvitedEvent($invite));
|
||||
}
|
||||
}
|
||||
}
|
||||
35
app/Bus/Handlers/Commands/User/RemoveUserCommandHandler.php
Normal file
35
app/Bus/Handlers/Commands/User/RemoveUserCommandHandler.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
class RemoveUserCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove user command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveUserCommand $command)
|
||||
{
|
||||
$user = $command->user;
|
||||
|
||||
event(new UserWasRemovedEvent($user));
|
||||
|
||||
$user->delete();
|
||||
}
|
||||
}
|
||||
40
app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php
Normal file
40
app/Bus/Handlers/Commands/User/SignupUserCommandHandler.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\SignupUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
class SignupUserCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the signup user command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\SignupUserCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public function handle(SignupUserCommand $command)
|
||||
{
|
||||
$user = User::create([
|
||||
'username' => $command->username,
|
||||
'password' => $command->password,
|
||||
'email' => $command->email,
|
||||
'level' => User::LEVEL_USER,
|
||||
]);
|
||||
|
||||
event(new UserWasAddedEvent($user));
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
|
||||
|
||||
class SendComponentUpdateEmailNotificationHandler
|
||||
{
|
||||
/**
|
||||
* The mailer instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Mail\Mailer
|
||||
*/
|
||||
protected $mailer;
|
||||
|
||||
/**
|
||||
* Create a new send incident email notification handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(ComponentWasUpdatedEvent $event)
|
||||
{
|
||||
$component = AutoPresenter::decorate($event->component);
|
||||
|
||||
$mail = [
|
||||
'subject' => trans('cachet.subscriber.email.component.subject'),
|
||||
'component_name' => $component->name,
|
||||
'component_human_status' => $component->human_status,
|
||||
];
|
||||
|
||||
foreach (Subscription::isVerifiedForComponent($component->id)->with('subscriber')->get() as $subscription) {
|
||||
$subscriber = $subscription->subscriber;
|
||||
$mail['email'] = $subscriber->email;
|
||||
$mail['unsubscribe_link'] = route('subscribe.unsubscribe', ['code' => $subscriber->verify_code, 'subscription' => $subscription->id]);
|
||||
|
||||
$this->mailer->queue([
|
||||
'html' => 'emails.components.update-html',
|
||||
'text' => 'emails.components.update-text',
|
||||
], $mail, function (Message $message) use ($mail) {
|
||||
$message->to($mail['email'])->subject($mail['subject']);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
|
||||
|
||||
class SendIncidentEmailNotificationHandler
|
||||
{
|
||||
/**
|
||||
* The mailer instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Mail\Mailer
|
||||
*/
|
||||
protected $mailer;
|
||||
|
||||
/**
|
||||
* The subscriber instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
protected $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new send incident email notification handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer, Subscriber $subscriber)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Incident\IncidentHasReportedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(IncidentWasReportedEvent $event)
|
||||
{
|
||||
if (!$event->incident->notify) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$incident = AutoPresenter::decorate($event->incident);
|
||||
$component = AutoPresenter::decorate($event->incident->component);
|
||||
|
||||
// Only send emails for public incidents.
|
||||
if ($event->incident->visible === 1) {
|
||||
foreach ($this->subscriber->isVerified()->get() as $subscriber) {
|
||||
$mail = [
|
||||
'email' => $subscriber->email,
|
||||
'subject' => 'New incident reported.',
|
||||
'has_component' => ($event->incident->component) ? true : false,
|
||||
'component_name' => $component ? $component->name : null,
|
||||
'status' => $incident->human_status,
|
||||
'html_content' => $incident->formattedMessage,
|
||||
'text_content' => $incident->message,
|
||||
'token' => $subscriber->token,
|
||||
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
|
||||
];
|
||||
|
||||
$this->mailer->queue([
|
||||
'html' => 'emails.incidents.new-html',
|
||||
'text' => 'emails.incidents.new-text',
|
||||
], $mail, function (Message $message) use ($mail) {
|
||||
$message->to($mail['email'])->subject($mail['subject']);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;
|
||||
|
||||
class SendMaintenanceEmailNotificationHandler
|
||||
{
|
||||
/**
|
||||
* The mailer instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Mail\MailQueue
|
||||
*/
|
||||
protected $mailer;
|
||||
|
||||
/**
|
||||
* The subscriber instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
protected $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new send maintenance email notification handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer, Subscriber $subscriber)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\MaintenanceHasScheduledEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(MaintenanceWasScheduledEvent $event)
|
||||
{
|
||||
if (!$event->incident->notify) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = AutoPresenter::decorate($event->incident);
|
||||
|
||||
foreach ($this->subscriber->isVerified()->get() as $subscriber) {
|
||||
$mail = [
|
||||
'email' => $subscriber->email,
|
||||
'subject' => 'Scheduled maintenance.',
|
||||
'status' => $data->human_status,
|
||||
'html_content' => $data->formattedMessage,
|
||||
'text_content' => $data->message,
|
||||
'scheduled_at' => $data->scheduled_at_formatted,
|
||||
'token' => $subscriber->token,
|
||||
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
|
||||
];
|
||||
|
||||
$this->mailer->queue([
|
||||
'html' => 'emails.incidents.maintenance-html',
|
||||
'text' => 'emails.incidents.maintenance-text',
|
||||
], $mail, function (Message $message) use ($mail) {
|
||||
$message->to($mail['email'])->subject($mail['subject']);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Handlers\Events;
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Events\CustomerHasSubscribedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
|
||||
@@ -28,6 +28,8 @@ class SendSubscriberVerificationEmailHandler
|
||||
* Create a new send subscriber verification email handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer)
|
||||
{
|
||||
@@ -37,15 +39,16 @@ class SendSubscriberVerificationEmailHandler
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Events\CustomerHasSubscribedEvent $event
|
||||
* @param \CachetHQ\Cachet\Bus\Events\SubscriberHasSubscribedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(CustomerHasSubscribedEvent $event)
|
||||
public function handle(SubscriberHasSubscribedEvent $event)
|
||||
{
|
||||
$mail = [
|
||||
'email' => $event->subscriber->email,
|
||||
'subject' => 'Confirm your subscription.',
|
||||
'link' => route('subscribe-verify', ['code' => $event->subscriber->verify_code]),
|
||||
'appUrl' => env('APP_URL'),
|
||||
'email' => $event->subscriber->email,
|
||||
'subject' => 'Confirm your subscription.',
|
||||
'link' => route('subscribe.verify', ['code' => $event->subscriber->verify_code]),
|
||||
];
|
||||
|
||||
$this->mailer->queue([
|
||||
61
app/Bus/Handlers/Events/User/SendInviteUserEmailHandler.php
Normal file
61
app/Bus/Handlers/Events/User/SendInviteUserEmailHandler.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent;
|
||||
use Illuminate\Contracts\Mail\MailQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
|
||||
class SendInviteUserEmailHandler
|
||||
{
|
||||
/**
|
||||
* The mailer instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Mail\MailQueue
|
||||
*/
|
||||
protected $mailer;
|
||||
|
||||
/**
|
||||
* Create a new send invite user email handler.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Mail\Mailer $mailer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MailQueue $mailer)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\UserWasInvitedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UserWasInvitedEvent $event)
|
||||
{
|
||||
$mail = [
|
||||
'email' => $event->invite->email,
|
||||
'subject' => 'You have been invited.',
|
||||
'link' => route('signup.invite', ['code' => $event->invite->code]),
|
||||
];
|
||||
|
||||
$this->mailer->queue([
|
||||
'html' => 'emails.users.invite-html',
|
||||
'text' => 'emails.users.invite-text',
|
||||
], $mail, function (Message $message) use ($mail) {
|
||||
$message->to($mail['email'])->subject($mail['subject']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,9 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class AppComposer
|
||||
{
|
||||
@@ -20,17 +21,32 @@ class AppComposer
|
||||
* Index page view composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$isEnabled = (bool) Setting::get('enable_subscribers', false);
|
||||
$mailAddress = env('MAIL_ADDRESS', false);
|
||||
$mailFrom = env('MAIL_NAME', false);
|
||||
$view->withAboutApp(Markdown::convertToHtml(Config::get('setting.app_about')));
|
||||
$view->withAppAnalytics(Config::get('setting.app_analytics'));
|
||||
$view->withAppAnalyticsGoSquared(Config::get('setting.app_analytics_go_squared'));
|
||||
$view->withAppAnalyticsPiwikUrl(Config::get('setting.app_analytics_piwik_url'));
|
||||
$view->withAppAnalyticsPiwikSiteId(Config::get('setting.app_analytics_piwik_site_id'));
|
||||
$view->withAppBanner(Config::get('setting.app_banner'));
|
||||
$view->withAppBannerStyleFullWidth(Config::get('setting.style_fullwidth_header'));
|
||||
$view->withAppBannerType(Config::get('setting.app_banner_type'));
|
||||
$view->withAppDomain(Config::get('setting.app_domain'));
|
||||
$view->withAppGraphs(Config::get('setting.display_graphs'));
|
||||
$view->withAppLocale(Config::get('setting.app_locale'));
|
||||
$view->withAppStylesheet(Config::get('setting.stylesheet'));
|
||||
$view->withAppUrl(Config::get('app.url'));
|
||||
|
||||
$withData = [
|
||||
'subscribersEnabled' => $isEnabled && $mailAddress && $mailFrom,
|
||||
];
|
||||
$view->withAppName($name = Config::get('setting.app_name'));
|
||||
$view->withShowSupport($support = Config::get('setting.show_support'));
|
||||
|
||||
$view->with($withData);
|
||||
if ($support) {
|
||||
$view->withSiteTitle(Config::get('setting.app_name').' | Cachet');
|
||||
} else {
|
||||
$view->withSiteTitle(Config::get('setting.app_name'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,17 @@ namespace CachetHQ\Cachet\Composers;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LoggedUserComposer
|
||||
class CurrentUserComposer
|
||||
{
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->with('loggedUser', Auth::user());
|
||||
$view->withCurrentUser(Auth::user());
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user