mirror of
https://github.com/cachethq/cachet.git
synced 2026-03-10 02:37:01 +00:00
Compare commits
1252 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
2311d67624 | ||
|
|
715d65f464 | ||
|
|
fa1a5fff0e | ||
|
|
d20ee2987b | ||
|
|
1ac4b7a64a | ||
|
|
941809037a | ||
|
|
0b8ce37e84 | ||
|
|
0851427f2d | ||
|
|
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 | ||
|
|
860457bfae | ||
|
|
9112e2a58f | ||
|
|
a72033ffa2 | ||
|
|
1a7cec53ac | ||
|
|
bab843b4b1 | ||
|
|
889dd47a14 | ||
|
|
9a0d823c9a | ||
|
|
b037965c35 | ||
|
|
b4f1a8af61 | ||
|
|
5e69f23783 | ||
|
|
46cd61e3fe | ||
|
|
63ccab3eff | ||
|
|
82d0e88f68 | ||
|
|
8a3f9196d3 | ||
|
|
c2c815ab14 | ||
|
|
c928c99c8f | ||
|
|
9515d874bf | ||
|
|
532852f943 | ||
|
|
8fb5a3f992 | ||
|
|
59e1b22e18 | ||
|
|
a294b34d64 | ||
|
|
3d0aec3899 | ||
|
|
ed09ca46b8 | ||
|
|
905445d0ca | ||
|
|
1b953038be | ||
|
|
87563640ff | ||
|
|
b1600bdbee | ||
|
|
2ef8b8411f | ||
|
|
61d8fb8759 | ||
|
|
d99f95b2d6 | ||
|
|
4a22b1b053 | ||
|
|
a55bcb8c48 | ||
|
|
912c9e7c04 | ||
|
|
0bff2f9215 | ||
|
|
808bc5201d | ||
|
|
0194dbb634 | ||
|
|
ee0899f5c3 | ||
|
|
8b0f1033e5 | ||
|
|
b68647df8e | ||
|
|
1965dbb3e7 | ||
|
|
8c69123ce2 | ||
|
|
5c8369344d | ||
|
|
565e686f8c | ||
|
|
68a41ae49f | ||
|
|
bef736e865 | ||
|
|
308ee1bd81 | ||
|
|
3b487ea2ec | ||
|
|
b393557c8a | ||
|
|
bee4055228 | ||
|
|
7cd513a6bd | ||
|
|
8589089a04 | ||
|
|
cefabcef2d | ||
|
|
5858d8063b | ||
|
|
ade85e24bd | ||
|
|
324f8703ce | ||
|
|
9df14837b9 | ||
|
|
e3a3f97957 | ||
|
|
fbfa62d087 | ||
|
|
88efff58cc | ||
|
|
82a9dc9a4e | ||
|
|
4f0383b62b | ||
|
|
73c80992ae | ||
|
|
4b3ec45b03 | ||
|
|
065b1fd168 | ||
|
|
0a682a00f7 | ||
|
|
1c7fb1a434 | ||
|
|
fcf0cd675a | ||
|
|
02f069cdc1 | ||
|
|
1779ac40c9 | ||
|
|
32de1d512b | ||
|
|
e8d3c013a1 | ||
|
|
85efb7d114 | ||
|
|
11d77328dc | ||
|
|
c05e9d9867 | ||
|
|
b1eb57e573 | ||
|
|
3c4ccf00f1 | ||
|
|
79f66fc090 | ||
|
|
a05496f7d0 | ||
|
|
55ffbd74d4 | ||
|
|
f9f2e5c18a | ||
|
|
91ba722405 | ||
|
|
2ac9d3b23e | ||
|
|
848fb3b607 | ||
|
|
7d21a7682c | ||
|
|
e3c38c7461 | ||
|
|
c5a0ded808 | ||
|
|
3f2f5cd25b | ||
|
|
bbaa1fbfa6 | ||
|
|
0e83999f7d | ||
|
|
3c07529693 | ||
|
|
669fb4857a | ||
|
|
4693faa64f | ||
|
|
0802da8e01 | ||
|
|
f839bc06f5 | ||
|
|
bba4cf8cce | ||
|
|
701f947c33 | ||
|
|
36b36925c9 | ||
|
|
76d3692d9e | ||
|
|
3f7f4e7624 | ||
|
|
e76ecd493e | ||
|
|
d68b248fd7 | ||
|
|
5813364ccb | ||
|
|
8d0a716c2d | ||
|
|
e471796742 | ||
|
|
8dd762184e | ||
|
|
593dd04a4f | ||
|
|
fcbbfdd84e | ||
|
|
5d958bac81 | ||
|
|
578d4befef | ||
|
|
549c4e1594 | ||
|
|
5ce767dccc | ||
|
|
60536d5334 | ||
|
|
e5ddb65298 | ||
|
|
ef3c32c5e9 | ||
|
|
11cf7ef2c8 | ||
|
|
0c99204016 | ||
|
|
ca367ff151 | ||
|
|
06ecb4b9fb | ||
|
|
122138402b | ||
|
|
11d68ee3e5 | ||
|
|
14ec134ac1 | ||
|
|
ea0a8dfcff | ||
|
|
6cd10581e4 | ||
|
|
90baf18724 | ||
|
|
2284bc5d3b | ||
|
|
5bdbc87bf2 | ||
|
|
60c7235d94 | ||
|
|
2c8cd19137 | ||
|
|
c1d53a7b42 | ||
|
|
a847cdc97e | ||
|
|
22b0e105ee | ||
|
|
c7b55401d4 | ||
|
|
167b90265f | ||
|
|
bb71d0175f | ||
|
|
f964c03072 | ||
|
|
01c690608f | ||
|
|
5aee46d6b7 | ||
|
|
2615efc052 | ||
|
|
e5c6d6af70 | ||
|
|
46c43a8b82 | ||
|
|
29e045c458 | ||
|
|
d2c8f414f6 | ||
|
|
fb55beb47b | ||
|
|
84e1770e51 | ||
|
|
7f222677cc | ||
|
|
ec12ab07af | ||
|
|
0094246ee8 | ||
|
|
58a371b10b | ||
|
|
ee7a0ec5f2 | ||
|
|
427c8d24a5 | ||
|
|
60e6d99b95 | ||
|
|
18db70b9cd | ||
|
|
3a73a9be5c | ||
|
|
fb933720fc | ||
|
|
a4ce37f29a | ||
|
|
4f3664b3e0 | ||
|
|
b626b5ee27 | ||
|
|
c46c255722 | ||
|
|
971a422258 | ||
|
|
b6de8bf258 | ||
|
|
573a301957 | ||
|
|
d8323f126c | ||
|
|
e6db90a798 | ||
|
|
9d9bec812d | ||
|
|
c9b3760a4d | ||
|
|
fb127fb861 | ||
|
|
2425682381 | ||
|
|
da1c999ca6 | ||
|
|
79aa78cff5 | ||
|
|
4438142348 | ||
|
|
e917e338cd | ||
|
|
da22fa208a | ||
|
|
2cb1d9e07d | ||
|
|
68c458227f | ||
|
|
043690764d | ||
|
|
845d9e1e14 | ||
|
|
68572db6d2 | ||
|
|
5d7b05d857 | ||
|
|
9eb65eba3b | ||
|
|
17492b0dcf | ||
|
|
0f8773a547 | ||
|
|
45f376e564 | ||
|
|
3a44e4a809 | ||
|
|
fea555f2b0 | ||
|
|
9094f37156 | ||
|
|
0e502ed53b | ||
|
|
7f0c2a772d | ||
|
|
e06688aee5 | ||
|
|
bfe2b6ca48 | ||
|
|
7e663d7a76 | ||
|
|
65fe410a93 | ||
|
|
c747f11f3c | ||
|
|
9065b7dccc | ||
|
|
7727dbf33b | ||
|
|
2868f9e052 | ||
|
|
aab2b1fe6e | ||
|
|
1e4a8c8143 | ||
|
|
e002d596b1 | ||
|
|
1e3e1df616 | ||
|
|
6e3d1af85a | ||
|
|
e91cf591ea | ||
|
|
14bbe69509 | ||
|
|
c328575417 | ||
|
|
ecb3a4e1d9 | ||
|
|
71f5de8726 | ||
|
|
38257c6ae6 | ||
|
|
6802609ce6 | ||
|
|
476adef1b0 | ||
|
|
3a83110f50 | ||
|
|
8c4832343d | ||
|
|
a0d354c3e9 | ||
|
|
02cb04d36f | ||
|
|
07861dd245 | ||
|
|
14ac707d76 | ||
|
|
0fba574f5b | ||
|
|
71c30fb0bd | ||
|
|
bf77fbdd33 | ||
|
|
6336bd8905 | ||
|
|
dbbf4a093e | ||
|
|
5190578da9 | ||
|
|
c5f3655d49 | ||
|
|
721df30642 | ||
|
|
b79c8902fc | ||
|
|
bcc72d224f | ||
|
|
679005fe3f | ||
|
|
4990868d9a | ||
|
|
a7a4fe03e4 | ||
|
|
c2678ea89c | ||
|
|
f1bbf0200c | ||
|
|
1a5155dbc5 | ||
|
|
7e14d6d25f | ||
|
|
b003a7aa1c | ||
|
|
2c5549120b | ||
|
|
6a29b306e2 | ||
|
|
f01849f758 | ||
|
|
f592aa08c9 | ||
|
|
691e6fffe7 | ||
|
|
dbda00cef8 | ||
|
|
408141dd8b | ||
|
|
9b43b42e27 | ||
|
|
83955fcff5 | ||
|
|
bf05197c4f | ||
|
|
a72543daa2 | ||
|
|
cbf888d7b7 | ||
|
|
0a321bffd8 | ||
|
|
f74f44048d | ||
|
|
78567f865a | ||
|
|
de9240d295 | ||
|
|
a3235f78d0 | ||
|
|
3da8f3065c | ||
|
|
39091b51b5 | ||
|
|
e250d5e3fe | ||
|
|
8ed0f17761 | ||
|
|
92caf08d1d | ||
|
|
1e6db61066 | ||
|
|
13e5ee548d | ||
|
|
3d328663d5 | ||
|
|
fafcc8880b | ||
|
|
7a283dceb7 | ||
|
|
c1a0fc10ae | ||
|
|
13180cf77d | ||
|
|
903da245ef | ||
|
|
939766bf7d | ||
|
|
977cac091c | ||
|
|
04161678b6 | ||
|
|
793564e0c0 | ||
|
|
ea89254bf6 | ||
|
|
54011d7635 | ||
|
|
62a71554c6 | ||
|
|
e92dd0151a | ||
|
|
0a2f7659aa | ||
|
|
c0f19093e4 | ||
|
|
e858a288a6 | ||
|
|
d20f2cbbc8 | ||
|
|
902d7bd01b | ||
|
|
19d780325e | ||
|
|
b6a6acec4d | ||
|
|
e28a08f6bb | ||
|
|
0d8a3b4efc | ||
|
|
7db305edcc | ||
|
|
74ceb9885b | ||
|
|
d6617b6971 | ||
|
|
c28ba2dfb8 | ||
|
|
e794aedb3a | ||
|
|
2fa2ff9070 | ||
|
|
0f187b323b | ||
|
|
00a480b98b | ||
|
|
69f213a4dc | ||
|
|
cef5c9b1e2 | ||
|
|
0ca1668518 | ||
|
|
814a6cf30b | ||
|
|
b0d1eaafc2 | ||
|
|
e68467a308 | ||
|
|
0c940adc56 | ||
|
|
96dfd5d057 | ||
|
|
91dfa822bc | ||
|
|
3c5a5b49f1 | ||
|
|
c12d901147 | ||
|
|
60dac4664b | ||
|
|
b7dc6ab503 | ||
|
|
d207a2eeeb | ||
|
|
986fb4c588 | ||
|
|
5b1c7a69dd | ||
|
|
f7b53c06f6 | ||
|
|
f9d831bf8a | ||
|
|
dc85aa79c8 | ||
|
|
261b38b308 | ||
|
|
05a103c47d | ||
|
|
f51fc34f6d | ||
|
|
1b8e474223 | ||
|
|
83c671c977 | ||
|
|
e13a47aecb | ||
|
|
2579b8a48e | ||
|
|
9f528584f0 | ||
|
|
a27fe6f8ad | ||
|
|
7578b640bd | ||
|
|
e1681a7021 | ||
|
|
a99aa6be1f | ||
|
|
60f6bec8bc | ||
|
|
26857597f0 | ||
|
|
60409c14fe | ||
|
|
da2eab97aa | ||
|
|
8ab422143d | ||
|
|
14494cc74b | ||
|
|
77834fb493 | ||
|
|
62ac2780cf | ||
|
|
2b43b83455 | ||
|
|
ddf64cc653 | ||
|
|
c52f0ada07 | ||
|
|
a7effcce7a | ||
|
|
1df2d71285 | ||
|
|
9a1e6d4549 | ||
|
|
fad3ed9a51 | ||
|
|
8c4653c18c | ||
|
|
0acc419bab | ||
|
|
70003c6b9c | ||
|
|
5a9e18a592 | ||
|
|
19f21f9096 | ||
|
|
2f2c4c2557 | ||
|
|
027b0b6363 | ||
|
|
5d7964ea53 | ||
|
|
f52f5a1c80 | ||
|
|
44109dd9fb | ||
|
|
b91e128c72 | ||
|
|
f13e0cce2c | ||
|
|
bbb7616f93 | ||
|
|
4284fdbb27 | ||
|
|
c4628d4f5a | ||
|
|
a4cd730665 | ||
|
|
7cd7e595f2 | ||
|
|
ea56ca4cec | ||
|
|
915f84fc07 | ||
|
|
fd2401a302 | ||
|
|
259ec3d3bb | ||
|
|
abd801b69e | ||
|
|
44481c4648 | ||
|
|
99b453bbd9 | ||
|
|
9d879b162e | ||
|
|
49411d8568 | ||
|
|
9c35554a5d | ||
|
|
26ff4dc85a | ||
|
|
2eb4bd1e69 | ||
|
|
5a8f0b3145 | ||
|
|
90b2fe51f8 | ||
|
|
28110f5c8e | ||
|
|
8573b78210 | ||
|
|
4f25318271 | ||
|
|
2669d4330e | ||
|
|
f867d22b96 | ||
|
|
3bc499a093 | ||
|
|
538e22deff | ||
|
|
b591cf188c | ||
|
|
e71c573043 | ||
|
|
3f53d76d07 | ||
|
|
16cb1bd545 | ||
|
|
939ec3be23 | ||
|
|
8ab3209afb | ||
|
|
fa3b80e3af | ||
|
|
d5c4561fd1 | ||
|
|
56802476a6 | ||
|
|
5c6bcae02d | ||
|
|
0076c2d561 | ||
|
|
ca1b5f0658 | ||
|
|
1650093861 | ||
|
|
0862c707d9 | ||
|
|
6d851bf9f3 | ||
|
|
c0980dc7a1 | ||
|
|
c471105fdd | ||
|
|
112a104a6b | ||
|
|
5fe3520137 | ||
|
|
a36ec06b2d | ||
|
|
3c5c8b0096 | ||
|
|
c1fadbf0d7 | ||
|
|
37b89700a6 | ||
|
|
43e75ceca1 | ||
|
|
4f78d7c513 | ||
|
|
397679bc57 | ||
|
|
7bd3a57883 | ||
|
|
2d9dcd9747 | ||
|
|
5ceb700b4c | ||
|
|
0cc0cdc9e3 | ||
|
|
f9744b04bb | ||
|
|
615f9e0d75 | ||
|
|
0aacc038c2 | ||
|
|
8f7b538fac | ||
|
|
bf53768530 | ||
|
|
33a282ca4e | ||
|
|
2e3fa35aca | ||
|
|
b8efd4829e | ||
|
|
78b7e4b8f0 | ||
|
|
50096f6a6f | ||
|
|
c56be4c6e0 | ||
|
|
22332e7969 | ||
|
|
0833f41189 | ||
|
|
3cde840e2b | ||
|
|
7888f5953b | ||
|
|
884c43f160 | ||
|
|
866d73e8f8 | ||
|
|
832db53ef2 | ||
|
|
f1080680bf | ||
|
|
df2ae7726d | ||
|
|
e308ba3aea | ||
|
|
9257135641 | ||
|
|
732ec5c827 | ||
|
|
eb191a52d7 | ||
|
|
9a200684c1 | ||
|
|
036928e53e | ||
|
|
9877023bb4 | ||
|
|
de9745c7cf | ||
|
|
8cdfd90df5 | ||
|
|
afa8c98fbd | ||
|
|
472e2316ae | ||
|
|
92173b65bc | ||
|
|
ff2c255d9e | ||
|
|
9315de8a4c | ||
|
|
7b61ad0445 | ||
|
|
980d34abbc | ||
|
|
620e7fed56 | ||
|
|
d9e515c62d | ||
|
|
48c40952f2 | ||
|
|
55dcf3a277 | ||
|
|
254c578ca2 | ||
|
|
106c1a034a | ||
|
|
d788691006 | ||
|
|
fc31ce13bc | ||
|
|
6b98832f3b | ||
|
|
cac63fe1fc | ||
|
|
5a705f9b62 | ||
|
|
987f045c55 | ||
|
|
d85d035ab1 | ||
|
|
32e97a7fde | ||
|
|
13468239a3 | ||
|
|
ba79d2c8a3 | ||
|
|
e70e228e38 | ||
|
|
3a781c5e66 | ||
|
|
8ec29e9921 | ||
|
|
1e27882b90 | ||
|
|
fad393be1d | ||
|
|
dd8fc60209 | ||
|
|
c06019a554 | ||
|
|
f15f492bf3 | ||
|
|
743ed28fd8 | ||
|
|
90110944ff | ||
|
|
f94a5ec57b | ||
|
|
4245b95406 | ||
|
|
9de5847004 | ||
|
|
6637e49c6c | ||
|
|
b6b5146f16 | ||
|
|
149f043be3 | ||
|
|
f06e9cc88f | ||
|
|
4d8b340397 | ||
|
|
ee66f4c451 | ||
|
|
f550a7369e | ||
|
|
2baf17b9d5 | ||
|
|
fff91417c7 | ||
|
|
2af917ace4 | ||
|
|
049b9ac308 | ||
|
|
0c065ae690 | ||
|
|
d3d744780d | ||
|
|
a1fb287a1b | ||
|
|
4347a5cc0c | ||
|
|
f970ae7100 | ||
|
|
224618b0a4 | ||
|
|
d9414fc25c | ||
|
|
e81b29053a | ||
|
|
672f475a0d | ||
|
|
142473c693 | ||
|
|
cb83f5c0c6 | ||
|
|
3197b5d18d | ||
|
|
4c28335ffe | ||
|
|
e7852e06f8 | ||
|
|
62c2c1c7ea | ||
|
|
b85752b101 | ||
|
|
9355854289 | ||
|
|
99e6f5a234 | ||
|
|
49305a2553 | ||
|
|
97c99d0afc | ||
|
|
3f9ebb8abf | ||
|
|
5540a50fae | ||
|
|
e93fda4d53 | ||
|
|
65b1038b84 | ||
|
|
77e4532319 | ||
|
|
4c67e04786 | ||
|
|
128fdbed19 | ||
|
|
7b3f6fee26 | ||
|
|
c2b69ff547 | ||
|
|
12e940e59c | ||
|
|
eb9d22975d | ||
|
|
c460cd9efe | ||
|
|
a314d8b838 | ||
|
|
8299afaa8a | ||
|
|
40a65fe7e2 | ||
|
|
d8811c974b | ||
|
|
ea94f6dd9e | ||
|
|
fb8990dff2 | ||
|
|
32029c0bf1 | ||
|
|
6b70ca7eac | ||
|
|
7aba6e31ea | ||
|
|
c0db4d883a | ||
|
|
bc01c0bb63 | ||
|
|
d29b872fee | ||
|
|
502ae9d2a0 | ||
|
|
e6f6946497 | ||
|
|
430f580b47 | ||
|
|
f7d9f8237c | ||
|
|
1efe164d7b | ||
|
|
6c6caa7f6c | ||
|
|
c85eba8f04 | ||
|
|
e399fe4637 | ||
|
|
a844a711e1 | ||
|
|
80580eadeb | ||
|
|
2b3b6fb8d8 | ||
|
|
9bc598d234 | ||
|
|
bc11ae6ed6 | ||
|
|
ebc842f19e | ||
|
|
084f685387 | ||
|
|
f235780dda | ||
|
|
09c33a698d | ||
|
|
fbf55eeb48 | ||
|
|
946b442ae0 | ||
|
|
51a4799a29 | ||
|
|
6dbd15d272 | ||
|
|
5a9cb34332 | ||
|
|
5709995b13 | ||
|
|
aa5e24e96d | ||
|
|
26fbbf9f35 | ||
|
|
634c318f3f | ||
|
|
45abeea90f | ||
|
|
3988753b99 | ||
|
|
b06167f5e9 | ||
|
|
a1470a01cf | ||
|
|
c554b40c7d | ||
|
|
0e40fe4d3f | ||
|
|
1402242766 | ||
|
|
bf5941f66e | ||
|
|
6044f7d87c | ||
|
|
82cdd171c5 | ||
|
|
768f4979be | ||
|
|
dc1f1c4737 | ||
|
|
0b8ec411ae | ||
|
|
91e4dafca9 | ||
|
|
65aaa6402a | ||
|
|
1af50d991e | ||
|
|
01b6bb1c2b | ||
|
|
83be116075 | ||
|
|
92604f2ecd | ||
|
|
d01ef397b3 | ||
|
|
0fb43b2ada | ||
|
|
e577451833 | ||
|
|
6803f8e4a8 | ||
|
|
fd18b0ae07 | ||
|
|
b743d56901 | ||
|
|
2a94965bb6 | ||
|
|
03bcf20001 | ||
|
|
e4ef64d014 | ||
|
|
d24e83e0ae | ||
|
|
2ae5fb9f22 | ||
|
|
aeea02efa2 | ||
|
|
b15ce2c2c7 | ||
|
|
7a3a7588b1 | ||
|
|
1e6cb06387 | ||
|
|
8e2ab97dfa | ||
|
|
0be55c75c0 | ||
|
|
78b7dc92d6 | ||
|
|
d70ca8d4e5 | ||
|
|
af69c99896 | ||
|
|
707248e436 | ||
|
|
088b54a5ce | ||
|
|
10bcbc6169 | ||
|
|
33f6bf167c | ||
|
|
b6aa4b1d8b | ||
|
|
f7bf3607ce | ||
|
|
3e9d62f3f7 | ||
|
|
cc755f5184 | ||
|
|
8840bca990 | ||
|
|
bf8b722e7b | ||
|
|
79889edd29 | ||
|
|
053ed46b97 | ||
|
|
a1ab59a15a | ||
|
|
a119ed14b2 | ||
|
|
8e06f6241b | ||
|
|
9337c1a75b | ||
|
|
879a8a5c69 | ||
|
|
bc376748c8 | ||
|
|
8984aecd85 | ||
|
|
1aedce0219 | ||
|
|
d9b5c31a06 | ||
|
|
f2e869f610 | ||
|
|
c097585ca0 | ||
|
|
c04ac4a5e3 | ||
|
|
166e6f8d59 | ||
|
|
77d0c20015 | ||
|
|
babef3f7fb | ||
|
|
4d28b28bdf | ||
|
|
0b58160f6d | ||
|
|
f714176f39 | ||
|
|
0928251673 | ||
|
|
30248b00aa | ||
|
|
05dfb3038b | ||
|
|
d2048e44b3 | ||
|
|
f277d8b2bc | ||
|
|
31336478fe | ||
|
|
159e4fc0c9 | ||
|
|
c370ed47ef | ||
|
|
241947d069 | ||
|
|
afa66814fa | ||
|
|
3fa0912818 | ||
|
|
fe12b83c5a | ||
|
|
accc828836 | ||
|
|
7b00dbdf9b | ||
|
|
05968b21e0 | ||
|
|
dcf7d62ca5 | ||
|
|
6de4a2fb59 | ||
|
|
f993cfcbc3 | ||
|
|
87baa067a6 | ||
|
|
46441ca0e3 | ||
|
|
9045c52774 | ||
|
|
4a481f5736 | ||
|
|
863a2f4ed3 | ||
|
|
a475a857c2 | ||
|
|
0a92d8be31 | ||
|
|
85967a9991 | ||
|
|
9b4e626447 | ||
|
|
fe1425a6c0 | ||
|
|
0569142f84 | ||
|
|
43eaf2aa2d | ||
|
|
853cd9bfbf | ||
|
|
06b9bc2757 | ||
|
|
2c0e806ad6 | ||
|
|
a5526c7ca7 | ||
|
|
4eb1bee983 | ||
|
|
6973943e3a | ||
|
|
bb5fd311fe | ||
|
|
5280fc8df4 | ||
|
|
2712e61ea5 | ||
|
|
65debb5014 | ||
|
|
8a9456ab42 | ||
|
|
444b236f9f | ||
|
|
8f9d2614e9 | ||
|
|
b0c808f449 | ||
|
|
cb049f6458 | ||
|
|
b26bef7251 | ||
|
|
61afb54121 | ||
|
|
c4c55a73cb | ||
|
|
dda8917db0 | ||
|
|
26642eb573 | ||
|
|
cbf59b9b78 | ||
|
|
01ea120747 | ||
|
|
968abd0dc0 | ||
|
|
8b200ef35e | ||
|
|
497cc24545 | ||
|
|
1543643f4c | ||
|
|
6917870c23 | ||
|
|
04438e31ed | ||
|
|
4c4a32da3d | ||
|
|
09dd120805 | ||
|
|
60af02969f | ||
|
|
e8750e9726 | ||
|
|
70a07e6d19 | ||
|
|
d451fc4c7d | ||
|
|
51ae02992e | ||
|
|
2d7be16229 | ||
|
|
ed88aa841a | ||
|
|
8714f4643d | ||
|
|
861041ff31 | ||
|
|
c3c62a6b4e | ||
|
|
7cf61b9699 | ||
|
|
80e3d9167d | ||
|
|
dc139ef09f | ||
|
|
f9917e525c | ||
|
|
af084ceec8 | ||
|
|
ba7f9881d6 | ||
|
|
17c31f4f2f | ||
|
|
31003e1d7f | ||
|
|
fa12463ac2 | ||
|
|
9c221b7b2a | ||
|
|
35dc0f6f77 | ||
|
|
7c9fff983e | ||
|
|
191e17b1a6 | ||
|
|
d2043f41c4 | ||
|
|
f462cc99c7 | ||
|
|
4f09ce1f1b | ||
|
|
d3554ec4f4 | ||
|
|
04f957cf39 | ||
|
|
0e8899e90e | ||
|
|
f73afb87d8 | ||
|
|
92c1d69b16 | ||
|
|
cee25ba530 | ||
|
|
39bf9f789c | ||
|
|
f7aa87c503 | ||
|
|
3a9bc47f09 | ||
|
|
31f5d76bcf | ||
|
|
1117f421b1 | ||
|
|
3b4fcd793f | ||
|
|
e61cae2ddd | ||
|
|
caeaf4c1a9 | ||
|
|
6d6e8bcaf9 | ||
|
|
0f44fab68c | ||
|
|
3f0b2d1375 | ||
|
|
64f5c23546 | ||
|
|
f6c4f3df27 | ||
|
|
cdd91ce673 | ||
|
|
5251369317 | ||
|
|
64d1d73d70 | ||
|
|
082f57569f | ||
|
|
37e20bf2bf | ||
|
|
eb22ac6d8a | ||
|
|
85bab1d238 | ||
|
|
21355e3dd7 | ||
|
|
ce92de2f7e | ||
|
|
da9c32d38a | ||
|
|
41186b7271 | ||
|
|
44ac45fc6b | ||
|
|
09e83ab689 | ||
|
|
c5a93d99a7 | ||
|
|
d4fa4e59a0 | ||
|
|
c1c3eb65d9 | ||
|
|
bdbd1cbd1e | ||
|
|
1ca9b85389 | ||
|
|
b4ac66d727 |
2
.bowerrc
2
.bowerrc
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"directory": "app/assets/bower_components",
|
||||
"directory": "vendor/bower_components",
|
||||
"interactive": false
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
.git
|
||||
30
.env.example
Normal file
30
.env.example
Normal file
@@ -0,0 +1,30 @@
|
||||
APP_ENV=production
|
||||
APP_DEBUG=false
|
||||
APP_URL=http://localhost
|
||||
APP_KEY=SomeRandomString
|
||||
|
||||
DB_DRIVER=mysql
|
||||
DB_HOST=localhost
|
||||
DB_DATABASE=cachet
|
||||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=secret
|
||||
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=database
|
||||
CACHET_EMOJI=false
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'APP_DEBUG' => getenv('APP_DEBUG') ?: false,
|
||||
'DB_DRIVER' => 'mysql',
|
||||
'DB_HOST' => 'localhost',
|
||||
'DB_DATABASE' => 'cachet',
|
||||
'DB_USERNAME' => 'homestead',
|
||||
'DB_PASSWORD' => 'secret',
|
||||
'CACHE_DRIVER' => 'apc',
|
||||
];
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
$dbURL = parse_url(getenv('DATABASE_URL'));
|
||||
$dbName = substr($dbURL["path"], 1);
|
||||
|
||||
return [
|
||||
'APP_DEBUG' => getenv('APP_DEBUG') ?: false,
|
||||
'DB_HOST' => $dbURL['host'],
|
||||
'DB_DATABASE' => $dbName,
|
||||
'DB_USERNAME' => $dbURL['user'],
|
||||
'DB_PASSWORD' => $dbURL['pass'],
|
||||
'DB_DRIVER' => 'pgsql',
|
||||
'CACHE_DRIVER' => 'apc',
|
||||
];
|
||||
10
.gitattributes
vendored
10
.gitattributes
vendored
@@ -1,9 +1,3 @@
|
||||
* text=auto
|
||||
|
||||
/tests export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/phpunit.xml export-ignore
|
||||
/CONTRIBUTING.md export-ignore
|
||||
/INSTALL.md export-ignore
|
||||
/README.md export-ignore
|
||||
*.css linguist-vendored
|
||||
*.scss linguist-vendored
|
||||
|
||||
24
.gitignore
vendored
24
.gitignore
vendored
@@ -1,24 +1,4 @@
|
||||
# Laravel
|
||||
bootstrap/compiled.php
|
||||
vendor
|
||||
|
||||
# Configuration
|
||||
.env.*.php
|
||||
.env.php
|
||||
config.codekit
|
||||
!.env.heroku.php
|
||||
!.env.example.php
|
||||
|
||||
# Assets
|
||||
app/assets/bower_components
|
||||
.env
|
||||
node_modules
|
||||
public/dist
|
||||
public/css
|
||||
public/js
|
||||
|
||||
# Packages
|
||||
npm-debug.log
|
||||
.vagrant
|
||||
|
||||
# PHPUnit
|
||||
phpunit.xml
|
||||
vendor
|
||||
|
||||
23
.travis.yml
23
.travis.yml
@@ -1,26 +1,21 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 7.0
|
||||
- 5.6
|
||||
- nightly
|
||||
- 5.5
|
||||
- 5.5.9
|
||||
- hhvm
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
sudo: false
|
||||
|
||||
install: travis_retry composer install --no-interaction --ignore-platform-reqs --no-scripts --prefer-source
|
||||
|
||||
before_script: php artisan cachet:one-click-deploy
|
||||
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.5.9" ] && [ "$TRAVIS_PHP_VERSION" != "5.5" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then vendor/bin/phpunit; fi
|
||||
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; 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.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
|
||||
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
|
||||
## Creating issues
|
||||
|
||||
Issues should be made by using the [issue tracker](https://github.com/cachethq/Cachet/issues).
|
||||
Feature requests and bug reports should be made by using the [issue tracker](https://github.com/cachethq/Cachet/issues). Support questions should be directed to our support email; [support@alt-three.com](mailto:support@alt-three.com?subject=Cachet Support).
|
||||
|
||||
Things to remember:
|
||||
|
||||
- Be descriptive
|
||||
- Be respectful of others
|
||||
**Always be respectful.** Organization members reserve the right to lock topics if they feel necessary.
|
||||
|
||||
## Languages
|
||||
|
||||
When needing to add labels, placeholders or general text, you **must not** write directly into the source file, rather make use of the `./app/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.
|
||||
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.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
@@ -20,9 +19,9 @@ Please follow existing coding standards:
|
||||
```php
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar\Controller;
|
||||
namespace CachetHQ\Cachet\Controller;
|
||||
|
||||
use Foo\Bar\Bar;
|
||||
use CachetHQ\Cachet\Bar;
|
||||
|
||||
class Foo extends Bar
|
||||
{
|
||||
@@ -50,18 +49,17 @@ class Foo extends Bar
|
||||
}
|
||||
```
|
||||
- Braces on a new line following: `namespace`, `use`, `function` and `class`.
|
||||
- Line lengths have a soft 80 limit and hard 120 length.
|
||||
- PHP constants should be in lowercase; `true`, `false` and `null`.
|
||||
- Defined constants should always be in uppercase.
|
||||
- Never leave trailing spaces at the end of a line.
|
||||
- Files should end with one blank line.
|
||||
- Do not use `# Bash` style comments.
|
||||
- Always add or update Docblocs to functions.
|
||||
- If your pull request consists of more than two commits, you **must** squash them into one.
|
||||
- We use [StyleCI](https://styleci.io) to automatically check code standards in Pull Requests. If your PR fails the CI check, then apply the supplied patch and re-push.
|
||||
|
||||
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.
|
||||
|
||||
@@ -75,8 +73,6 @@ If you're not particularly fond of the command line, you can get one of GitHub's
|
||||
|
||||
If you're feeling adventurous, you can become a Git & GitHub master with the [Git Path on Code School](https://www.codeschool.com/paths/git).
|
||||
|
||||
There is always the Cachet Gitter chat to ask any questions you may have:
|
||||
|
||||
[](https://gitter.im/cachethq/Cachet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
## .editorconfig
|
||||
|
||||
You should also make use of the [.editorconfig](/.editorconfig) file found within the root of the repository. It'll make sure that your editor is setup with the same file settings.
|
||||
|
||||
42
Dockerfile
42
Dockerfile
@@ -1,42 +0,0 @@
|
||||
FROM debian:jessie
|
||||
|
||||
ENV DB_DRIVER=mysql \
|
||||
ENV=production \
|
||||
DB_DATABASE=cachet \
|
||||
DB_HOST= \
|
||||
DB_USERNAME= \
|
||||
DB_PASSWORD= \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY . /var/www/html/
|
||||
WORKDIR /var/www/html/
|
||||
|
||||
# Using nodesource and debian jessie packages instead of compiling from scratch
|
||||
RUN echo "APT::Install-Recommends \"0\";" >> /etc/apt/apt.conf.d/02recommends && \
|
||||
echo "APT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/02recommends && \
|
||||
apt-get -qq update && \
|
||||
apt-get -qq install \
|
||||
ca-certificates nginx php5-fpm=5.* php5-curl php5-readline php5-mcrypt php5-mysql php5-apcu php5-cli \
|
||||
git sqlite libsqlite3-dev curl supervisor && \
|
||||
apt-get clean && apt-get autoremove -qq && \
|
||||
rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* && \
|
||||
chown -R www-data /var/www/html
|
||||
|
||||
# Hardcode the Illuminate key in app/config/app.php. If you want security, feel free
|
||||
# to override the key in your own container with a 'php artisan key:generate' :)
|
||||
RUN sed -i "s/'key' => '\w.*/'key' => 'f20d3e5ae02125a94bd60203a4edfbde',/" app/config/app.php && \
|
||||
grep key app/config/app.php
|
||||
|
||||
# copy the various nginx and supervisor conf (to handle both fpm and nginx)
|
||||
RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf ;\
|
||||
echo "daemon off;" >> /etc/nginx/nginx.conf ;\
|
||||
mv /var/www/html/docker/php-fpm-pool.conf /etc/php5/fpm/pool.d/www.conf ;\
|
||||
rm -f /etc/nginx/sites-enabled/* && rm -f /etc/nginx/conf.d/* && mv /var/www/html/docker/nginx-site.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
RUN curl -sS https://getcomposer.org/installer | php && php composer.phar install --no-dev -o
|
||||
|
||||
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["/usr/bin/supervisord"]
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2015 James Brooks and individual contributors.
|
||||
Copyright (c) 2015 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:
|
||||
|
||||
92
README.md
92
README.md
@@ -1,86 +1,64 @@
|
||||
# Cachet [](https://heroku.com/deploy)
|
||||
# Cachet
|
||||
|
||||
[](https://styleci.io/repos/26730195/)
|
||||
[](https://travis-ci.org/cachethq/Cachet)
|
||||
[](https://scrutinizer-ci.com/g/cachethq/Cachet)
|
||||
[](LICENSE)
|
||||
[](https://gitter.im/cachethq/Cachet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](LICENSE)
|
||||
[](http://translate.cachethq.io/project/cachet)
|
||||
|
||||

|
||||
|
||||
**Currently in development. Things may change or break until a solid release has been announced.**
|
||||
|
||||
## Features
|
||||
|
||||
- List your services components.
|
||||
- Log incidents.
|
||||
- Apply a custom stylesheet to the status page.
|
||||
- Markdown support for incident messages.
|
||||
- RESTful API.
|
||||
- Translated into several languages.
|
||||
- Easy Heroku deployment.
|
||||
- Metrics.
|
||||
- Cross-database support: MySQL, PostgreSQL and SQLite.
|
||||
- List your services components
|
||||
- Log incidents
|
||||
- Apply custom CSS to the status page
|
||||
- Markdown support for incident messages
|
||||
- JSON API
|
||||
- Translated into eleven languages
|
||||
- Metrics
|
||||
- Cross-database support: MySQL, PostgreSQL and SQLite
|
||||
- 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.4 or newer
|
||||
- mcrypt extension
|
||||
- PHP 5.5.9+ or newer
|
||||
- [Composer](https://getcomposer.org)
|
||||
|
||||
### Development Requirements
|
||||
|
||||
The following extra dependencies are required to develop Cachet.
|
||||
These extra dependencies are required to develop Cachet:
|
||||
|
||||
- Node.js
|
||||
+ Bower
|
||||
+ Gulp
|
||||
- Bower
|
||||
- Gulp
|
||||
|
||||
## Installation & Documentation
|
||||
## Installation, Upgrades and Documentation
|
||||
|
||||
You can now find our documentation at [https://docs.cachethq.io](https://docs.cachethq.io) or, directly at [http://cachet.readme.io](http://cachet.readme.io) if the first link fails to load. [Cachet Demo](https://demo.cachethq.io)
|
||||
You can now find our documentation at [https://docs.cachethq.io](https://docs.cachethq.io).
|
||||
|
||||
## What Cachet is not
|
||||
- [Installing Cachet](https://docs.cachethq.io/docs/installing-cachet)
|
||||
- [Getting started with Docker](https://docs.cachethq.io/docs/get-started-with-docker)
|
||||
- [Getting started with Vagrant](https://docs.cachethq.io/docs/get-started-with-vagrant)
|
||||
|
||||
Here is a list of things that Cachet is not or does not do:
|
||||
### Demo Account
|
||||
|
||||
1. It does not monitor your services. It works only as a way to display the status of your services. *However, Cachet is able to receive updates from third-party services via its API.*
|
||||
2. It does not work on a plugin system. There are no monitoring services to extend.
|
||||
3. It's not a Twitter clone.
|
||||
To test out the demo, you may login to the [Dashboard](https://demo.cachethq.io/dashboard) with the following:
|
||||
|
||||
## Quickstart with Docker
|
||||
- **Username:** test@test.com
|
||||
- **Password:** test123
|
||||
|
||||
Run a DB container (you can either pass in environment variables for the DB, or mount a config with `-v /my/database.php:/var/www/html/app/config/database.php`):
|
||||
|
||||
```bash
|
||||
$ export DB_USERNAME=cachet
|
||||
$ export DB_PASSWORD=cachet
|
||||
$ export DB_ROOT_PASSWORD=cachet
|
||||
$ export DB_DATABASE=cachet
|
||||
$ docker run --name mysql -e MYSQL_USER=$DB_USERNAME -e MYSQL_PASSWORD=$DB_PASSWORD -e MYSQL_ROOT_PASSWORD=$DB_ROOT_PASSWORD -e MYSQL_DATABASE=$DB_DATABASE -d mysql
|
||||
```
|
||||
|
||||
Initialize the DB if you haven't yet:
|
||||
|
||||
```bash
|
||||
$ docker run --link mysql:mysql -e DB_HOST=mysql -e DB_DATABASE=$DB_DATABASE -e DB_USERNAME=$DB_USERNAME -e DB_PASSWORD=$DB_PASSWORD cachethq/cachet:latest php artisan migrate --force
|
||||
```
|
||||
|
||||
Run Cachet:
|
||||
|
||||
```bash
|
||||
$ docker run -d --name cachet --link mysql:mysql -p 80:8000 -e DB_HOST=mysql -e DB_DATABASE=$DB_DATABASE -e DB_USERNAME=$DB_USERNAME -e DB_PASSWORD=$DB_PASSWORD cachethq/cachet:latest
|
||||
```
|
||||
|
||||
Now go to `http://<ipdockerisboundto>/setup` and have fun!
|
||||
|
||||
Note: When running in production you should ensure that you enable SSL.
|
||||
This is commonly achieved by running Nginx with your certificates on your Docker host, service or load balancers in-front of the running container, or by adding your custom SSL certificates and configuration to the supplied Nginx configuration.
|
||||
|
||||
## Read more about Cachet
|
||||
|
||||
For more information on why I started developing Cachet, check out my [Cachet articles on my blog](https://james-brooks.uk/tag/cachet/?utm_source=github&utm_medium=readme&utm_campaign=github-cachet).
|
||||
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.
|
||||
|
||||
34
app.json
34
app.json
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"name": "Cachet",
|
||||
"description": "An open source status page system.",
|
||||
"keywords": [
|
||||
"cachet",
|
||||
"laravel",
|
||||
"status",
|
||||
"page"
|
||||
],
|
||||
"website": "https://cachethq.io",
|
||||
"logo": "https://raw.githubusercontent.com/cachethq/assets/79336a33c24b28c470a89742671e0e291813d004/images/icon/Cachet-Icon.png",
|
||||
"success_url": "/setup",
|
||||
"repository": "https://github.com/cachethq/Cachet",
|
||||
"addons": [
|
||||
"heroku-postgresql"
|
||||
],
|
||||
"env": {
|
||||
"ENV": {
|
||||
"value": "heroku",
|
||||
"description": "Warning: Do not modify this value on Heroku deployments."
|
||||
},
|
||||
"BUILDPACK_URL": {
|
||||
"value": "https://github.com/heroku/heroku-buildpack-php",
|
||||
"description": "Warning: Do not modify this value on Heroku deployments."
|
||||
},
|
||||
"CACHE_DRIVER": {
|
||||
"value": "apc",
|
||||
"description": "Warning: Do not modify this value on Heroku deployments."
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"postdeploy": "php artisan migrate --env=heroku; php artisan key:generate;"
|
||||
}
|
||||
}
|
||||
103
app/Commands/Component/AddComponentCommand.php
Normal file
103
app/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\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/Commands/Component/RemoveComponentCommand.php
Normal file
36
app/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\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/Commands/Component/UpdateComponentCommand.php
Normal file
114
app/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\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;
|
||||
}
|
||||
}
|
||||
53
app/Commands/ComponentGroup/AddComponentGroupCommand.php
Normal file
53
app/Commands/ComponentGroup/AddComponentGroupCommand.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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\Commands\ComponentGroup;
|
||||
|
||||
final class AddComponentGroupCommand
|
||||
{
|
||||
/**
|
||||
* The component group name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The component group description.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'order' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a add component group command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $order
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $order)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->order = (int) $order;
|
||||
}
|
||||
}
|
||||
36
app/Commands/ComponentGroup/RemoveComponentGroupCommand.php
Normal file
36
app/Commands/ComponentGroup/RemoveComponentGroupCommand.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\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;
|
||||
}
|
||||
}
|
||||
64
app/Commands/ComponentGroup/UpdateComponentGroupCommand.php
Normal file
64
app/Commands/ComponentGroup/UpdateComponentGroupCommand.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\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;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'string',
|
||||
'order' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a add component group command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
* @param string $name
|
||||
* @param int $order
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group, $name, $order)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->name = $name;
|
||||
$this->order = (int) $order;
|
||||
}
|
||||
}
|
||||
36
app/Commands/Incident/RemoveIncidentCommand.php
Normal file
36
app/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\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/Commands/Incident/ReportIncidentCommand.php
Normal file
132
app/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\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',
|
||||
'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, $template_vars)
|
||||
{
|
||||
$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/Commands/Incident/ReportMaintenanceCommand.php
Normal file
73
app/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\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/Commands/Incident/UpdateIncidentCommand.php
Normal file
142
app/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\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 $name
|
||||
* @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, $template_vars)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
34
app/Commands/Invite/ClaimInviteCommand.php
Normal file
34
app/Commands/Invite/ClaimInviteCommand.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\Commands\Invite;
|
||||
|
||||
final class ClaimInviteCommand
|
||||
{
|
||||
/**
|
||||
* The invte to mark as claimed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Model\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new claim invite command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Model\Invite $invite
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($invite)
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
}
|
||||
104
app/Commands/Metric/AddMetricCommand.php
Normal file
104
app/Commands/Metric/AddMetricCommand.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?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\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 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',
|
||||
];
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
64
app/Commands/Metric/AddMetricPointCommand.php
Normal file
64
app/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\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/Commands/Metric/RemoveMetricCommand.php
Normal file
36
app/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\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/Commands/Metric/RemoveMetricPointCommand.php
Normal file
36
app/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\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;
|
||||
}
|
||||
}
|
||||
115
app/Commands/Metric/UpdateMetricCommand.php
Normal file
115
app/Commands/Metric/UpdateMetricCommand.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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\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 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|min:0|max: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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
74
app/Commands/Metric/UpdateMetricPointCommand.php
Normal file
74
app/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\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;
|
||||
}
|
||||
}
|
||||
52
app/Commands/Subscriber/SubscribeSubscriberCommand.php
Normal file
52
app/Commands/Subscriber/SubscribeSubscriberCommand.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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\Commands\Subscriber;
|
||||
|
||||
final class SubscribeSubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The subscriber email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The subscriber auto verification.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $verified;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $rules = [
|
||||
'email' => 'required|email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new subscribe subscriber command instance.
|
||||
*
|
||||
* @param string $email
|
||||
* @param bool $verified
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($email, $verified = false)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->verified = $verified;
|
||||
}
|
||||
}
|
||||
36
app/Commands/Subscriber/UnsubscribeSubscriberCommand.php
Normal file
36
app/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\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 string $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
36
app/Commands/Subscriber/VerifySubscriberCommand.php
Normal file
36
app/Commands/Subscriber/VerifySubscriberCommand.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\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
final class VerifySubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The subscriber to verify.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a verify subscriber command instance.
|
||||
*
|
||||
* @param string $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
72
app/Commands/User/AddTeamMemberCommand.php
Normal file
72
app/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\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;
|
||||
}
|
||||
}
|
||||
34
app/Commands/User/GenerateApiTokenCommand.php
Normal file
34
app/Commands/User/GenerateApiTokenCommand.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\Commands\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)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
43
app/Commands/User/InviteTeamMemberCommand.php
Normal file
43
app/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\Commands\User;
|
||||
|
||||
final class InviteTeamMemberCommand
|
||||
{
|
||||
/**
|
||||
* The invte emails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'emails' => 'required|array|email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new invite team member command instance.
|
||||
*
|
||||
* @param array $email
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($emails)
|
||||
{
|
||||
$this->emails = $emails;
|
||||
}
|
||||
}
|
||||
36
app/Commands/User/RemoveUserCommand.php
Normal file
36
app/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\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/Commands/User/SignupUserCommand.php
Normal file
73
app/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\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;
|
||||
}
|
||||
}
|
||||
46
app/Composers/AppComposer.php
Normal file
46
app/Composers/AppComposer.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class AppComposer
|
||||
{
|
||||
/**
|
||||
* Index page view composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->withAboutApp(Markdown::convertToHtml(Setting::get('app_about')));
|
||||
$view->withAppAnalytics(Setting::get('app_analytics'));
|
||||
$view->withAppAnalyticsGoSquared(Setting::get('app_analytics_gs'));
|
||||
$view->withAppAnalyticsPiwikUrl(Setting::get('app_analytics_piwik_url'));
|
||||
$view->withAppAnalyticsPiwikSiteId(Setting::get('app_analytics_piwik_siteid'));
|
||||
$view->withAppBanner(Setting::get('app_banner'));
|
||||
$view->withAppBannerStyleFullWidth(Setting::get('style_fullwidth_header'));
|
||||
$view->withAppBannerType(Setting::get('app_banner_type'));
|
||||
$view->withAppDomain(Setting::get('app_domain'));
|
||||
$view->withAppGraphs(Setting::get('display_graphs'));
|
||||
$view->withAppLocale(Setting::get('app_locale'));
|
||||
$view->withAppName(Setting::get('app_name'));
|
||||
$view->withAppStylesheet(Setting::get('app_stylesheet'));
|
||||
$view->withAppUrl(Config::get('app.url'));
|
||||
$view->withShowSupport(Setting::get('show_support'));
|
||||
}
|
||||
}
|
||||
30
app/Composers/CurrentUserComposer.php
Normal file
30
app/Composers/CurrentUserComposer.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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\Composers;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class CurrentUserComposer
|
||||
{
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->withCurrentUser(Auth::user());
|
||||
}
|
||||
}
|
||||
32
app/Composers/DashboardComposer.php
Normal file
32
app/Composers/DashboardComposer.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class DashboardComposer
|
||||
{
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->withIncidentCount(Incident::notScheduled()->count());
|
||||
$view->withComponentCount(Component::all()->count());
|
||||
}
|
||||
}
|
||||
65
app/Composers/MetricsComposer.php
Normal file
65
app/Composers/MetricsComposer.php
Normal file
@@ -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\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Repositories\Metric\MetricRepository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class MetricsComposer
|
||||
{
|
||||
/**
|
||||
* @var \CachetHQ\Cachet\Repositories\Metric\MetricRepository
|
||||
*/
|
||||
protected $metricRepository;
|
||||
|
||||
/**
|
||||
* Construct a new home controller instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Repositories\Metric\MetricRepository $metricRepository
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricRepository $metricRepository)
|
||||
{
|
||||
$this->metricRepository = $metricRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Metrics view composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$metrics = null;
|
||||
$metricData = [];
|
||||
if ($displayMetrics = Setting::get('display_graphs')) {
|
||||
$metrics = Metric::where('display_chart', 1)->get();
|
||||
|
||||
$metrics->map(function ($metric) use (&$metricData) {
|
||||
$metricData[$metric->id] = [
|
||||
'today' => $this->metricRepository->listPointsToday($metric),
|
||||
'week' => $this->metricRepository->listPointsForWeek($metric),
|
||||
'month' => $this->metricRepository->listPointsForMonth($metric),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
$view->withDisplayMetrics($displayMetrics)
|
||||
->withMetrics($metrics)
|
||||
->withMetricData($metricData);
|
||||
}
|
||||
}
|
||||
68
app/Composers/StatusPageComposer.php
Normal file
68
app/Composers/StatusPageComposer.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?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\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class StatusPageComposer
|
||||
{
|
||||
/**
|
||||
* Index page view composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
// Default data
|
||||
$withData = [
|
||||
'systemStatus' => 'info',
|
||||
'systemMessage' => trans('cachet.service.bad'),
|
||||
'favicon' => 'favicon-high-alert',
|
||||
];
|
||||
|
||||
if (Component::enabled()->notStatus(1)->count() === 0) {
|
||||
// If all our components are ok, do we have any non-fixed incidents?
|
||||
$incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get();
|
||||
$incidentCount = $incidents->count();
|
||||
|
||||
if ($incidentCount === 0 || ($incidentCount >= 1 && (int) $incidents->first()->status === 4)) {
|
||||
$withData = [
|
||||
'systemStatus' => 'success',
|
||||
'systemMessage' => trans('cachet.service.good'),
|
||||
'favicon' => 'favicon',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
if (Component::enabled()->whereIn('status', [2, 3])->count() > 0) {
|
||||
$withData['favicon'] = 'favicon-medium-alert';
|
||||
}
|
||||
}
|
||||
|
||||
// Scheduled maintenance code.
|
||||
$scheduledMaintenance = Incident::scheduled()->orderBy('scheduled_at')->get();
|
||||
|
||||
// Component & Component Group lists.
|
||||
$usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->lists('group_id');
|
||||
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
|
||||
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
|
||||
|
||||
$view->with($withData)
|
||||
->withComponentGroups($componentGroups)
|
||||
->withUngroupedComponents($ungroupedComponents)
|
||||
->withScheduledMaintenance($scheduledMaintenance);
|
||||
}
|
||||
}
|
||||
42
app/Composers/ThemeComposer.php
Normal file
42
app/Composers/ThemeComposer.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class ThemeComposer
|
||||
{
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
// Theme colors.
|
||||
$view->withThemeBackgroundColor(Setting::get('style_background_color', '#F0F3F4'));
|
||||
$view->withThemeBackgroundFills(Setting::get('style_background_fills', '#FFFFFF'));
|
||||
$view->withThemeBannerBackgroundColor(Setting::get('style_banner_background_color', ''));
|
||||
$view->withThemeBannerPadding(Setting::get('style_banner_padding', '40px 0'));
|
||||
$view->withThemeTextColor(Setting::get('style_text_color', '#333333'));
|
||||
$view->withThemeReds(Setting::get('style_reds', '#ff6f6f'));
|
||||
$view->withThemeBlues(Setting::get('style_blues', '#3498db'));
|
||||
$view->withThemeGreens(Setting::get('style_greens', '#7ED321'));
|
||||
$view->withThemeYellows(Setting::get('style_yellows', '#F7CA18'));
|
||||
$view->withThemeOranges(Setting::get('style_oranges', '#FF8800'));
|
||||
$view->withThemeMetrics(Setting::get('style_metrics', '#0dccc0'));
|
||||
$view->withThemeLinks(Setting::get('style_links', '#7ED321'));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,27 @@
|
||||
<?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\Composers;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class TimezoneLocaleComposer
|
||||
{
|
||||
/**
|
||||
* Timezones and Locales composer.
|
||||
*
|
||||
* @param \Illuminate\View\View $view
|
||||
* @param \Illuminate\Contracts\View\View $view
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -24,7 +33,7 @@ class TimezoneLocaleComposer
|
||||
$locale = basename($lang);
|
||||
|
||||
return [$locale => $enabledLangs[$locale]];
|
||||
}, glob(app_path('lang').'/*'));
|
||||
}, glob(base_path('resources/lang').'/*'));
|
||||
|
||||
$langs = call_user_func_array('array_merge', $langs);
|
||||
|
||||
@@ -38,6 +47,7 @@ class TimezoneLocaleComposer
|
||||
'Europe' => DateTimeZone::EUROPE,
|
||||
'Indian' => DateTimeZone::INDIAN,
|
||||
'Pacific' => DateTimeZone::PACIFIC,
|
||||
'UTC' => DateTimeZone::UTC,
|
||||
];
|
||||
|
||||
$timezones = [];
|
||||
@@ -58,9 +68,7 @@ class TimezoneLocaleComposer
|
||||
}
|
||||
}
|
||||
|
||||
$view->with([
|
||||
'timezones' => $timezones,
|
||||
'langs' => $langs,
|
||||
]);
|
||||
$view->withTimezones($timezones);
|
||||
$view->withLangs($langs);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
<?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\Config;
|
||||
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
@@ -35,27 +44,24 @@ class Repository
|
||||
/**
|
||||
* Returns a setting from the database.
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $checkEnv
|
||||
* @param string $name
|
||||
* @param string|null $default
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function get($name, $checkEnv = true)
|
||||
public function get($name, $default = null)
|
||||
{
|
||||
// if we've not loaded the settings, load them now
|
||||
if (!$this->settings) {
|
||||
$this->settings = $this->model->all()->lists('value', 'name');
|
||||
}
|
||||
|
||||
// if the setting exists, return it
|
||||
if (isset($this->settings[$name])) {
|
||||
// if the setting exists and is not blank, return it
|
||||
if (!empty($this->settings[$name])) {
|
||||
return $this->settings[$name];
|
||||
}
|
||||
|
||||
// fallback to getenv if allowed to
|
||||
if ($checkEnv) {
|
||||
return $this->settings[$name] = getenv(strtoupper($name));
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
93
app/Console/Commands/DemoMetricPointSeederCommand.php
Normal file
93
app/Console/Commands/DemoMetricPointSeederCommand.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?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\Console\Commands;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Console\ConfirmableTrait;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
/**
|
||||
* This is the demo seeder of metric points command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class DemoMetricPointSeederCommand extends Command
|
||||
{
|
||||
use ConfirmableTrait;
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'cachet:metrics';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Seeds the demo Cachet metric with points.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function fire()
|
||||
{
|
||||
if (!$this->confirmToProceed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->seedMetricPoints();
|
||||
|
||||
$this->info('Demo metric seeded with demo data successfully!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the metric points table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedMetricPoints()
|
||||
{
|
||||
MetricPoint::truncate();
|
||||
|
||||
// Generate 11 hours of metric points
|
||||
for ($i = 0; $i < 11; $i++) {
|
||||
$metricTime = (new DateTime())->sub(new DateInterval('PT'.$i.'H'));
|
||||
|
||||
MetricPoint::create([
|
||||
'metric_id' => 1,
|
||||
'value' => random_int(1, 10),
|
||||
'created_at' => $metricTime,
|
||||
'updated_at' => $metricTime,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return [
|
||||
['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],
|
||||
];
|
||||
}
|
||||
}
|
||||
343
app/Console/Commands/DemoSeederCommand.php
Normal file
343
app/Console/Commands/DemoSeederCommand.php
Normal file
@@ -0,0 +1,343 @@
|
||||
<?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\Console\Commands;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Console\ConfirmableTrait;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
/**
|
||||
* This is the demo seeder command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class DemoSeederCommand extends Command
|
||||
{
|
||||
use ConfirmableTrait;
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'cachet:seed';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Seeds Cachet with demo data.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function fire()
|
||||
{
|
||||
if (!$this->confirmToProceed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->seedComponentGroups();
|
||||
$this->seedComponents();
|
||||
$this->seedIncidents();
|
||||
$this->seedMetricPoints();
|
||||
$this->seedMetrics();
|
||||
$this->seedSettings();
|
||||
$this->seedSubscribers();
|
||||
$this->seedUsers();
|
||||
|
||||
$this->info('Database seeded with demo data successfully!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the component groups table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedComponentGroups()
|
||||
{
|
||||
$defaultGroups = [
|
||||
[
|
||||
'name' => 'Websites',
|
||||
'order' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
ComponentGroup::truncate();
|
||||
|
||||
foreach ($defaultGroups as $group) {
|
||||
ComponentGroup::create($group);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the components table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedComponents()
|
||||
{
|
||||
$defaultComponents = [
|
||||
[
|
||||
'name' => 'API',
|
||||
'description' => 'Used by third-parties to connect to us',
|
||||
'status' => 1,
|
||||
'order' => 0,
|
||||
'group_id' => 0,
|
||||
'link' => '',
|
||||
], [
|
||||
'name' => 'Documentation',
|
||||
'description' => 'Kindly powered by Readme.io',
|
||||
'status' => 1,
|
||||
'order' => 0,
|
||||
'group_id' => 1,
|
||||
'link' => 'https://docs.cachethq.io',
|
||||
], [
|
||||
'name' => 'Website',
|
||||
'description' => '',
|
||||
'status' => 1,
|
||||
'order' => 0,
|
||||
'group_id' => 1,
|
||||
'link' => 'https://cachethq.io',
|
||||
], [
|
||||
'name' => 'Blog',
|
||||
'description' => 'The Cachet Blog.',
|
||||
'status' => 1,
|
||||
'order' => 0,
|
||||
'group_id' => 1,
|
||||
'link' => 'https://blog.cachethq.io',
|
||||
],
|
||||
];
|
||||
|
||||
Component::truncate();
|
||||
|
||||
foreach ($defaultComponents as $component) {
|
||||
Component::create($component);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the incidents table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedIncidents()
|
||||
{
|
||||
$defaultIncidents = [
|
||||
[
|
||||
'name' => 'Awesome',
|
||||
'message' => ':+1: We totally nailed the fix.',
|
||||
'status' => 4,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Monitoring the fix',
|
||||
'message' => ":ship: We've deployed a fix.",
|
||||
'status' => 3,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Update',
|
||||
'message' => "We've identified the problem. Our engineers are currently looking at it.",
|
||||
'status' => 2,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Test Incident',
|
||||
'message' => 'Something went wrong, with something or another.',
|
||||
'status' => 1,
|
||||
'component_id' => 0,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Investigating the API',
|
||||
'message' => ':zap: We\'ve seen high response times from our API. It looks to be fixing itself as time goes on.',
|
||||
'status' => 1,
|
||||
'component_id' => 1,
|
||||
'scheduled_at' => null,
|
||||
'visible' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
Incident::truncate();
|
||||
|
||||
foreach ($defaultIncidents as $incident) {
|
||||
Incident::create($incident);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the metric points table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedMetricPoints()
|
||||
{
|
||||
MetricPoint::truncate();
|
||||
|
||||
// Generate 11 hours of metric points
|
||||
for ($i = 0; $i < 11; $i++) {
|
||||
$metricTime = (new DateTime())->sub(new DateInterval('PT'.$i.'H'));
|
||||
|
||||
MetricPoint::create([
|
||||
'metric_id' => 1,
|
||||
'value' => random_int(1, 10),
|
||||
'created_at' => $metricTime,
|
||||
'updated_at' => $metricTime,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the metrics table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedMetrics()
|
||||
{
|
||||
$defaultMetrics = [
|
||||
[
|
||||
'name' => 'Cups of coffee',
|
||||
'suffix' => 'Cups',
|
||||
'description' => 'How many cups of coffee we\'ve drank.',
|
||||
'default_value' => 0,
|
||||
'calc_type' => 1,
|
||||
'display_chart' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
Metric::truncate();
|
||||
|
||||
foreach ($defaultMetrics as $metric) {
|
||||
Metric::create($metric);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the settings table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedSettings()
|
||||
{
|
||||
$defaultSettings = [
|
||||
[
|
||||
'name' => 'app_name',
|
||||
'value' => 'Cachet Demo',
|
||||
],
|
||||
[
|
||||
'name' => 'app_domain',
|
||||
'value' => 'https://demo.cachethq.io',
|
||||
],
|
||||
[
|
||||
'name' => 'show_support',
|
||||
'value' => '1',
|
||||
],
|
||||
[
|
||||
'name' => 'app_locale',
|
||||
'value' => 'en',
|
||||
],
|
||||
[
|
||||
'name' => 'app_timezone',
|
||||
'value' => 'Europe/London',
|
||||
],
|
||||
[
|
||||
'name' => 'app_incident_days',
|
||||
'value' => '7',
|
||||
],
|
||||
[
|
||||
'name' => 'app_analytics',
|
||||
'value' => 'UA-58442674-3',
|
||||
],
|
||||
[
|
||||
'name' => 'app_analytics_gs',
|
||||
'value' => 'GSN-712462-P',
|
||||
],
|
||||
[
|
||||
'name' => 'display_graphs',
|
||||
'value' => '1',
|
||||
],
|
||||
];
|
||||
|
||||
Setting::truncate();
|
||||
|
||||
foreach ($defaultSettings as $setting) {
|
||||
Setting::create($setting);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the subscribers.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedSubscribers()
|
||||
{
|
||||
Subscriber::truncate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the users table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedUsers()
|
||||
{
|
||||
$users = [
|
||||
[
|
||||
'username' => 'test',
|
||||
'password' => 'test123',
|
||||
'email' => 'test@test.com',
|
||||
'level' => 1,
|
||||
'api_key' => '9yMHsdioQosnyVK4iCVR',
|
||||
],
|
||||
];
|
||||
|
||||
User::truncate();
|
||||
|
||||
foreach ($users as $user) {
|
||||
User::create($user);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return [
|
||||
['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],
|
||||
];
|
||||
}
|
||||
}
|
||||
42
app/Console/Kernel.php
Normal file
42
app/Console/Kernel.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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\Console;
|
||||
|
||||
use CachetHQ\Cachet\Console\Commands\DemoMetricPointSeederCommand;
|
||||
use CachetHQ\Cachet\Console\Commands\DemoSeederCommand;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
DemoMetricPointSeederCommand::class,
|
||||
DemoSeederCommand::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->command('queue:work --sleep=3 --tries=3')->everyMinute();
|
||||
}
|
||||
}
|
||||
77
app/Dates/DateFactory.php
Normal file
77
app/Dates/DateFactory.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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\Dates;
|
||||
|
||||
use Jenssegers\Date\Date;
|
||||
|
||||
class DateFactory
|
||||
{
|
||||
/**
|
||||
* The application timezone.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $appTimezone;
|
||||
|
||||
/**
|
||||
* The cachet timezone.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $cachetTimezone;
|
||||
|
||||
/**
|
||||
* Create a new date factory instance.
|
||||
*
|
||||
* @param string $appTimezone
|
||||
* @param string $cachetTimezone
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($appTimezone, $cachetTimezone)
|
||||
{
|
||||
$this->appTimezone = $appTimezone;
|
||||
$this->cachetTimezone = $cachetTimezone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific format.
|
||||
*
|
||||
* @param string $format
|
||||
* @param string $time
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return \Carbon\Carbon
|
||||
*/
|
||||
public function create($format, $time)
|
||||
{
|
||||
return Date::createFromFormat($format, $time, $this->cachetTimezone)->setTimezone($this->appTimezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Carbon instance from a specific format.
|
||||
*
|
||||
* We're also going to make sure the timezone information is correct.
|
||||
*
|
||||
* @param string $format
|
||||
* @param string $time
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return \Carbon\Carbon
|
||||
*/
|
||||
public function createNormalized($format, $time)
|
||||
{
|
||||
return $this->create($format, $time)->setTimezone($this->appTimezone);
|
||||
}
|
||||
}
|
||||
34
app/Events/Component/ComponentWasAddedEvent.php
Normal file
34
app/Events/Component/ComponentWasAddedEvent.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\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class ComponentWasAddedEvent
|
||||
{
|
||||
/**
|
||||
* The component that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was added event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
34
app/Events/Component/ComponentWasRemovedEvent.php
Normal file
34
app/Events/Component/ComponentWasRemovedEvent.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\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class ComponentWasRemovedEvent
|
||||
{
|
||||
/**
|
||||
* The component that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was removed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
34
app/Events/Component/ComponentWasUpdatedEvent.php
Normal file
34
app/Events/Component/ComponentWasUpdatedEvent.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\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class ComponentWasUpdatedEvent
|
||||
{
|
||||
/**
|
||||
* The component that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was updated event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
34
app/Events/ComponentGroup/ComponentGroupWasAddedEvent.php
Normal file
34
app/Events/ComponentGroup/ComponentGroupWasAddedEvent.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\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class ComponentGroupWasAddedEvent
|
||||
{
|
||||
/**
|
||||
* The component group that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was added event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
34
app/Events/ComponentGroup/ComponentGroupWasRemovedEvent.php
Normal file
34
app/Events/ComponentGroup/ComponentGroupWasRemovedEvent.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\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class ComponentGroupWasRemovedEvent
|
||||
{
|
||||
/**
|
||||
* The component group that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was removed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
34
app/Events/ComponentGroup/ComponentGroupWasUpdatedEvent.php
Normal file
34
app/Events/ComponentGroup/ComponentGroupWasUpdatedEvent.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\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class ComponentGroupWasUpdatedEvent
|
||||
{
|
||||
/**
|
||||
* The component group that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was updated event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
32
app/Events/Incident/IncidentWasRemovedEvent.php
Normal file
32
app/Events/Incident/IncidentWasRemovedEvent.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class IncidentWasRemovedEvent
|
||||
{
|
||||
/**
|
||||
* The incident that has been removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new incident was removed event instance.
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
34
app/Events/Incident/IncidentWasReportedEvent.php
Normal file
34
app/Events/Incident/IncidentWasReportedEvent.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\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class IncidentWasReportedEvent
|
||||
{
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new incident has reported event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
34
app/Events/Incident/IncidentWasUpdatedEvent.php
Normal file
34
app/Events/Incident/IncidentWasUpdatedEvent.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\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class IncidentWasUpdatedEvent
|
||||
{
|
||||
/**
|
||||
* The incident that has been updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new incident has updated event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
34
app/Events/Incident/MaintenanceWasScheduledEvent.php
Normal file
34
app/Events/Incident/MaintenanceWasScheduledEvent.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\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class MaintenanceWasScheduledEvent
|
||||
{
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new maintenance has scheduled event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
34
app/Events/Invite/InviteWasClaimed.php
Normal file
34
app/Events/Invite/InviteWasClaimed.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\Events\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class InviteWasClaimed
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
34
app/Events/Metric/MetricPointWasAddedEvent.php
Normal file
34
app/Events/Metric/MetricPointWasAddedEvent.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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
class MetricPointWasAddedEvent
|
||||
{
|
||||
/**
|
||||
* The metric point that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric point was added event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
34
app/Events/Metric/MetricPointWasRemovedEvent.php
Normal file
34
app/Events/Metric/MetricPointWasRemovedEvent.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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
class MetricPointWasRemovedEvent
|
||||
{
|
||||
/**
|
||||
* The metric point that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new metric point was removed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
}
|
||||
34
app/Events/Metric/MetricPointWasUpdatedEvent.php
Normal file
34
app/Events/Metric/MetricPointWasUpdatedEvent.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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
class MetricPointWasUpdatedEvent
|
||||
{
|
||||
/**
|
||||
* The metric point that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $point;
|
||||
|
||||
/**
|
||||
* Create a new metric point was updated event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $point)
|
||||
{
|
||||
$this->point = $point;
|
||||
}
|
||||
}
|
||||
34
app/Events/Metric/MetricWasAddedEvent.php
Normal file
34
app/Events/Metric/MetricWasAddedEvent.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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class MetricWasAddedEvent
|
||||
{
|
||||
/**
|
||||
* The metric that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was added event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
34
app/Events/Metric/MetricWasRemovedEvent.php
Normal file
34
app/Events/Metric/MetricWasRemovedEvent.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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class MetricWasRemovedEvent
|
||||
{
|
||||
/**
|
||||
* The metric that was removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was removed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
34
app/Events/Metric/MetricWasUpdatedEvent.php
Normal file
34
app/Events/Metric/MetricWasUpdatedEvent.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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class MetricWasUpdatedEvent
|
||||
{
|
||||
/**
|
||||
* The metric that was updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was updated event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
34
app/Events/Subscriber/SubscriberHasSubscribedEvent.php
Normal file
34
app/Events/Subscriber/SubscriberHasSubscribedEvent.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\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class SubscriberHasSubscribedEvent
|
||||
{
|
||||
/**
|
||||
* The subscriber who has subscribed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has subscribed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
34
app/Events/Subscriber/SubscriberHasUnsubscribedEvent.php
Normal file
34
app/Events/Subscriber/SubscriberHasUnsubscribedEvent.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\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class SubscriberHasUnsubscribedEvent
|
||||
{
|
||||
/**
|
||||
* The subscriber who has unsubscribed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has unsubscribed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
34
app/Events/Subscriber/SubscriberHasVerifiedEvent.php
Normal file
34
app/Events/Subscriber/SubscriberHasVerifiedEvent.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\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class SubscriberHasVerifiedEvent
|
||||
{
|
||||
/**
|
||||
* The subscriber who has verified.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscriber has subscribed event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
17
app/Events/User/UserEventInterface.php
Normal file
17
app/Events/User/UserEventInterface.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\Events\User;
|
||||
|
||||
interface UserEventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
34
app/Events/User/UserWasAddedEvent.php
Normal file
34
app/Events/User/UserWasAddedEvent.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\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.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
34
app/Events/User/UserWasInvitedEvent.php
Normal file
34
app/Events/User/UserWasInvitedEvent.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\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class UserWasInvitedEvent
|
||||
{
|
||||
/**
|
||||
* The invite that has been added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new user was invite event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Invite $invite)
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
}
|
||||
34
app/Events/User/UserWasRemovedEvent.php
Normal file
34
app/Events/User/UserWasRemovedEvent.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\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.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
54
app/Exceptions/Displayers/JsonValidationDisplayer.php
Normal file
54
app/Exceptions/Displayers/JsonValidationDisplayer.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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\Exceptions\Displayers;
|
||||
|
||||
use AltThree\Validator\ValidationException;
|
||||
use Exception;
|
||||
use GrahamCampbell\Exceptions\Displayers\DisplayerInterface;
|
||||
use GrahamCampbell\Exceptions\Displayers\JsonDisplayer;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class JsonValidationDisplayer extends JsonDisplayer implements DisplayerInterface
|
||||
{
|
||||
/**
|
||||
* Get the error response associated with the given exception.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @param string $id
|
||||
* @param int $code
|
||||
* @param string[] $headers
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function display(Exception $exception, $id, $code, array $headers)
|
||||
{
|
||||
$info = $this->info->generate($exception, $id, 400);
|
||||
|
||||
$error = ['id' => $id, 'status' => $info['code'], 'title' => $info['name'], 'detail' => $info['detail'], 'meta' => ['details' => $exception->getMessageBag()->all()]];
|
||||
|
||||
return new JsonResponse(['errors' => [$error]], 400, array_merge($headers, ['Content-Type' => $this->contentType()]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we display the exception?
|
||||
*
|
||||
* @param \Exception $original
|
||||
* @param \Exception $transformed
|
||||
* @param int $code
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canDisplay(Exception $original, Exception $transformed, $code)
|
||||
{
|
||||
return $transformed instanceof ValidationException;
|
||||
}
|
||||
}
|
||||
90
app/Exceptions/Displayers/RedirectDisplayer.php
Normal file
90
app/Exceptions/Displayers/RedirectDisplayer.php
Normal file
@@ -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\Exceptions\Displayers;
|
||||
|
||||
use Exception;
|
||||
use GrahamCampbell\Exceptions\Displayers\DisplayerInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
class RedirectDisplayer implements DisplayerInterface
|
||||
{
|
||||
/**
|
||||
* The request instance.
|
||||
*
|
||||
* @var \Illuminate\Http\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Create a new redirect displayer instance.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the error response associated with the given exception.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @param string $id
|
||||
* @param int $code
|
||||
* @param string[] $headers
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function display(Exception $exception, $id, $code, array $headers)
|
||||
{
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the supported content type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function contentType()
|
||||
{
|
||||
return 'text/html';
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we display the exception?
|
||||
*
|
||||
* @param \Exception $original
|
||||
* @param \Exception $transformed
|
||||
* @param int $code
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canDisplay(Exception $original, Exception $transformed, $code)
|
||||
{
|
||||
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;
|
||||
|
||||
return $redirect && !$this->request->is('api*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Do we provide verbose information about the exception?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isVerbose()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
60
app/Exceptions/Filters/ApiFilter.php
Normal file
60
app/Exceptions/Filters/ApiFilter.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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\Exceptions\Filters;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ApiFilter
|
||||
{
|
||||
/**
|
||||
* The request instance.
|
||||
*
|
||||
* @var \Illuminate\Http\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Create a new api filter instance.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter and return the displayers.
|
||||
*
|
||||
* @param \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[] $displayers
|
||||
* @param \Exception $original
|
||||
* @param \Exception $transformed
|
||||
* @param int $code
|
||||
*
|
||||
* @return \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[]
|
||||
*/
|
||||
public function filter(array $displayers, Exception $original, Exception $transformed, $code)
|
||||
{
|
||||
if ($this->request->is('api*')) {
|
||||
foreach ($displayers as $index => $displayer) {
|
||||
if (!str_contains($displayer->contentType(), 'application/')) {
|
||||
unset($displayers[$index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array_values($displayers);
|
||||
}
|
||||
}
|
||||
41
app/Exceptions/Transformers/ModelNotFoundTransformer.php
Normal file
41
app/Exceptions/Transformers/ModelNotFoundTransformer.php
Normal file
@@ -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\Exceptions\Transformers;
|
||||
|
||||
use Exception;
|
||||
use GrahamCampbell\Exceptions\Transformers\TransformerInterface;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* This is the model not found transformer class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class ModelNotFoundTransformer implements TransformerInterface
|
||||
{
|
||||
/**
|
||||
* Transform the provided exception.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
*
|
||||
* @return \Exception
|
||||
*/
|
||||
public function transform(Exception $exception)
|
||||
{
|
||||
if ($exception instanceof ModelNotFoundException) {
|
||||
$exception = new NotFoundHttpException('Resource not found');
|
||||
}
|
||||
|
||||
return $exception;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
<?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\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
@@ -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\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Component\AddComponentCommand;
|
||||
use CachetHQ\Cachet\Events\Component\ComponentWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class AddComponentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add component command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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\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\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Component\RemoveComponentCommand;
|
||||
use CachetHQ\Cachet\Events\Component\ComponentWasRemovedEvent;
|
||||
|
||||
class RemoveComponentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove component command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Component\UpdateComponentCommand;
|
||||
use CachetHQ\Cachet\Events\Component\ComponentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class UpdateComponentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update component command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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\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,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\Handlers\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Commands\ComponentGroup\AddComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class AddComponentGroupCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add component group command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\ComponentGroup\AddComponentGroupCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public function handle(AddComponentGroupCommand $command)
|
||||
{
|
||||
$group = ComponentGroup::create([
|
||||
'name' => $command->name,
|
||||
'order' => $command->order,
|
||||
]);
|
||||
|
||||
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\Handlers\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Commands\ComponentGroup\RemoveComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupWasRemovedEvent;
|
||||
|
||||
class RemoveComponentGroupCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove component group command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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,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\Handlers\Commands\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Commands\ComponentGroup\UpdateComponentGroupCommand;
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupWasUpdatedEvent;
|
||||
|
||||
class UpdateComponentGroupCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update component group command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\ComponentGroup\UpdateComponentGroupCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public function handle(UpdateComponentGroupCommand $command)
|
||||
{
|
||||
$group = $command->group;
|
||||
$group->update([
|
||||
'name' => $command->name,
|
||||
'order' => $command->order,
|
||||
]);
|
||||
|
||||
event(new ComponentGroupWasUpdatedEvent($group));
|
||||
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
@@ -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\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Events\Incident\IncidentWasRemovedEvent;
|
||||
|
||||
class RemoveIncidentCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove incident command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\Incident\RemoveIncidentCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveIncidentCommand $command)
|
||||
{
|
||||
$incident = $command->incident;
|
||||
|
||||
event(new IncidentWasRemovedEvent($incident));
|
||||
|
||||
$incident->delete();
|
||||
}
|
||||
}
|
||||
109
app/Handlers/Commands/Incident/ReportIncidentCommandHandler.php
Normal file
109
app/Handlers/Commands/Incident/ReportIncidentCommandHandler.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?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\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Incident\ReportIncidentCommand;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent;
|
||||
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\Commands\Incident\ReportIncidentCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public function handle(ReportIncidentCommand $command)
|
||||
{
|
||||
if ($command->template) {
|
||||
$command->message = $this->parseIncidentTemplate($command->template, $command->template_vars);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'name' => $command->name,
|
||||
'status' => $command->status,
|
||||
'message' => $command->message,
|
||||
'visible' => $command->visible,
|
||||
];
|
||||
|
||||
// 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->createNormalized('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)
|
||||
{
|
||||
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\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Incident\ReportMaintenanceCommand;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Events\Incident\MaintenanceWasScheduledEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
class ReportMaintenanceCommandHandler
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* Create a new report maintanance 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\Commands\Incident\ReportMaintenanceCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public function handle(ReportMaintenanceCommand $command)
|
||||
{
|
||||
$scheduledAt = $this->dates->createNormalized('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;
|
||||
}
|
||||
}
|
||||
121
app/Handlers/Commands/Incident/UpdateIncidentCommandHandler.php
Normal file
121
app/Handlers/Commands/Incident/UpdateIncidentCommandHandler.php
Normal file
@@ -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\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Incident\UpdateIncidentCommand;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Events\Incident\IncidentWasUpdatedEvent;
|
||||
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\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->createNormalized('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\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);
|
||||
}
|
||||
}
|
||||
36
app/Handlers/Commands/Invite/ClaimInviteCommandHandler.php
Normal file
36
app/Handlers/Commands/Invite/ClaimInviteCommandHandler.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\Handlers\Commands\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Invite\ClaimInviteCommand;
|
||||
use CachetHQ\Cachet\Events\Invite\InviteWasClaimed;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ClaimInviteCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the claim invite command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\User\ClaimInviteCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(ClaimInviteCommand $command)
|
||||
{
|
||||
$invite = $command->invite;
|
||||
|
||||
$invite->claimed_at = Carbon::now();
|
||||
$invite->save();
|
||||
|
||||
event(new InviteWasClaimed($invite));
|
||||
}
|
||||
}
|
||||
43
app/Handlers/Commands/Metric/AddMetricCommandHandler.php
Normal file
43
app/Handlers/Commands/Metric/AddMetricCommandHandler.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\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Metric\AddMetricCommand;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class AddMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add metric command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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,
|
||||
]);
|
||||
|
||||
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\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Metric\AddMetricPointCommand;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricPointWasAddedEvent;
|
||||
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\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;
|
||||
}
|
||||
}
|
||||
35
app/Handlers/Commands/Metric/RemoveMetricCommandHandler.php
Normal file
35
app/Handlers/Commands/Metric/RemoveMetricCommandHandler.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\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Metric\RemoveMetricCommand;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class RemoveMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove metric command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Metric\RemoveMetricPointCommand;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricPointWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class RemoveMetricPointCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the remove metric point command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\Metric\RemoveMetricPointCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(RemoveMetricPointCommand $command)
|
||||
{
|
||||
$metricPoint = $command->metricPoint;
|
||||
|
||||
event(new MetricPointWasRemovedEvent($metricPoint));
|
||||
|
||||
$metricPoint->delete();
|
||||
}
|
||||
}
|
||||
61
app/Handlers/Commands/Metric/UpdateMetricCommandHandler.php
Normal file
61
app/Handlers/Commands/Metric/UpdateMetricCommandHandler.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\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Metric\UpdateMetricCommand;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class UpdateMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the update metric command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\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\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,
|
||||
];
|
||||
|
||||
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\Handlers\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Metric\UpdateMetricPointCommand;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricPointWasUpdatedEvent;
|
||||
|
||||
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\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,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\Handlers\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Subscriber\SubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Commands\Subscriber\VerifySubscriberCommand;
|
||||
use CachetHQ\Cachet\Events\Subscriber\SubscriberHasSubscribedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
|
||||
class SubscribeSubscriberCommandHandler
|
||||
{
|
||||
use DispatchesJobs;
|
||||
|
||||
/**
|
||||
* Handle the subscribe subscriber command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\Subscriber\SubscribeSubscriberCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\Subscriber
|
||||
*/
|
||||
public function handle(SubscribeSubscriberCommand $command)
|
||||
{
|
||||
$subscriber = Subscriber::create(['email' => $command->email]);
|
||||
|
||||
if ($command->verified) {
|
||||
$this->dispatch(new VerifySubscriberCommand($subscriber));
|
||||
} else {
|
||||
event(new SubscriberHasSubscribedEvent($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\Handlers\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Commands\Subscriber\UnsubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Events\Subscriber\SubscriberHasUnsubscribedEvent;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class UnsubscribeSubscriberCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the subscribe customer command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Commands\Subscriber\UnsubscribeSubscriberCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UnsubscribeSubscriberCommand $command)
|
||||
{
|
||||
$subscriber = $command->subscriber;
|
||||
|
||||
event(new SubscriberHasUnsubscribedEvent($subscriber));
|
||||
|
||||
$subscriber->delete();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user