You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
Compare commits
802 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53f590602b | |||
| 0ae4955dfc | |||
| 69114110ba | |||
| 7e43819ab2 | |||
| 1e60386cb2 | |||
| 79d90c3894 | |||
| 4a88c8457b | |||
| aa85e91d70 | |||
| 287ecd1c7c | |||
| cb651dc24f | |||
| 41e2c89a04 | |||
| eab2b60bc7 | |||
| 4488d8af95 | |||
| b75d95553d | |||
| 42a5991b92 | |||
| 3e957d5351 | |||
| 1e287973db | |||
| f72bcb2b10 | |||
| a202b509f1 | |||
| 36f95532a8 | |||
| f6c5eff405 | |||
| 8759c80736 | |||
| 14626603dd | |||
| 7d113ddacf | |||
| 578eb01cfe | |||
| 5c4a2d5d32 | |||
| 8342fe7a53 | |||
| 53033a42ee | |||
| 24e029b3b5 | |||
| 08faa4d454 | |||
| 93c63474b9 | |||
| 3524cf126b | |||
| 7db25c4b4b | |||
| 56ed5920e2 | |||
| b467e48111 | |||
| 2061e3c589 | |||
| 9fc7190a72 | |||
| 1a44e0e3fe | |||
| d4abd5ed82 | |||
| 52ac07a9e0 | |||
| 340d88b8f2 | |||
| 7d55f2c70c | |||
| 1d4e5c635d | |||
| baaea9b4e8 | |||
| d5f4d90a58 | |||
| bd69b1f25b | |||
| 12ae53ae04 | |||
| f6bfb8498f | |||
| fc85e54ce6 | |||
| 4d7d950f6f | |||
| 521f3466bc | |||
| fe3a4cd8b9 | |||
| 3c1c21e7bf | |||
| 01b6466b90 | |||
| 22191fedce | |||
| 077d30657d | |||
| 05c6dfedcc | |||
| e9e2fbf799 | |||
| a4afa18833 | |||
| 65b7d64164 | |||
| cbddeacdd6 | |||
| 62e487355d | |||
| d07ef17d8b | |||
| 2c44461b10 | |||
| f888d3af4b | |||
| 4424b5e6fa | |||
| d8703c5659 | |||
| 6c26ab8a9d | |||
| 1ba894dedf | |||
| 910a69ecd6 | |||
| d3adc0a2ed | |||
| cd3533d632 | |||
| 2d0808b463 | |||
| 4db57be02a | |||
| aa7c0388c1 | |||
| 1de8b366bb | |||
| 4091853094 | |||
| 0b90154866 | |||
| 6c3725628f | |||
| 10cb8078a9 | |||
| 40246f68f8 | |||
| b2ea757f6f | |||
| a2e6fbfb61 | |||
| ea6fc4ba6b | |||
| ac1c2e300c | |||
| 7f9af81f43 | |||
| 7fa808ab39 | |||
| 3d20dc457a | |||
| 494a13c38c | |||
| e651f12c09 | |||
| 848f23a6a0 | |||
| dc3e146fe0 | |||
| 29610005c2 | |||
| 526bc76bda | |||
| e92519ee58 | |||
| b26fea958e | |||
| e77e1f2ccd | |||
| 524cc958f9 | |||
| 58993e9c4c | |||
| dd66599b38 | |||
| 946fd574de | |||
| 736764e2e7 | |||
| 8cce639af9 | |||
| f5f2875db8 | |||
| 9a013a95d8 | |||
| 8584685482 | |||
| df03ac38dd | |||
| 55da714208 | |||
| 68e3c7b7da | |||
| e964e7abb1 | |||
| 8d36d4dc6a | |||
| 041cb51b72 | |||
| c3bbe24d96 | |||
| 6c271bc23c | |||
| a2c28cf57e | |||
| 796618caaa | |||
| ad1f718e50 | |||
| 87e668b517 | |||
| a5fe5ef98c | |||
| 926cb9fe70 | |||
| ce0a6e70fc | |||
| 6d722bb885 | |||
| 93c441b424 | |||
| 577ef2a565 | |||
| 3bcb044b61 | |||
| a0b1eddb78 | |||
| 6f056d5b39 | |||
| 3afe2f2b13 | |||
| 587809760e | |||
| 60a76cf1c3 | |||
| 9cba37e163 | |||
| 84d3217c63 | |||
| 5d66b56519 | |||
| 6f89a1ac4a | |||
| 879c404196 | |||
| f4c99b91c4 | |||
| 3f0087d7c3 | |||
| 15f300a266 | |||
| 19eee688d3 | |||
| 575b50d0c5 | |||
| da66da851a | |||
| 30e476dbdc | |||
| c612f215e6 | |||
| 51aa5f91af | |||
| 5f3c606485 | |||
| afd54ac0d1 | |||
| e140ad27a2 | |||
| ee749329ea | |||
| 05090ea179 | |||
| aa06d46f29 | |||
| eb64ea5966 | |||
| 1cb169dde5 | |||
| 94464e0012 | |||
| 7103bc4932 | |||
| 5492d30374 | |||
| 5c673b19ca | |||
| c85e84c65a | |||
| 1d7b6f0086 | |||
| 5b0171484a | |||
| f18f1be0a4 | |||
| 2c542d056f | |||
| 2e14352012 | |||
| c13ac72b91 | |||
| 98e7f6e878 | |||
| fbb0a996da | |||
| fc5843f4be | |||
| 7a84acb91a | |||
| 62e16d9055 | |||
| 71523c72a5 | |||
| 01b9c35b69 | |||
| 2ef641ae55 | |||
| 0c8ea5f58e | |||
| c12d9fa8bb | |||
| 7ff1ec4fc1 | |||
| 582e12ead4 | |||
| cfb5a1d189 | |||
| c445112920 | |||
| 15d8f1d094 | |||
| 32f07dc08b | |||
| d2f05895fd | |||
| 428c4ba7a6 | |||
| a30c316e4e | |||
| c71a223168 | |||
| c41ed981f0 | |||
| e6237cbe42 | |||
| 02c0ee3a60 | |||
| 38e46d1e01 | |||
| 48d7eabeeb | |||
| 44189c6df0 | |||
| d903d14fa3 | |||
| ae3d11cfa3 | |||
| 74613bc220 | |||
| 3d7df32ca5 | |||
| cf77cfd0f3 | |||
| 09273a0074 | |||
| 8e41c0b704 | |||
| 6355efdbc4 | |||
| 42a86e066b | |||
| 82320f4582 | |||
| b5f444281a | |||
| 92afbf471d | |||
| c3169b5240 | |||
| a5f2af87a0 | |||
| 5bb78c783c | |||
| e7ab758ab3 | |||
| 2601b2ed14 | |||
| 7fd39952c9 | |||
| fec5cf2f11 | |||
| aaa48c86c6 | |||
| a86eade1a8 | |||
| 74e4864774 | |||
| 0c6d2bce97 | |||
| 09fc4d6ec5 | |||
| f9415ab58c | |||
| 0f525fa74b | |||
| 991dad3dae | |||
| 046dbdd006 | |||
| 23d25365f0 | |||
| e1c1fde07c | |||
| 2159d73e59 | |||
| 22be871b8c | |||
| f89c14fb5e | |||
| b26d8865a0 | |||
| 3dcffd14bf | |||
| b527b31aaf | |||
| b19f851601 | |||
| 51133b7b23 | |||
| 7dd4db8d68 | |||
| 2d1d67d653 | |||
| a362536f44 | |||
| 49603193ee | |||
| 1dac7bfdbb | |||
| 9aab8e61a9 | |||
| d52873de7f | |||
| 7168450fe7 | |||
| b26e8206ae | |||
| dd98181ea3 | |||
| 397b80d960 | |||
| d97ea998f0 | |||
| 0c9eeb9f63 | |||
| c08ab3eac3 | |||
| 8b745cba79 | |||
| 01d03f985c | |||
| e144f7f435 | |||
| 1ca50cd080 | |||
| a8c4bf44f4 | |||
| 3abf9ee5b5 | |||
| 37bc69b23c | |||
| b342eac638 | |||
| 2e50494bb8 | |||
| b6ff681393 | |||
| ef93b72749 | |||
| c34109e2f3 | |||
| 70e93e60bf | |||
| ddc9a35502 | |||
| e545d79550 | |||
| 733052dcc9 | |||
| 8726a8b9fd | |||
| 0be25987cb | |||
| 279f0fb11a | |||
| 62d66c6165 | |||
| 579698ecdf | |||
| a688cfc61d | |||
| 82ac1be6c8 | |||
| 2d6e3dab80 | |||
| 7025542bf3 | |||
| 4d2c473db2 | |||
| 271b506d6a | |||
| 07842baeb9 | |||
| 3e0b49d9db | |||
| 4fb26397d6 | |||
| 4fba0c1b97 | |||
| d3d20e8a31 | |||
| 831273b783 | |||
| 78f0827d58 | |||
| e40a85fc22 | |||
| 3da3c00981 | |||
| a715c541be | |||
| 8739d2210e | |||
| 0bd9f77753 | |||
| eef61aaed0 | |||
| d6142cdbf3 | |||
| 8686e1cbba | |||
| 6cc879e2ab | |||
| 81ebb2103a | |||
| 454720772d | |||
| 24fd5a2087 | |||
| 026414a17e | |||
| 20f7f5a56f | |||
| 4586119639 | |||
| 4fe61be9e1 | |||
| ad531d3d30 | |||
| 82d5932d6e | |||
| 2779d3048c | |||
| 18896b388c | |||
| 27ce75f43d | |||
| c3c956b768 | |||
| 49082393b5 | |||
| e6bfa50e5a | |||
| e711678c21 | |||
| c3867b3552 | |||
| e31cc00d48 | |||
| 8da3bbf57c | |||
| 34885e2a0b | |||
| c490d53dfd | |||
| 0c087ba431 | |||
| e83ef40616 | |||
| c9ac8d546f | |||
| ff48db2429 | |||
| 153baea77c | |||
| ecea2156bd | |||
| e1e33b9726 | |||
| a16062f660 | |||
| 9d2c23cc46 | |||
| f2bf10dcde | |||
| e619d8b1d7 | |||
| a602890934 | |||
| d28fdb62a5 | |||
| ecd84dbd60 | |||
| f64f0aaff1 | |||
| 3e96310345 | |||
| cc1ef87956 | |||
| 03c2253f57 | |||
| f1b5240651 | |||
| e09ca50228 | |||
| 00f5d48352 | |||
| a71b49e581 | |||
| 669e389677 | |||
| 5885d7d23a | |||
| 2aabd64c35 | |||
| 28c063569c | |||
| b4b42b6620 | |||
| a1d8981a41 | |||
| 36e490c262 | |||
| 9ba60c72fc | |||
| bf82012cf5 | |||
| 9799e5ef40 | |||
| 7796af2901 | |||
| d15a7c7014 | |||
| 1a6d3f9ef3 | |||
| 7d2a7f0d90 | |||
| 507b5d5ae5 | |||
| 8f92ef3c39 | |||
| 45e6487298 | |||
| fabac76ef4 | |||
| 963db073e3 | |||
| 68ade8a64c | |||
| b1e8b0336a | |||
| 51ffaeb833 | |||
| 10841957ca | |||
| a19f4c4da1 | |||
| 534b79d38d | |||
| 650c7df556 | |||
| 611a9f4a97 | |||
| 6cecb64c77 | |||
| f4afe4eff8 | |||
| 2c3728cad6 | |||
| 8c9e9a8897 | |||
| 49ee50c64e | |||
| 91db413e16 | |||
| 8cc6cf7ac8 | |||
| c14b58d470 | |||
| bcf67f2704 | |||
| e66f7e0f3e | |||
| 9d038c2787 | |||
| 3c967d5343 | |||
| b02fc888ff | |||
| 84e6d68c2c | |||
| be58f37467 | |||
| 7e5116eaed | |||
| 419d4d863c | |||
| 23013a2c6d | |||
| eec4a4b1c7 | |||
| ba9be9416a | |||
| 603fd15339 | |||
| aa1ef3dbd4 | |||
| d762cff896 | |||
| 3f7b2aba94 | |||
| 39becf4acf | |||
| 7195e33f9d | |||
| f70b4fece4 | |||
| 6f6f5d6519 | |||
| 434076bc7a | |||
| c7845de9fd | |||
| 7ede6c5ee4 | |||
| 1f123f9b6e | |||
| b6b3e57df5 | |||
| 2421109b2f | |||
| 798eca08df | |||
| fd6f43026b | |||
| 7514810cb7 | |||
| 158b949e2d | |||
| 827232b772 | |||
| 871fd359d7 | |||
| 130bec92c3 | |||
| 97144d757e | |||
| d5a200fc8e | |||
| b120be0cac | |||
| 869fbe1cd4 | |||
| 96e234e0ba | |||
| 3cbb90d848 | |||
| 65d486d974 | |||
| 08774cd273 | |||
| 805d1466c2 | |||
| 621552d82a | |||
| 36c2cdae93 | |||
| aeacafcae3 | |||
| c6fafc50a7 | |||
| e1a6a5ff3a | |||
| ad7c02baa9 | |||
| af029f27cb | |||
| e79dad524c | |||
| 6531a47ea3 | |||
| 9658f8166d | |||
| de3fd475b9 | |||
| c14ec9b7bc | |||
| 8abe1d59b5 | |||
| c0c3e826fe | |||
| 804fbd8a24 | |||
| 22d95ce923 | |||
| 90e83185cf | |||
| 548459afaa | |||
| a61e32fdab | |||
| 15fc097a18 | |||
| a7c32c59c9 | |||
| 4d87537b12 | |||
| 1249e51322 | |||
| c7ddeff16e | |||
| 211fa8c7ee | |||
| 88bedffdca | |||
| 9e008e4ab9 | |||
| 3d502be398 | |||
| e254f35a4f | |||
| d0950be433 | |||
| 05653acc10 | |||
| 233d42bac6 | |||
| c4bf553084 | |||
| 66e3ff5459 | |||
| c6f4b8bbbb | |||
| 83de486dd7 | |||
| dd0062ad87 | |||
| fa537c304d | |||
| b94c1c86b7 | |||
| 09ea02e975 | |||
| f305d63225 | |||
| 8e852700c4 | |||
| dbb2f7bfc0 | |||
| 39df1f4e43 | |||
| dcf3d340eb | |||
| f208d9bd19 | |||
| cb492bcbb8 | |||
| f34c8a08b7 | |||
| 1cc550bb9e | |||
| bba6362de0 | |||
| 61a02a4c8d | |||
| 3e8d7e7912 | |||
| 14e5b5b6ff | |||
| 6ac35c35dd | |||
| ab1b193e87 | |||
| e10a6b5bb1 | |||
| 06c63f1889 | |||
| 986bd34da7 | |||
| 8938ed4395 | |||
| 5f4b57e95a | |||
| dcbf633fc7 | |||
| 94c5532d68 | |||
| 519cdc57f0 | |||
| 09a6b16a4e | |||
| 675f5b9219 | |||
| ed1d4154e9 | |||
| 2f0019630c | |||
| 54e2fc5527 | |||
| 969f6209d4 | |||
| a4ab649e4c | |||
| f6bbcd8247 | |||
| f7f659f2e4 | |||
| 593abafa5b | |||
| 845f864068 | |||
| 60302b7afe | |||
| aab84a94b8 | |||
| 3cfe2499b0 | |||
| 198b7e0817 | |||
| 367613f0a8 | |||
| c8e7e35e06 | |||
| c53691883c | |||
| b54e2f8f2c | |||
| ce0a28b03c | |||
| 13012ce31e | |||
| 686be4cdca | |||
| e2b28d4c8f | |||
| 28c062a33c | |||
| 7c809ebb61 | |||
| 82e6b6ee7c | |||
| 1e8267c425 | |||
| 283fd0ff34 | |||
| f5d4165340 | |||
| 0465866b45 | |||
| de061f767b | |||
| de1d79fb6b | |||
| 3bd0365245 | |||
| 1e66da4a1f | |||
| 77e9e18f5b | |||
| a3f87e2e90 | |||
| 17ba18ae09 | |||
| 74f53e1594 | |||
| 6bd7c6636e | |||
| 795d760566 | |||
| 19c6e8e307 | |||
| 684c9f4fd8 | |||
| 546b289b7d | |||
| ab51c3cd47 | |||
| 9e0e2608bc | |||
| ce08519960 | |||
| 72aeb57544 | |||
| 68fee8dcf0 | |||
| c47af8ea87 | |||
| 301216953c | |||
| 3302fed281 | |||
| 062d1c7caf | |||
| fa9646c51c | |||
| cb66d6a711 | |||
| d5cb059bf4 | |||
| dd4bef71b8 | |||
| 32c54004d8 | |||
| 5c56f3afa7 | |||
| cb893566cb | |||
| 4b3cc2d8be | |||
| 1ccaeebd39 | |||
| d9e04f84cd | |||
| 0940bb88db | |||
| 3b8531b229 | |||
| 8bd2388daa | |||
| 1e7d0b852c | |||
| 09f32c7370 | |||
| 018e83b8da | |||
| d0786180ee | |||
| 41f20203d9 | |||
| dca05ce4a3 | |||
| 4bb9cda8c5 | |||
| d929134fb4 | |||
| 0a3521a63a | |||
| e205d8017a | |||
| 78ee6c5eb0 | |||
| 1d79154c88 | |||
| f1d2ea7957 | |||
| e3da134c85 | |||
| 583aba6c75 | |||
| 0addfb421c | |||
| b34d506ae3 | |||
| f66993a17e | |||
| 86e25e13a7 | |||
| 4150850ae8 | |||
| 574e028340 | |||
| be4f033f7b | |||
| bc1ad9f75e | |||
| 43a10c3623 | |||
| e7f30597b5 | |||
| aeaf31b5bb | |||
| 7163a2afc6 | |||
| 2bc3bd5997 | |||
| 62b5868db9 | |||
| 75b2ece3ba | |||
| fbe53087f5 | |||
| 65881412aa | |||
| 9c6649be09 | |||
| a826f86729 | |||
| e1727198ee | |||
| a37bef519b | |||
| 8de5c130a5 | |||
| 01cba067d1 | |||
| ffe03a31fe | |||
| 8e5f1cad71 | |||
| 6477472ab1 | |||
| a6a54e80f2 | |||
| d34f59b754 | |||
| e00cbb7765 | |||
| dbba1d1a7b | |||
| 18c3cbc742 | |||
| 85116b0efc | |||
| 0794098a6a | |||
| 7533dd16e2 | |||
| 1ae2eec55b | |||
| 9da9e19083 | |||
| 50e669538a | |||
| 4bc1970484 | |||
| f0383abc7b | |||
| e8bb9cdefa | |||
| e6adbc64c6 | |||
| d82672ded8 | |||
| 3d0ad80544 | |||
| a2cd943b21 | |||
| c30d6f75cf | |||
| 9dbe9ca498 | |||
| 337701ee66 | |||
| 16c96a1030 | |||
| 8aec2a41e9 | |||
| 07bab5406d | |||
| 4014955cb6 | |||
| 1a273d2997 | |||
| 4458eb34d5 | |||
| 7f183834b1 | |||
| ff01450292 | |||
| d87a757e0d | |||
| e931a92b76 | |||
| cae611a3a5 | |||
| 86f30d34ac | |||
| 523d6bb771 | |||
| 4b1e3acacf | |||
| e543b42667 | |||
| 958e1aef1d | |||
| 60c575f507 | |||
| bcced9a211 | |||
| 2a6b7f51ed | |||
| b344c805b4 | |||
| be50c09c04 | |||
| 9bc27c09e9 | |||
| bc946241c6 | |||
| 88ead215ae | |||
| 09fd486230 | |||
| d42d6dcff3 | |||
| 024bfc4a8b | |||
| 2a4d53439e | |||
| c3a5276b75 | |||
| 39d3dcd6c7 | |||
| e528dcd8d8 | |||
| 33dbbfc4e3 | |||
| ecc95c5cab | |||
| 34060f902a | |||
| 58165ee023 | |||
| d6105ce0ac | |||
| 6e4620ef77 | |||
| 037feb6a42 | |||
| 294fb60359 | |||
| 37bc6ac15a | |||
| dc06cde65d | |||
| e8fd0e3528 | |||
| f558de4998 | |||
| c01edf1c66 | |||
| 666acc28f4 | |||
| dc867cdd39 | |||
| 76ff558e94 | |||
| 1d993db11e | |||
| 8866d136cb | |||
| 7f8b5111bc | |||
| bb75e7c8bf | |||
| 9dea423eec | |||
| 5237de5c1d | |||
| db27298749 | |||
| a8eba8f8c4 | |||
| 8eaaa0ea79 | |||
| a4b3d851c0 | |||
| b04b8e8c51 | |||
| b849d03dba | |||
| 88420c2e22 | |||
| 19d0a4a06c | |||
| a56a7a6515 | |||
| 2138e2e9d6 | |||
| 8b4b2742b7 | |||
| f40102d839 | |||
| 52f0d06ca6 | |||
| 12c0291ffc | |||
| b48a674ff8 | |||
| 5b2963230b | |||
| e85face97d | |||
| 232b13aca4 | |||
| bd004e17ef | |||
| 508ebbc451 | |||
| d5d113e3c2 | |||
| 8f4fdeeaa4 | |||
| c675167ec5 | |||
| cdba580a26 | |||
| 83d945a81b | |||
| a45d276be2 | |||
| 1fe12386db | |||
| c76067b30a | |||
| 55e76648d8 | |||
| d59beb660f | |||
| 2a3dbfd158 | |||
| cc0c0b5f50 | |||
| 481efbb8a3 | |||
| 7471fbc181 | |||
| ef463d3bfa | |||
| 4271a9818c | |||
| b85b185e98 | |||
| d7783cae2a | |||
| 9f7d95bd70 | |||
| 416969f3b3 | |||
| e8725d8ad9 | |||
| 222c7c2b28 | |||
| bdfc6bc9d5 | |||
| 69bbbd9aed | |||
| 8dd5380af9 | |||
| fd52411349 | |||
| 6eca13508c | |||
| 7c7eae857c | |||
| 4f65e8c18d | |||
| cc57c34071 | |||
| 60afbbb420 | |||
| 47dc1c8021 | |||
| 8b8341d918 | |||
| 9ca36c5be9 | |||
| 5ecddac8da | |||
| a949484523 | |||
| f37818deee | |||
| 412e386eb6 | |||
| 32e08e3c8f | |||
| d26b14453a | |||
| 3410f4e7b6 | |||
| 984f18a1c0 | |||
| 0086f76b11 | |||
| 12b90e4b38 | |||
| 1674e0354f | |||
| 19c2ab8c72 | |||
| 40d24be701 | |||
| aeec1c52fb | |||
| 5f8c2ac7b7 | |||
| 4ccd34e6bc | |||
| 9e61bd9b8c | |||
| da9f7535e4 | |||
| 9d248e0e87 | |||
| 6b872d2cd0 | |||
| 319c58a891 | |||
| 519953830c | |||
| 310ab78a7e | |||
| 3588ac8d16 | |||
| a9c426f5ce | |||
| 7c5a258fc7 | |||
| 94ff72e864 | |||
| 52326331c0 | |||
| 059c50618d | |||
| b82688fdc9 | |||
| 151ce7ddd4 | |||
| f1ae29f333 | |||
| e7d019da87 | |||
| cdf0f7949a | |||
| 67a2c1777a | |||
| bffd95429f | |||
| 219722714e | |||
| f777e028e5 | |||
| 3d4083bdd9 | |||
| b6c6b1c2fc | |||
| a19c16a7b5 | |||
| 44826424af | |||
| 0df011527f | |||
| dc222e2b64 | |||
| e65635f7c7 | |||
| 089bba175e | |||
| 708880d5fd | |||
| 22290e02b6 | |||
| 6108f66b25 | |||
| 97e32a6a6e | |||
| 4f9b89fcaf | |||
| 205907b9ce | |||
| e60e45f11a | |||
| 9917f70895 | |||
| c88ca45a8d | |||
| f00c657bdc | |||
| 6e98a3d4c5 | |||
| bf4b769e99 | |||
| c5029a5d44 | |||
| 9fbbfa6588 | |||
| 8bdb9c3ac1 | |||
| f845d19c3f | |||
| 71b7908f92 | |||
| 7c45946c90 | |||
| ff10246ed7 | |||
| a15a481a9f | |||
| c2c1e951a9 | |||
| ffd4e8c8d8 | |||
| bdf5c6a690 | |||
| 3f78c3d9c5 | |||
| 90b8e3f4e9 | |||
| 7ffdd92ae0 | |||
| 2586578c9a | |||
| 529775dc81 | |||
| 55ec29bd3f | |||
| ab264c7f41 | |||
| 90c866effc | |||
| f2bcc44ff1 | |||
| e845b33608 | |||
| fe3a7b4628 | |||
| df1ba5aaad | |||
| 4979c3cfce | |||
| 1a6a8988dd | |||
| 598da9586d | |||
| 7724ad4a74 | |||
| 8c31f8b831 | |||
| e3b92d18a7 | |||
| ee936fd8d0 | |||
| 17c7e32444 | |||
| 4468c7e7e4 | |||
| e68ec4f3cb | |||
| 8fc15bc52d | |||
| 9db6e68616 | |||
| 13f2683c87 | |||
| 30fb4672f1 | |||
| d8b3a2a193 | |||
| c87b6acd3f | |||
| b5ced6b4c7 | |||
| f3e3ada6f3 | |||
| 2dd3863225 | |||
| 52906081ef |
@@ -0,0 +1,13 @@
|
||||
|
||||
# Path-based git attributes
|
||||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
|
||||
# Ignore all test and documentation with "export-ignore".
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/.styleci.yml export-ignore
|
||||
/tests export-ignore
|
||||
/.editorconfig export-ignore
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
github: yoeunes
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
||||
custom: ['https://www.paypal.com/paypalme/yoeunes']
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Auto Closer PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
comment: |
|
||||
Hi, thank you for your contribution.
|
||||
|
||||
Unfortunately, this repository is read-only. It's a split from our main monorepo repository.
|
||||
|
||||
We'd like to kindly ask you to move the contribution there - https://github.com/php-flasher/php-flasher.
|
||||
|
||||
We'll check it, review it and give you feed back right way.
|
||||
|
||||
Thank you.
|
||||
@@ -0,0 +1,36 @@
|
||||
name: PHP Composer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate --strict
|
||||
|
||||
- name: Cache Composer packages
|
||||
id: composer-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor
|
||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-php-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist --no-progress
|
||||
|
||||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
|
||||
# Docs: https://getcomposer.org/doc/articles/scripts.md
|
||||
|
||||
# - name: Run test suite
|
||||
# run: composer run-script test
|
||||
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
vendor
|
||||
composer.lock
|
||||
.phpunit.result.cache
|
||||
.phpcs-cache
|
||||
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at younes.khoubza@gmail.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,14 @@
|
||||
# Contributing
|
||||
|
||||
Contributions are **welcome** and will be fully **credited**. We accept contributions via Pull Requests on [Github](https://github.com/php-flasher/php-flasher).
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- **[PSR-2 Coding Standard.](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** The easiest way to apply the conventions is to install [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).
|
||||
- **Add tests!** Your patch won't be accepted if it doesn't have tests.
|
||||
- **Document any change in behaviour.** Make sure the `README.md` and any other relevant documentation are kept up-to-date.
|
||||
- **Consider our release cycle.** We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
|
||||
- **Create feature branches.** Don't ask us to pull from your master branch.
|
||||
- **One pull request per feature.** If you want to do more than one thing, send multiple pull requests.
|
||||
- **Send coherent history.** Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 PHPFlasher
|
||||
Copyright (c) 2020 PHP Flasher
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
<p align="center"><img width="600" alt="flasher" src="https://user-images.githubusercontent.com/10859693/102468596-03317180-4052-11eb-9df3-44dc6235b238.png"></p>
|
||||
|
||||
<h1 align="center">A powerful and flexible flash notifications system for PHP, Laravel, Symfony</h1>
|
||||
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo-dark.svg">
|
||||
<img width="600" src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo.svg" alt="PHPFlasher Logo">
|
||||
</picture>
|
||||
:eyes: PHP Flasher helps you to add flash notifications to your PHP projects.
|
||||
This library was developed with the idea that you should be able to add flash notification to your application with ease and with few lines of code.
|
||||
No application-wide rewrites and no big investments upfront.
|
||||
</p>
|
||||
|
||||
<p align="center">Flexible flash notifications system for PHP</p>
|
||||
|
||||
Flash messages are a great way to add some simple notifications to users of your website or application about important events that may have happened.
|
||||
|
||||
PHPFlasher gives a straightforward way to give feedback messages in the current or the next page to users with a flashing system.
|
||||
|
||||
The flashing system basically makes it possible to record a message and store it within the session so that it can be retrieved when needed.
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [PHPFlasher website](https://php-flasher.io).
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/badge/source-php--flasher/flasher-blue.svg?style=flat-square">
|
||||
@@ -34,33 +24,54 @@ Documentation for PHPFlasher can be found on the [PHPFlasher website](https://ph
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/backer/badge.svg?label=backer&color=brightgreen" />
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Why use PHPFlasher ?
|
||||
# Why use PHP Flasher ?
|
||||
|
||||
The PHPFlasher project supports many notification libraries : [__toastr.js__](https://php-flasher.io/docs/adapter/toastr/), [__sweetalert 2__](https://php-flasher.io/docs/adapter/sweetalert/), [__pnotify__](https://php-flasher.io/docs/adapter/pnotify/), [__noty__](https://php-flasher.io/docs/adapter/noty/) and [__notyf__](https://php-flasher.io/docs/adapter/notyf/)
|
||||
The PHP Flasher project supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__, and __notyf__
|
||||
and its highly extendable so you can add your custom notifications.
|
||||
|
||||
This library is designed, so you can take full control when creating you notifications :
|
||||
|
||||
> * Show various notifications simultaneously
|
||||
> * Render notification easily from javascript with small footprint
|
||||
> * LTR and Dark-mode support
|
||||
> * Limit the amount of displayed notifications
|
||||
> * Show Desktop notifications for Linux, macOS and Windows
|
||||
> * Framework-agnostic with implementations for: Symfony and Laravel
|
||||
> * Autocomplete for PHPSTORM
|
||||
> * You can always create an adapter yourself
|
||||
> * Display multiple notifications
|
||||
> * Sort and filter notifications
|
||||
> * Render notification from JSON object
|
||||
> * Limit the number of displayed notifications
|
||||
> * Show notifications from different libraries at the same time
|
||||
> * Framework angostic with integration for : Symfony and Laravel
|
||||
> * Support templates
|
||||
> * Easy migration from similar libraries.
|
||||
> * Very flexible so you can add you own adapters
|
||||
> * ...and more
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHPFlasher can be found on the [PHPFlasher website](https://php-flasher.io).
|
||||
Documentation for PHP Flasher can be found on the [PHP Flasher website](https://php-flasher.github.io/).
|
||||
|
||||
## Backers && Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your name will show up in the Contribute page of all PHP Flasher installations as well as here with a link to your website!
|
||||
|
||||
Thank you to all our backers and sponsors! 🙏
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#backers" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/backers.svg?width=890" title="Backers" alt="Backers">
|
||||
</a>
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#sponsors" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/sponsors.svg?width=890" title="Sponsors" alt="Sponsors">
|
||||
</a>
|
||||
|
||||
### Contact
|
||||
|
||||
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. You can reach out with questions, bug reports, or feature requests
|
||||
PHP Flasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. You can reach out with questions, bug reports, or feature requests
|
||||
on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/flasher/issues)
|
||||
@@ -71,6 +82,6 @@ on any of the following:
|
||||
|
||||
## License
|
||||
|
||||
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
PHP Flasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> <b> </p>
|
||||
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# Make sure the release tag is provided.
|
||||
if (( "$#" != 1 ))
|
||||
then
|
||||
echo "Tag has to be provided."
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_BRANCH="main"
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
VERSION=$1
|
||||
|
||||
# Make sure current branch and release branch match.
|
||||
if [[ "$RELEASE_BRANCH" != "$CURRENT_BRANCH" ]]
|
||||
then
|
||||
echo "Release branch ($RELEASE_BRANCH) does not match the current active branch ($CURRENT_BRANCH)."
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure the working directory is clear.
|
||||
if [[ ! -z "$(git status --porcelain)" ]]
|
||||
then
|
||||
echo "Your working directory is dirty. Did you forget to commit your changes?"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure latest changes are fetched first.
|
||||
git fetch origin
|
||||
|
||||
# Make sure that release branch is in sync with origin.
|
||||
if [[ $(git rev-parse HEAD) != $(git rev-parse origin/$RELEASE_BRANCH) ]]
|
||||
then
|
||||
echo "Your branch is out of date with its upstream. Did you forget to pull or push any changes before releasing?"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Always prepend with "v"
|
||||
if [[ $VERSION != v* ]]
|
||||
then
|
||||
VERSION="v$VERSION"
|
||||
fi
|
||||
|
||||
# Tag PHP Flasher
|
||||
git tag "$VERSION"
|
||||
git push origin --tags --force
|
||||
|
||||
# Tag Repositories
|
||||
for REMOTE in flasher flasher-laravel flasher-symfony \
|
||||
flasher-toastr flasher-toastr-laravel flasher-toastr-symfony \
|
||||
flasher-notyf flasher-notyf-laravel flasher-notyf-symfony \
|
||||
flasher-sweet-alert flasher-sweet-alert-laravel flasher-sweet-alert-symfony \
|
||||
flasher-pnotify flasher-pnotify-laravel flasher-pnotify-symfony \
|
||||
flasher-noty flasher-noty-laravel flasher-noty-symfony
|
||||
do
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Releasing $REMOTE";
|
||||
|
||||
TMP_DIR="/tmp/php-flasher"
|
||||
REMOTE_URL="git@github.com:php-flasher/$REMOTE.git"
|
||||
|
||||
rm -rf $TMP_DIR;
|
||||
mkdir $TMP_DIR;
|
||||
|
||||
(
|
||||
cd $TMP_DIR;
|
||||
|
||||
git clone $REMOTE_URL .
|
||||
git checkout "$RELEASE_BRANCH";
|
||||
|
||||
git tag "$VERSION"
|
||||
git push origin --tags
|
||||
)
|
||||
done
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
CURRENT_BRANCH="main"
|
||||
|
||||
function split()
|
||||
{
|
||||
# git merge --strategy recursive --strategy-option subtree="$1" "$2/$CURRENT_BRANCH" --allow-unrelated-histories -m "Merge remote-tracking branch '$2/$CURRENT_BRANCH'"
|
||||
SHA1=$(./bin/splitsh-lite --prefix="$1")
|
||||
git push $2 "$SHA1:refs/heads/$CURRENT_BRANCH" -f
|
||||
}
|
||||
|
||||
function remote()
|
||||
{
|
||||
git remote add "$1" "$2" || true
|
||||
}
|
||||
|
||||
git pull origin $CURRENT_BRANCH
|
||||
|
||||
remote flasher git@github.com-yoeunes:php-flasher/flasher.git
|
||||
remote laravel git@github.com-yoeunes:php-flasher/flasher-laravel.git
|
||||
remote symfony git@github.com-yoeunes:php-flasher/flasher-symfony.git
|
||||
|
||||
remote toastr git@github.com-yoeunes:php-flasher/flasher-toastr.git
|
||||
remote toastr-laravel git@github.com-yoeunes:php-flasher/flasher-toastr-laravel.git
|
||||
remote toastr-symfony git@github.com-yoeunes:php-flasher/flasher-toastr-symfony.git
|
||||
|
||||
remote notyf git@github.com-yoeunes:php-flasher/flasher-notyf.git
|
||||
remote notyf-laravel git@github.com-yoeunes:php-flasher/flasher-notyf-laravel.git
|
||||
remote notyf-symfony git@github.com-yoeunes:php-flasher/flasher-notyf-symfony.git
|
||||
|
||||
remote sweet-alert git@github.com-yoeunes:php-flasher/flasher-sweet-alert.git
|
||||
remote sweet-alert-laravel git@github.com-yoeunes:php-flasher/flasher-sweet-alert-laravel.git
|
||||
remote sweet-alert-symfony git@github.com-yoeunes:php-flasher/flasher-sweet-alert-symfony.git
|
||||
|
||||
remote pnotify git@github.com-yoeunes:php-flasher/flasher-pnotify.git
|
||||
remote pnotify-laravel git@github.com-yoeunes:php-flasher/flasher-pnotify-laravel.git
|
||||
remote pnotify-symfony git@github.com-yoeunes:php-flasher/flasher-pnotify-symfony.git
|
||||
|
||||
remote noty git@github.com-yoeunes:php-flasher/flasher-noty.git
|
||||
remote noty-laravel git@github.com-yoeunes:php-flasher/flasher-noty-laravel.git
|
||||
remote noty-symfony git@github.com-yoeunes:php-flasher/flasher-noty-symfony.git
|
||||
|
||||
split 'src/Prime' flasher
|
||||
split 'src/Laravel' laravel
|
||||
split 'src/Symfony' symfony
|
||||
|
||||
split 'src/Toastr/Prime' toastr
|
||||
split 'src/Toastr/Laravel' toastr-laravel
|
||||
split 'src/Toastr/Symfony' toastr-symfony
|
||||
|
||||
split 'src/Notyf/Prime' notyf
|
||||
split 'src/Notyf/Laravel' notyf-laravel
|
||||
split 'src/Notyf/Symfony' notyf-symfony
|
||||
|
||||
split 'src/SweetAlert/Prime' sweet-alert
|
||||
split 'src/SweetAlert/Laravel' sweet-alert-laravel
|
||||
split 'src/SweetAlert/Symfony' sweet-alert-symfony
|
||||
|
||||
split 'src/Pnotify/Prime' pnotify
|
||||
split 'src/Pnotify/Laravel' pnotify-laravel
|
||||
split 'src/Pnotify/Symfony' pnotify-symfony
|
||||
|
||||
split 'src/Noty/Prime' noty
|
||||
split 'src/Noty/Laravel' noty-laravel
|
||||
split 'src/Noty/Symfony' noty-symfony
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
function remote()
|
||||
{
|
||||
git remote set-url "$1" "$2" || true
|
||||
}
|
||||
|
||||
remote flasher git@github.com-yoeunes:php-flasher/flasher.git
|
||||
remote laravel git@github.com-yoeunes:php-flasher/flasher-laravel.git
|
||||
remote symfony git@github.com-yoeunes:php-flasher/flasher-symfony.git
|
||||
|
||||
remote toastr git@github.com-yoeunes:php-flasher/flasher-toastr.git
|
||||
remote toastr-laravel git@github.com-yoeunes:php-flasher/flasher-toastr-laravel.git
|
||||
remote toastr-symfony git@github.com-yoeunes:php-flasher/flasher-toastr-symfony.git
|
||||
|
||||
remote notyf git@github.com-yoeunes:php-flasher/flasher-notyf.git
|
||||
remote notyf-laravel git@github.com-yoeunes:php-flasher/flasher-notyf-laravel.git
|
||||
remote notyf-symfony git@github.com-yoeunes:php-flasher/flasher-notyf-symfony.git
|
||||
|
||||
remote sweet-alert git@github.com-yoeunes:php-flasher/flasher-sweet-alert.git
|
||||
remote sweet-alert-laravel git@github.com-yoeunes:php-flasher/flasher-sweet-alert-laravel.git
|
||||
remote sweet-alert-symfony git@github.com-yoeunes:php-flasher/flasher-sweet-alert-symfony.git
|
||||
|
||||
remote pnotify git@github.com-yoeunes:php-flasher/flasher-pnotify.git
|
||||
remote pnotify-laravel git@github.com-yoeunes:php-flasher/flasher-pnotify-laravel.git
|
||||
remote pnotify-symfony git@github.com-yoeunes:php-flasher/flasher-pnotify-symfony.git
|
||||
|
||||
remote noty git@github.com-yoeunes:php-flasher/flasher-noty.git
|
||||
remote noty-laravel git@github.com-yoeunes:php-flasher/flasher-noty-laravel.git
|
||||
remote noty-symfony git@github.com-yoeunes:php-flasher/flasher-noty-symfony.git
|
||||
|
||||
Regular → Executable
+22
-12
@@ -1,22 +1,32 @@
|
||||
{
|
||||
"name": "php-flasher/php-pack",
|
||||
"description": "A pack for PHP",
|
||||
"type": "flasher-pack",
|
||||
"description": "All flasher components in one place for easy maintenance with splitsh",
|
||||
"name": "php-flasher/php-flasher",
|
||||
"type": "project",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"name": "KHOUBZA Younes",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"homepage": "https://github.com/yoeunes",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php-flasher/flasher-cli": "*",
|
||||
"php-flasher/flasher-noty": "*",
|
||||
"php-flasher/flasher-notyf": "*",
|
||||
"php-flasher/flasher-pnotify": "*",
|
||||
"php-flasher/flasher-sweetalert": "*",
|
||||
"php-flasher/flasher-toastr": "*"
|
||||
}
|
||||
"php": ">=5.3",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/Prime/helpers.php",
|
||||
"src/Toastr/Laravel/Resources/functions/toastr.php",
|
||||
"src/Noty/Laravel/Resources/functions/noty.php",
|
||||
"src/Notyf/Laravel/Resources/functions/notyf.php",
|
||||
"src/Pnotify/Laravel/Resources/functions/pnotify.php",
|
||||
"src/SweetAlert/Laravel/Resources/functions/sweetAlert.php"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
|
||||
use Symplify\EasyCodingStandard\ValueObject\Option;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$parameters = $containerConfigurator->parameters();
|
||||
|
||||
$parameters->set(Option::PATHS, [
|
||||
__DIR__ . '/src'
|
||||
]);
|
||||
|
||||
$parameters->set(Option::SKIP, [
|
||||
PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class,
|
||||
PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class,
|
||||
PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class,
|
||||
PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class,
|
||||
Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer::class,
|
||||
]);
|
||||
|
||||
$containerConfigurator->import(SetList::ARRAY);
|
||||
$containerConfigurator->import(SetList::CLEAN_CODE);
|
||||
$containerConfigurator->import(SetList::COMMENTS);
|
||||
$containerConfigurator->import(SetList::COMMON);
|
||||
$containerConfigurator->import(SetList::CONTROL_STRUCTURES);
|
||||
$containerConfigurator->import(SetList::DOCBLOCK);
|
||||
$containerConfigurator->import(SetList::NAMESPACES);
|
||||
$containerConfigurator->import(SetList::PSR_12);
|
||||
$containerConfigurator->import(SetList::SPACES);
|
||||
$containerConfigurator->import(SetList::STRICT);
|
||||
$containerConfigurator->import(SetList::SYMPLIFY);
|
||||
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class)
|
||||
->call('configure', [[
|
||||
'syntax' => 'long',
|
||||
]]);
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="flasher">
|
||||
<directory>src/Prime</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher laravel">
|
||||
<directory>src/Laravel</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher symfony">
|
||||
<directory>src/Symfony</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="flasher toastr">
|
||||
<directory>src/Toastr/Prime</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher toastr laravel">
|
||||
<directory>src/Toastr/Laravel</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher toastr symfony">
|
||||
<directory>src/Toastr/Symfony</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="flasher notyf">
|
||||
<directory>src/Notyf/Prime</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher notyf laravel">
|
||||
<directory>src/Notyf/Laravel</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher notyf symfony">
|
||||
<directory>src/Notyf/Symfony</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="flasher sweet alert">
|
||||
<directory>src/SweetAlert/Prime</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher sweet alert laravel">
|
||||
<directory>src/SweetAlert/Laravel</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher sweet alert symfony">
|
||||
<directory>src/SweetAlert/Symfony</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="flasher pnotify">
|
||||
<directory>src/Pnotify/Prime</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher pnotify laravel">
|
||||
<directory>src/Pnotify/Laravel</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher pnotify symfony">
|
||||
<directory>src/Pnotify/Symfony</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="flasher noty">
|
||||
<directory>src/Noty/Prime</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher noty laravel">
|
||||
<directory>src/Noty/Laravel</directory>
|
||||
</testsuite>
|
||||
<testsuite name="flasher noty symfony">
|
||||
<directory>src/Noty/Symfony</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
# Path-based git attributes
|
||||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
|
||||
# Ignore all test and documentation with "export-ignore".
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/.styleci.yml export-ignore
|
||||
/tests export-ignore
|
||||
/.editorconfig export-ignore
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: ['https://www.paypal.com/paypalme/yoeunes']
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
name: Running tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
laravel: [8.*, 7.*, 6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*, 5.4.*, 5.3.*, 5.2.*, 5.1.*, 5.0.*, 4.2.*, 4.1.*, 4.0.*]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
# - macos-latest
|
||||
# - windows-latest
|
||||
include:
|
||||
- laravel: 8.*
|
||||
testbench: 6.*
|
||||
php: 7.3
|
||||
phpunit: 9.3.*
|
||||
|
||||
- laravel: 7.*
|
||||
testbench: 5.*
|
||||
php: 7.3
|
||||
phpunit: 8.4.*
|
||||
|
||||
- laravel: 6.*
|
||||
testbench: 4.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- laravel: 5.8.*
|
||||
testbench: 3.8.*
|
||||
php: 7.1
|
||||
phpunit: 7.5.*
|
||||
|
||||
- laravel: 5.7.*
|
||||
testbench: 3.7.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- laravel: 5.6.*
|
||||
testbench: 3.6.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- laravel: 5.5.*
|
||||
testbench: 3.5.*
|
||||
php: 7.0
|
||||
phpunit: 6.0.*
|
||||
|
||||
- laravel: 5.4.*
|
||||
testbench: 3.4.*
|
||||
php: 5.6
|
||||
phpunit: 5.7.*
|
||||
|
||||
- laravel: 5.3.*
|
||||
testbench: 3.3.*
|
||||
php: 5.6
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 5.2.*
|
||||
testbench: 3.2.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 5.1.*
|
||||
testbench: 3.1.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 5.0.*
|
||||
testbench: 3.0.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 4.2.*
|
||||
testbench: 2.2.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 4.1.*
|
||||
testbench: 2.1.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 4.0.*
|
||||
testbench: 2.0.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
name: ${{ matrix.os }} - L${{ matrix.laravel }} - P${{ matrix.php }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
|
||||
ini-values: memory_limit=-1
|
||||
coverage: none
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench:${{ matrix.testbench }}" monolog/monolog --no-interaction --no-update
|
||||
composer update --prefer-dist --no-interaction --no-suggest
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit
|
||||
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
vendor
|
||||
composer.lock
|
||||
.phpunit.result.cache
|
||||
.phpcs-cache
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
|
||||
$mapping = [
|
||||
'' => '@',
|
||||
|
||||
'Flasher\Prime\Config\ConfigInterface' => \Flasher\Laravel\Config\Config::class,
|
||||
'Flasher\Prime\EventDispatcher\EventDispatcherInterface' => \Flasher\Prime\EventDispatcher\EventDispatcher::class,
|
||||
'Flasher\Prime\Factory\NotificationFactoryInterface' => \Flasher\Prime\Factory\NotificationFactory::class,
|
||||
'Flasher\Prime\Filter\FilterInterface' => \Flasher\Prime\Filter\Filter::class,
|
||||
'Flasher\Prime\FlasherInterface' => \Flasher\Prime\Flasher::class,
|
||||
'Flasher\Prime\Response\ResponseManagerInterface' => \Flasher\Prime\Response\ResponseManager::class,
|
||||
'Flasher\Prime\Storage\StorageInterface' => \Flasher\Laravel\Storage\Storage::class,
|
||||
'Flasher\Prime\Storage\StorageManagerInterface' => \Flasher\Prime\Storage\StorageManager::class,
|
||||
'Flasher\Prime\Template\EngineInterface' => \Flasher\Laravel\Template\BladeEngine::class,
|
||||
|
||||
'flasher' => \Flasher\Prime\Flasher::class,
|
||||
'flasher.config' => \Flasher\Laravel\Config\Config::class,
|
||||
'flasher.event_dispatcher' => \Flasher\Prime\EventDispatcher\EventDispatcher::class,
|
||||
'flasher.filter' => \Flasher\Prime\Filter\Filter::class,
|
||||
'flasher.notification_factory' => \Flasher\Prime\Factory\NotificationFactory::class,
|
||||
'flasher.noty' => \Flasher\Noty\Prime\NotyFactory::class,
|
||||
'flasher.notyf' => \Flasher\Notyf\Prime\NotyfFactory::class,
|
||||
'flasher.pnotify' => \Flasher\Pnotify\Prime\PnotifyFactory::class,
|
||||
'flasher.resource_manager' => \Flasher\Prime\Response\Resource\ResourceManager::class,
|
||||
'flasher.response_manager' => \Flasher\Prime\Response\ResponseManager::class,
|
||||
'flasher.storage' => \Flasher\Laravel\Storage\Storage::class,
|
||||
'flasher.storage_manager' => \Flasher\Prime\Storage\StorageManager::class,
|
||||
'flasher.sweet_alert' => \Flasher\SweetAlert\Prime\SweetAlertFactory::class,
|
||||
'flasher.template_engine' => \Flasher\Laravel\Template\BladeEngine::class,
|
||||
'flasher.toastr' => \Flasher\Toastr\Prime\ToastrFactory::class,
|
||||
];
|
||||
|
||||
override(new \Illuminate\Contracts\Container\Container, map($mapping));
|
||||
override(\Illuminate\Container\Container::makeWith(0), map($mapping));
|
||||
override(\Illuminate\Contracts\Container\Container::get(0), map($mapping));
|
||||
override(\Illuminate\Contracts\Container\Container::make(0), map($mapping));
|
||||
override(\Illuminate\Contracts\Container\Container::makeWith(0), map($mapping));
|
||||
override(\App::get(0), map($mapping));
|
||||
override(\App::make(0), map($mapping));
|
||||
override(\App::makeWith(0), map($mapping));
|
||||
override(\app(0), map($mapping));
|
||||
override(\resolve(0), map($mapping));
|
||||
override(\Psr\Container\ContainerInterface::get(0), map($mapping));
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Config;
|
||||
|
||||
use Flasher\Prime\Config\ConfigInterface;
|
||||
use Illuminate\Config\Repository;
|
||||
|
||||
final class Config implements ConfigInterface
|
||||
{
|
||||
private $config;
|
||||
|
||||
private $separator;
|
||||
|
||||
public function __construct(Repository $config, $separator = '.')
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->separator = $separator;
|
||||
}
|
||||
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
return $this->config->get('flasher' . $this->separator . $key, $default);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Facade;
|
||||
|
||||
use Flasher\Prime\Envelope;
|
||||
use Flasher\Prime\Notification\NotificationBuilder;
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
use Flasher\Prime\Stamp\StampInterface;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* @method static NotificationBuilder addSuccess(string $message, array $options = array())
|
||||
* @method static NotificationBuilder addError(string $message, array $options = array())
|
||||
* @method static NotificationBuilder addWarning(string $message, array $options = array())
|
||||
* @method static NotificationBuilder addInfo(string $message, array $options = array())
|
||||
* @method static NotificationBuilder addFlash(string|NotificationInterface $type, string $message = null, array $options = array())
|
||||
* @method static NotificationBuilder flash(StampInterface[] $stamps = array())
|
||||
* @method static NotificationBuilder type(string $type, string $message = null, array $options = array())
|
||||
* @method static NotificationBuilder message(string $message)
|
||||
* @method static NotificationBuilder options(array $options, bool $merge = true)
|
||||
* @method static NotificationBuilder option(string $name, $value)
|
||||
* @method static NotificationBuilder success(string $message = null, array $options = array())
|
||||
* @method static NotificationBuilder error(string $message = null, array $options = array())
|
||||
* @method static NotificationBuilder info(string $message = null, array $options = array())
|
||||
* @method static NotificationBuilder warning(string $message = null, array $options = array())
|
||||
* @method static NotificationBuilder priority(int $priority)
|
||||
* @method static NotificationBuilder hops(int $amount)
|
||||
* @method static NotificationBuilder keep()
|
||||
* @method static NotificationBuilder delay(int $delay)
|
||||
* @method static NotificationBuilder now()
|
||||
* @method static NotificationBuilder with(StampInterface[] $stamps = array())
|
||||
* @method static NotificationBuilder withStamp(StampInterface $stamp)
|
||||
* @method static NotificationBuilder handler(string $handler)
|
||||
* @method static Envelope getEnvelope()
|
||||
*/
|
||||
class Flasher extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'flasher';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel;
|
||||
|
||||
use Flasher\Laravel\ServiceProvider\ServiceProviderManager;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
final class FlasherServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$manager = new ServiceProviderManager($this);
|
||||
$manager->boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$manager = new ServiceProviderManager($this);
|
||||
$manager->register();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return array(
|
||||
'flasher',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Container\Container
|
||||
*/
|
||||
public function getApplication()
|
||||
{
|
||||
return $this->app;
|
||||
}
|
||||
|
||||
public function mergeConfigFrom($path, $key)
|
||||
{
|
||||
parent::mergeConfigFrom($path, $key);
|
||||
}
|
||||
|
||||
public function publishes(array $paths, $groups = null)
|
||||
{
|
||||
parent::publishes($paths, $groups);
|
||||
}
|
||||
|
||||
public function loadTranslationsFrom($path, $namespace)
|
||||
{
|
||||
parent::loadTranslationsFrom($path, $namespace);
|
||||
}
|
||||
|
||||
public function loadViewsFrom($path, $namespace)
|
||||
{
|
||||
parent::loadViewsFrom($path, $namespace);
|
||||
}
|
||||
}
|
||||
Executable
+103
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Flasher\Prime\Config\ConfigInterface;
|
||||
use Flasher\Prime\FlasherInterface;
|
||||
use Flasher\Prime\Response\ResponseManagerInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
final class SessionMiddleware
|
||||
{
|
||||
/**
|
||||
* @var ConfigInterface
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var FlasherInterface
|
||||
*/
|
||||
private $flasher;
|
||||
|
||||
/**
|
||||
* @var ResponseManagerInterface
|
||||
*/
|
||||
private $renderer;
|
||||
|
||||
public function __construct(ConfigInterface $config, FlasherInterface $flasher, ResponseManagerInterface $renderer)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->flasher = $flasher;
|
||||
$this->renderer = $renderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the request filter.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
/** @var Response $response */
|
||||
$response = $next($request);
|
||||
|
||||
if ($request->isXmlHttpRequest() || true !== $this->config->get('auto_create_from_session')) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$readyToRender = false;
|
||||
|
||||
foreach ($this->typesMapping() as $alias => $type) {
|
||||
if (false === $request->session()->has($alias)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->flasher->addFlash($type, $request->session()->get($alias));
|
||||
|
||||
$readyToRender = true;
|
||||
}
|
||||
|
||||
if (false === $readyToRender) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$content = $response->getContent();
|
||||
|
||||
$htmlResponse = $this->renderer->render(array(), array(
|
||||
'format' => 'html',
|
||||
'content' => $content,
|
||||
));
|
||||
|
||||
if (empty($htmlResponse)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$pos = strripos($content, '</body>');
|
||||
$content = substr($content, 0, $pos) . $htmlResponse . substr($content, $pos);
|
||||
$response->setContent($content);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function typesMapping()
|
||||
{
|
||||
$mapping = array();
|
||||
|
||||
foreach ($this->config->get('types_mapping', array()) as $type => $aliases) {
|
||||
if (is_int($type) && is_string($aliases)) {
|
||||
$type = $aliases;
|
||||
}
|
||||
|
||||
foreach ((array) $aliases as $alias) {
|
||||
$mapping[$alias] = $type;
|
||||
}
|
||||
}
|
||||
|
||||
return $mapping;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Observer;
|
||||
|
||||
use Flasher\Prime\Config\ConfigInterface;
|
||||
use Flasher\Prime\FlasherInterface;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
final class FlasherModelObserver
|
||||
{
|
||||
/**
|
||||
* @var ConfigInterface
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var FlasherInterface
|
||||
*/
|
||||
private $flasher;
|
||||
|
||||
/**
|
||||
* @var Translator
|
||||
*/
|
||||
private $translator;
|
||||
|
||||
public function __construct(ConfigInterface $config, FlasherInterface $flasher, Translator $translator)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->flasher = $flasher;
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Model "created" event.
|
||||
*/
|
||||
public function created(Model $model)
|
||||
{
|
||||
$this->addFlash(__FUNCTION__, $model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Model "updated" event.
|
||||
*/
|
||||
public function updated(Model $model)
|
||||
{
|
||||
$this->addFlash(__FUNCTION__, $model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Model "deleted" event.
|
||||
*/
|
||||
public function deleted(Model $model)
|
||||
{
|
||||
$this->addFlash(__FUNCTION__, $model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Model "restored" event.
|
||||
*/
|
||||
public function restored(Model $model)
|
||||
{
|
||||
$this->addFlash(__FUNCTION__, $model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Model "force deleted" event.
|
||||
*/
|
||||
public function forceDeleted(Model $model)
|
||||
{
|
||||
$this->addFlash(__FUNCTION__, $model);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
*/
|
||||
private function addFlash($method, Model $model)
|
||||
{
|
||||
$exludes = $this->config->get('observer_events.exclude', array());
|
||||
if (in_array($method, $exludes, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($exludes[$method]) && in_array(get_class($model), $exludes[$method], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->translator->has(sprintf('flasher::messages.flashable.%s.%s', get_class($model), $method))) {
|
||||
$message = $this->translator->get(sprintf('flasher::messages.flashable.%s.%s', get_class($model), $method));
|
||||
} else {
|
||||
$message = $this->translator->get(sprintf('flasher::messages.flashable.default.%s', $method));
|
||||
$message = str_replace('{{ model }}', substr(strrchr(get_class($model), '\\'), 1), $message);
|
||||
}
|
||||
|
||||
$this->flasher->addSuccess($message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<p align="center"><img width="600" alt="flasher" src="https://user-images.githubusercontent.com/10859693/102468596-03317180-4052-11eb-9df3-44dc6235b238.png"></p>
|
||||
|
||||
<h1 align="center">A powerful and flexible flash notifications system for PHP, Laravel, Symfony</h1>
|
||||
|
||||
<p align="center">
|
||||
:eyes: PHP Flasher helps you to add flash notifications to your PHP projects.
|
||||
This library was developed with the idea that you should be able to add flash notification to your application with ease and with few lines of code.
|
||||
No application-wide rewrites and no big investments upfront.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/badge/source-php--flasher/flasher-blue.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/releases">
|
||||
<img src="https://img.shields.io/github/tag/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/backer/badge.svg?label=backer&color=brightgreen" />
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Why use PHP Flasher ?
|
||||
|
||||
The PHP Flasher project supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__, and __notyf__
|
||||
and its highly extendable so you can add your custom notifications.
|
||||
|
||||
This library is designed, so you can take full control when creating you notifications :
|
||||
|
||||
> * Display multiple notifications
|
||||
> * Sort and filter notifications
|
||||
> * Render notification from JSON object
|
||||
> * Limit the number of displayed notifications
|
||||
> * Show notifications from different libraries at the same time
|
||||
> * Framework angostic with integration for : Symfony and Laravel
|
||||
> * Support templates
|
||||
> * Easy migration from similar libraries.
|
||||
> * Very flexible so you can add you own adapters
|
||||
> * ...and more
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHP Flasher can be found on the [PHP Flasher website](https://php-flasher.github.io/).
|
||||
|
||||
## Backers && Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your name will show up in the Contribute page of all PHP Flasher installations as well as here with a link to your website!
|
||||
|
||||
Thank you to all our backers and sponsors! 🙏
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#backers" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/backers.svg?width=890" title="Backers" alt="Backers">
|
||||
</a>
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#sponsors" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/sponsors.svg?width=890" title="Sponsors" alt="Sponsors">
|
||||
</a>
|
||||
|
||||
### Contact
|
||||
|
||||
PHP Flasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. You can reach out with questions, bug reports, or feature requests
|
||||
on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHP Flasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> <b> </p>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'default' => 'template',
|
||||
|
||||
'root_scripts' => array(
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.6/dist/flasher.min.js',
|
||||
),
|
||||
|
||||
'template_factory' => array(
|
||||
'default' => 'tailwindcss',
|
||||
'templates' => array(
|
||||
'tailwindcss' => array(
|
||||
'view' => 'flasher::tailwindcss',
|
||||
'styles' => array(
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.7/base.min.css',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.7/utilities.css',
|
||||
),
|
||||
),
|
||||
'tailwindcss_bg' => array(
|
||||
'view' => 'flasher::tailwindcss_bg',
|
||||
'styles' => array(
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.7/base.min.css',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.7/utilities.css',
|
||||
),
|
||||
),
|
||||
'bootstrap' => array(
|
||||
'view' => 'flasher::bootstrap',
|
||||
'styles' => array(
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'auto_create_from_session' => true,
|
||||
|
||||
'types_mapping' => array(
|
||||
'success' => array('success'),
|
||||
'error' => array('error', 'danger'),
|
||||
'warning' => array('warning', 'alarm'),
|
||||
'info' => array('info', 'notice', 'alert'),
|
||||
),
|
||||
|
||||
'observer_events' => array(
|
||||
'exclude' => array(
|
||||
'forceDeleted',
|
||||
'restored',
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'flashable' => array(
|
||||
'default' => array(
|
||||
'created' => '{{ model }} has been created.',
|
||||
'updated' => '{{ model }} has been updated.',
|
||||
'deleted' => '{{ model }} has been deleted.',
|
||||
'restored' => '{{ model }} has been restored.',
|
||||
'forceDeleted' => '{{ model }} has been deleted.',
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
switch ($envelope->getType()) {
|
||||
case 'success':
|
||||
$title = 'Success';
|
||||
$alertClass = 'alert-success';
|
||||
$progressBackgroundColor = '#155724';
|
||||
break;
|
||||
case 'error':
|
||||
$title = 'Error';
|
||||
$alertClass = 'alert-danger';
|
||||
$progressBackgroundColor = '#721c24';
|
||||
break;
|
||||
case 'warning':
|
||||
$title = 'Warning';
|
||||
$alertClass = 'alert-warning';
|
||||
$progressBackgroundColor = '#856404';
|
||||
break;
|
||||
case 'info':
|
||||
default:
|
||||
$title = 'Info';
|
||||
$alertClass = 'alert-info';
|
||||
$progressBackgroundColor = '#0c5460';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<div style="margin-top: 0.5rem;cursor: pointer;">
|
||||
<div class="alert {{ $alertClass }} alert-dismissible fade in show" role="alert" style="border-top-left-radius: 0;border-bottom-left-radius: 0;border: unset;border-left: 6px solid {{ $progressBackgroundColor }}">
|
||||
<strong>{{ $title }} !</strong>
|
||||
{{ $envelope->getMessage() }}
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="this.parentElement.remove()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex" style="height: .125rem;margin-top: -1rem;">
|
||||
<span class="flasher-progress" style="background-color: {{ $progressBackgroundColor }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
switch ($envelope->getType()) {
|
||||
case 'success':
|
||||
$title = 'Success';
|
||||
$textColor = 'text-green-600';
|
||||
$backgroundColor = 'bg-green-600';
|
||||
$progressBackgroundColor = 'bg-green-100';
|
||||
$borderColor = 'border-green-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="check w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>';
|
||||
break;
|
||||
case 'error':
|
||||
$title = 'Error';
|
||||
$textColor = 'text-red-600';
|
||||
$backgroundColor = 'bg-red-600';
|
||||
$progressBackgroundColor = 'bg-red-100';
|
||||
$borderColor = 'border-red-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="x w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>';
|
||||
break;
|
||||
case 'warning':
|
||||
$title = 'Warning';
|
||||
$textColor = 'text-yellow-600';
|
||||
$backgroundColor = 'bg-yellow-600';
|
||||
$progressBackgroundColor = 'bg-yellow-100';
|
||||
$borderColor = 'border-yellow-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="exclamation w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/></svg>';
|
||||
break;
|
||||
case 'info':
|
||||
default:
|
||||
$title = 'Info';
|
||||
$textColor = 'text-blue-600';
|
||||
$backgroundColor = 'bg-blue-600';
|
||||
$progressBackgroundColor = 'bg-blue-100';
|
||||
$borderColor = 'border-blue-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="exclamation-circle w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="bg-white shadow-lg border-l-4 mt-2 cursor-pointer {{ $borderColor }}">
|
||||
<div class="flex items-center px-2 py-3 rounded-lg shadow-lg overflow-hidden">
|
||||
<div class="inline-flex items-center {{ $backgroundColor }} p-2 text-white text-sm rounded-full flex-shrink-0">
|
||||
{!! $icon !!}
|
||||
</div>
|
||||
<div class="ml-4 w-0 flex-1">
|
||||
<p class="text-base leading-5 font-medium capitalize {{ $textColor }}">
|
||||
{{ $title }}
|
||||
</p>
|
||||
<p class="mt-1 text-sm leading-5 text-gray-500">
|
||||
{{ $envelope->getMessage() }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-0.5 flex {{ $progressBackgroundColor }}">
|
||||
<span class="flasher-progress {{ $backgroundColor }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
switch ($envelope->getType()) {
|
||||
case 'success':
|
||||
$title = 'Success';
|
||||
$textColor = 'text-green-700';
|
||||
$backgroundColor = 'bg-green-50';
|
||||
$progressBackgroundColor = 'bg-green-200';
|
||||
$borderColor = 'border-green-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="check w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>';
|
||||
break;
|
||||
case 'error':
|
||||
$title = 'Error';
|
||||
$textColor = 'text-red-700';
|
||||
$backgroundColor = 'bg-red-50';
|
||||
$progressBackgroundColor = 'bg-red-200';
|
||||
$borderColor = 'border-red-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="x w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>';
|
||||
break;
|
||||
case 'warning':
|
||||
$title = 'Warning';
|
||||
$textColor = 'text-yellow-700';
|
||||
$backgroundColor = 'bg-yellow-50';
|
||||
$progressBackgroundColor = 'bg-yellow-200';
|
||||
$borderColor = 'border-yellow-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="exclamation w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/></svg>';
|
||||
break;
|
||||
case 'info':
|
||||
default:
|
||||
$title = 'Info';
|
||||
$textColor = 'text-blue-700';
|
||||
$backgroundColor = 'bg-blue-50';
|
||||
$progressBackgroundColor = 'bg-blue-100';
|
||||
$borderColor = 'border-blue-600';
|
||||
$icon = '<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="exclamation-circle w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="bg-white shadow-lg border-l-4 mt-2 cursor-pointer {{ $backgroundColor }} {{ $borderColor }}">
|
||||
<div class="flex items-center px-2 py-3 rounded-lg shadow-lg overflow-hidden">
|
||||
<div class="inline-flex items-center p-2 text-white text-sm rounded-full flex-shrink-0 border-2 {{ $borderColor }} {{ $textColor }}">
|
||||
{!! $icon !!}
|
||||
</div>
|
||||
<div class="ml-4 w-0 flex-1">
|
||||
<p class="text-base leading-5 font-medium capitalize {{ $textColor }}">
|
||||
{{ $title }}
|
||||
</p>
|
||||
<p class="mt-1 text-sm leading-5 text-gray-500">
|
||||
{{ $envelope->getMessage() }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-0.5 flex {{ $backgroundColor }}">
|
||||
<span class="flasher-progress {{ $progressBackgroundColor }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Laravel\Config\Config;
|
||||
use Flasher\Laravel\FlasherServiceProvider;
|
||||
use Flasher\Laravel\Storage\Storage;
|
||||
use Flasher\Laravel\Template\BladeEngine;
|
||||
use Flasher\Prime\EventDispatcher\EventDispatcher;
|
||||
use Flasher\Prime\EventDispatcher\EventListener\FilterListener;
|
||||
use Flasher\Prime\EventDispatcher\EventListener\RemoveListener;
|
||||
use Flasher\Prime\EventDispatcher\EventListener\StampsListener;
|
||||
use Flasher\Prime\Factory\NotificationFactory;
|
||||
use Flasher\Prime\Filter\Filter;
|
||||
use Flasher\Prime\Flasher;
|
||||
use Flasher\Prime\Response\Presenter\ArrayPresenter;
|
||||
use Flasher\Prime\Response\Presenter\HtmlPresenter;
|
||||
use Flasher\Prime\Response\Resource\ResourceManager;
|
||||
use Flasher\Prime\Response\ResponseManager;
|
||||
use Flasher\Prime\Storage\StorageManager;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
|
||||
class Laravel implements ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* @var Container
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
public function __construct(Container $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
public function shouldBeUsed()
|
||||
{
|
||||
return $this->app instanceof Application;
|
||||
}
|
||||
|
||||
public function boot(FlasherServiceProvider $provider)
|
||||
{
|
||||
$provider->loadTranslationsFrom(flasher_path(__DIR__ . '/../../Resources/lang'), 'flasher');
|
||||
$provider->loadViewsFrom(flasher_path(__DIR__ . '/../../Resources/views'), 'flasher');
|
||||
|
||||
$provider->publishes(array(
|
||||
flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher.php'),
|
||||
), 'flasher-config');
|
||||
$provider->publishes(array(
|
||||
flasher_path(__DIR__ . '/../../Resources/lang') => resource_path(flasher_path('lang/vendor/flasher')),
|
||||
), 'flasher-lang');
|
||||
$provider->publishes(array(
|
||||
flasher_path(__DIR__ . '/../../Resources/views') => resource_path(flasher_path('views/vendor/flasher')),
|
||||
), 'flasher-views');
|
||||
|
||||
$this->registerBladeDirectives();
|
||||
}
|
||||
|
||||
public function register(FlasherServiceProvider $provider)
|
||||
{
|
||||
$provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher');
|
||||
|
||||
$this->app->singleton('flasher.config', function (Application $app) {
|
||||
return new Config($app['config'], '.');
|
||||
});
|
||||
|
||||
$this->registerCommonServices();
|
||||
}
|
||||
|
||||
protected function registerCommonServices()
|
||||
{
|
||||
$this->app->singleton('flasher', function (Application $app) {
|
||||
$flasher = new Flasher($app['flasher.config']);
|
||||
$flasher->addFactory('template', $app['flasher.template']);
|
||||
|
||||
return $flasher;
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.resource_manager', function (Application $app) {
|
||||
$resourceManager = new ResourceManager($app['flasher.config'], $app['flasher.template_engine']);
|
||||
|
||||
$templates = $app['flasher.config']->get('template_factory.templates', array());
|
||||
foreach ($templates as $template => $factory) {
|
||||
if (isset($factory['scripts'])) {
|
||||
$resourceManager->addScripts('template_' . $template, $factory['scripts']);
|
||||
}
|
||||
if (isset($factory['styles'])) {
|
||||
$resourceManager->addStyles('template_' . $template, $factory['styles']);
|
||||
}
|
||||
if (isset($factory['options'])) {
|
||||
$resourceManager->addOptions('template_' . $template, $factory['options']);
|
||||
}
|
||||
}
|
||||
|
||||
return $resourceManager;
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.response_manager', function (Application $app) {
|
||||
$responseManager = new ResponseManager(
|
||||
$app['flasher.storage_manager'],
|
||||
$app['flasher.event_dispatcher'],
|
||||
$app['flasher.resource_manager']
|
||||
);
|
||||
|
||||
$responseManager->addPresenter('html', new HtmlPresenter());
|
||||
$responseManager->addPresenter('array', new ArrayPresenter());
|
||||
|
||||
return $responseManager;
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.storage', function (Application $app) {
|
||||
return new Storage($app['session']);
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.storage_manager', function (Application $app) {
|
||||
return new StorageManager($app['flasher.storage'], $app['flasher.event_dispatcher']);
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.filter', function (Application $app) {
|
||||
return new Filter();
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.template_engine', function (Application $app) {
|
||||
return new BladeEngine($app['view']);
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.event_dispatcher', function (Application $app) {
|
||||
$eventDispatcher = new EventDispatcher();
|
||||
|
||||
$eventDispatcher->addSubscriber(new FilterListener($app['flasher.filter']));
|
||||
$eventDispatcher->addSubscriber(new RemoveListener());
|
||||
$eventDispatcher->addSubscriber(new StampsListener());
|
||||
|
||||
return $eventDispatcher;
|
||||
});
|
||||
|
||||
$this->app->singleton('flasher.notification_factory', function (Application $app) {
|
||||
return new NotificationFactory($app['flasher.storage_manager']);
|
||||
});
|
||||
|
||||
$this->app->alias('flasher.config', 'Flasher\Laravel\Config\Config');
|
||||
$this->app->alias('flasher', 'Flasher\Prime\Flasher');
|
||||
$this->app->alias('flasher.response_manager', 'Flasher\Prime\Response\ResponseManager');
|
||||
$this->app->alias('flasher.event_dispatcher', 'Flasher\Prime\EventDispatcher\EventDispatcher');
|
||||
$this->app->alias('flasher.storage', 'Flasher\Laravel\Storage\Storage');
|
||||
$this->app->alias('flasher.storage_manager', 'Flasher\Laravel\Storage\StorageManager');
|
||||
$this->app->alias('flasher.filter', 'Flasher\Prime\Filter\Filter');
|
||||
$this->app->alias('flasher.template_engine', 'Flasher\Laravel\Template\BladeEngine');
|
||||
$this->app->alias('flasher.notification_factory', 'Flasher\Prime\Factory\NotificationFactory');
|
||||
$this->app->alias('Flasher\Prime\Factory\NotificationFactory', 'flasher.template');
|
||||
|
||||
$this->app->bind('Flasher\Prime\Config\ConfigInterface', 'flasher.config');
|
||||
$this->app->bind('Flasher\Prime\FlasherInterface', 'flasher');
|
||||
$this->app->bind('Flasher\Prime\Storage\StorageManagerInterface', 'flasher.storage_manager');
|
||||
$this->app->bind('Flasher\Prime\Response\ResponseManagerInterface', 'flasher.response_manager');
|
||||
$this->app->bind('Flasher\Prime\Filter\FilterInterface', 'flasher.filter');
|
||||
$this->app->bind('Flasher\Prime\EventDispatcher\EventDispatcherInterface', 'flasher.event_dispatcher');
|
||||
$this->app->bind('Flasher\Prime\Storage\StorageInterface', 'flasher.storage');
|
||||
$this->app->bind('Flasher\Prime\Template\EngineInterface', 'flasher.template_engine');
|
||||
$this->app->bind('Flasher\Prime\Factory\NotificationFactoryInterface', 'flasher.notification_factory');
|
||||
}
|
||||
|
||||
protected function registerBladeDirectives()
|
||||
{
|
||||
$startsWith = function ($haystack, $needle) {
|
||||
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
|
||||
};
|
||||
|
||||
$endsWith = function ($haystack, $needle) {
|
||||
return substr_compare($haystack, $needle, -strlen($needle)) === 0;
|
||||
};
|
||||
|
||||
Blade::directive('flasher_render', function ($criteria = array()) use ($startsWith, $endsWith) {
|
||||
if (!empty($criteria) && $startsWith($criteria, '(') && $endsWith($criteria, ')')) {
|
||||
$criteria = substr($criteria, 1, -1);
|
||||
}
|
||||
|
||||
return "<?php echo app('flasher.response_manager')->render(${criteria}); ?>";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Laravel\Config\Config;
|
||||
use Flasher\Laravel\FlasherServiceProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\View\Compilers\BladeCompiler;
|
||||
|
||||
final class Laravel4 extends Laravel
|
||||
{
|
||||
public function shouldBeUsed()
|
||||
{
|
||||
return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.');
|
||||
}
|
||||
|
||||
public function boot(FlasherServiceProvider $provider)
|
||||
{
|
||||
$provider->package('php-flasher/flasher-laravel', 'flasher', flasher_path(__DIR__ . '/../../Resources'));
|
||||
|
||||
$this->registerBladeDirectives();
|
||||
}
|
||||
|
||||
public function register(FlasherServiceProvider $provider)
|
||||
{
|
||||
$this->app->singleton('flasher.config', function (Application $app) {
|
||||
return new Config($app['config'], '::');
|
||||
});
|
||||
|
||||
$this->registerCommonServices();
|
||||
}
|
||||
|
||||
protected function registerBladeDirectives()
|
||||
{
|
||||
Blade::extend(function ($view, BladeCompiler $compiler) {
|
||||
$pattern = $compiler->createMatcher('flasher_render');
|
||||
|
||||
return preg_replace($pattern, '$1<?php echo app(\'flasher.response_manager\')->render$2; ?>', $view);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Laravel\FlasherServiceProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\View\Compilers\BladeCompiler;
|
||||
|
||||
final class Laravel50 extends Laravel
|
||||
{
|
||||
public function shouldBeUsed()
|
||||
{
|
||||
return $this->app instanceof Application && 0 === strpos(Application::VERSION, '5.0');
|
||||
}
|
||||
|
||||
public function boot(FlasherServiceProvider $provider)
|
||||
{
|
||||
$provider->publishes(array(
|
||||
flasher_path(__DIR__ . '/../../Resources/lang') => base_path(flasher_path('resources/lang/vendor/flasher')),
|
||||
));
|
||||
|
||||
$this->registerBladeDirectives();
|
||||
}
|
||||
|
||||
protected function registerBladeDirectives()
|
||||
{
|
||||
$startsWith = function ($haystack, $needle) {
|
||||
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
|
||||
};
|
||||
|
||||
$endsWith = function ($haystack, $needle) {
|
||||
return substr_compare($haystack, $needle, -strlen($needle)) === 0;
|
||||
};
|
||||
|
||||
Blade::extend(function ($view, BladeCompiler $compiler) use ($startsWith, $endsWith) {
|
||||
$pattern = $compiler->createPlainMatcher('flasher_render(.*)');
|
||||
$matches = array();
|
||||
|
||||
preg_match($pattern, $view, $matches);
|
||||
|
||||
$value = $matches[2];
|
||||
|
||||
if (!empty($value) && $startsWith($value, '(') && $endsWith($value, ')')) {
|
||||
$value = substr($value, 1, -1);
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
'%criteria%',
|
||||
$value,
|
||||
$matches[1] . "<?php echo app('flasher.response_manager')->render(%criteria%); ?>"
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Laravel\FlasherServiceProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
|
||||
final class Laravel51 extends Laravel
|
||||
{
|
||||
public function shouldBeUsed()
|
||||
{
|
||||
return $this->app instanceof Application && 0 === strpos(Application::VERSION, '5.1');
|
||||
}
|
||||
|
||||
public function boot(FlasherServiceProvider $provider)
|
||||
{
|
||||
$provider->publishes(array(
|
||||
flasher_path(__DIR__ . '/../../Resources/lang') => base_path(flasher_path('resources/lang/vendor/flasher')),
|
||||
));
|
||||
|
||||
$this->registerBladeDirectives();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Laravel\FlasherServiceProvider;
|
||||
|
||||
interface ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldBeUsed();
|
||||
|
||||
public function boot(FlasherServiceProvider $provider);
|
||||
|
||||
public function register(FlasherServiceProvider $provider);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider;
|
||||
|
||||
use Flasher\Prime\Response\Resource\ResourceManager;
|
||||
|
||||
final class ResourceManagerHelper
|
||||
{
|
||||
/**
|
||||
* @param string $alias
|
||||
* @param array $config
|
||||
*/
|
||||
public static function process(ResourceManager $responseManager, $alias, $config = null)
|
||||
{
|
||||
if (null === $config) {
|
||||
$config = $responseManager->getConfig()->get('adapters.' . $alias);
|
||||
}
|
||||
|
||||
$responseManager->addScripts($alias, self::getScripts($config));
|
||||
$responseManager->addStyles($alias, self::getStyles($config));
|
||||
$responseManager->addOptions($alias, self::getOptions($config));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $config
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getScripts($config)
|
||||
{
|
||||
return isset($config['scripts']) ? $config['scripts'] : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $config
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getStyles($config)
|
||||
{
|
||||
return isset($config['styles']) ? $config['styles'] : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $config
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getOptions($config)
|
||||
{
|
||||
return isset($config['options']) ? $config['options'] : array();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\ServiceProvider;
|
||||
|
||||
use Flasher\Laravel\FlasherServiceProvider;
|
||||
use Flasher\Laravel\ServiceProvider\Providers\ServiceProviderInterface;
|
||||
|
||||
final class ServiceProviderManager
|
||||
{
|
||||
private $provider;
|
||||
|
||||
/**
|
||||
* @var ServiceProviderInterface[]
|
||||
*/
|
||||
private $providers = array(
|
||||
'Flasher\Laravel\ServiceProvider\Providers\Laravel4',
|
||||
'Flasher\Laravel\ServiceProvider\Providers\Laravel50',
|
||||
'Flasher\Laravel\ServiceProvider\Providers\Laravel51',
|
||||
'Flasher\Laravel\ServiceProvider\Providers\Laravel',
|
||||
);
|
||||
|
||||
private $notifyServiceProvider;
|
||||
|
||||
public function __construct(FlasherServiceProvider $notifyServiceProvider)
|
||||
{
|
||||
$this->notifyServiceProvider = $notifyServiceProvider;
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
$provider = $this->resolveServiceProvider();
|
||||
$provider->boot($this->notifyServiceProvider);
|
||||
}
|
||||
|
||||
public function register()
|
||||
{
|
||||
$provider = $this->resolveServiceProvider();
|
||||
$provider->register($this->notifyServiceProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ServiceProviderInterface
|
||||
*/
|
||||
private function resolveServiceProvider()
|
||||
{
|
||||
if ($this->provider instanceof ServiceProviderInterface) {
|
||||
return $this->provider;
|
||||
}
|
||||
|
||||
foreach ($this->providers as $providerClass) {
|
||||
$provider = new $providerClass($this->notifyServiceProvider->getApplication());
|
||||
|
||||
if ($provider->shouldBeUsed()) {
|
||||
return $this->provider = $provider;
|
||||
}
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Service Provider not found.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Storage;
|
||||
|
||||
use Flasher\Prime\Envelope;
|
||||
use Flasher\Prime\Stamp\UuidStamp;
|
||||
use Flasher\Prime\Storage\StorageInterface;
|
||||
use Illuminate\Session\SessionManager;
|
||||
use Illuminate\Session\Store;
|
||||
|
||||
final class Storage implements StorageInterface
|
||||
{
|
||||
const ENVELOPES_NAMESPACE = 'flasher::envelopes';
|
||||
|
||||
/**
|
||||
* @var SessionManager|Store
|
||||
*/
|
||||
private $session;
|
||||
|
||||
/**
|
||||
* @param SessionManager|Store $session
|
||||
*/
|
||||
public function __construct($session)
|
||||
{
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
public function all()
|
||||
{
|
||||
return $this->session->get(self::ENVELOPES_NAMESPACE, array());
|
||||
}
|
||||
|
||||
public function add($envelopes)
|
||||
{
|
||||
$envelopes = is_array($envelopes) ? $envelopes : func_get_args();
|
||||
|
||||
$this->session->put(self::ENVELOPES_NAMESPACE, array_merge($this->all(), $envelopes));
|
||||
}
|
||||
|
||||
public function update($envelopes)
|
||||
{
|
||||
$envelopes = is_array($envelopes) ? $envelopes : func_get_args();
|
||||
$map = UuidStamp::indexByUuid($envelopes);
|
||||
|
||||
$store = $this->all();
|
||||
foreach ($store as $index => $envelope) {
|
||||
$uuid = $envelope->get('Flasher\Prime\Stamp\UuidStamp')->getUuid();
|
||||
|
||||
if (!isset($map[$uuid])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$store[$index] = $map[$uuid];
|
||||
}
|
||||
|
||||
$this->session->put(self::ENVELOPES_NAMESPACE, $store);
|
||||
}
|
||||
|
||||
public function remove($envelopes)
|
||||
{
|
||||
$envelopes = is_array($envelopes) ? $envelopes : func_get_args();
|
||||
|
||||
$map = UuidStamp::indexByUuid($envelopes);
|
||||
|
||||
$store = array_filter($this->all(), function (Envelope $envelope) use ($map) {
|
||||
$uuid = $envelope->get('Flasher\Prime\Stamp\UuidStamp')->getUuid();
|
||||
|
||||
return !isset($map[$uuid]);
|
||||
});
|
||||
|
||||
$this->session->put(self::ENVELOPES_NAMESPACE, $store);
|
||||
}
|
||||
|
||||
public function clear()
|
||||
{
|
||||
$this->session->put(self::ENVELOPES_NAMESPACE, array());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Template;
|
||||
|
||||
use Flasher\Prime\Template\EngineInterface;
|
||||
|
||||
final class BladeEngine implements EngineInterface
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private $engine;
|
||||
|
||||
/**
|
||||
* @param $engine
|
||||
*/
|
||||
public function __construct($engine)
|
||||
{
|
||||
$this->engine = $engine;
|
||||
}
|
||||
|
||||
public function render($name, array $context = array())
|
||||
{
|
||||
return (string) $this->engine->make($name, $context);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Tests\Config;
|
||||
|
||||
use Flasher\Laravel\Config\Config;
|
||||
use Flasher\Laravel\Tests\TestCase;
|
||||
use Illuminate\Foundation\Application;
|
||||
|
||||
final class ConfigTest extends TestCase
|
||||
{
|
||||
public function testSimpleConfig()
|
||||
{
|
||||
$separator = $this->isLaravel4() ? '::' : '.';
|
||||
$config = new Config($this->app->make('config'), $separator);
|
||||
|
||||
$this->assertEquals('template', $config->get('default'));
|
||||
}
|
||||
|
||||
private function isLaravel4()
|
||||
{
|
||||
return 0 === strpos(Application::VERSION, '4.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Tests;
|
||||
|
||||
use Illuminate\View\Compilers\BladeCompiler;
|
||||
|
||||
final class FlasherServiceProviderTest extends TestCase
|
||||
{
|
||||
public function testNotifyServiceExists()
|
||||
{
|
||||
$this->assertInstanceOf('Flasher\Laravel\Config\Config', $this->app->make('flasher.config'));
|
||||
$this->assertInstanceOf('Flasher\Prime\Flasher', $this->app->make('flasher'));
|
||||
$this->assertInstanceOf('Flasher\Prime\Response\ResponseManager', $this->app->make('flasher.response_manager'));
|
||||
$this->assertInstanceOf(
|
||||
'Flasher\Prime\Response\Resource\ResourceManager',
|
||||
$this->app->make('flasher.resource_manager')
|
||||
);
|
||||
$this->assertInstanceOf('Flasher\Laravel\Storage\Storage', $this->app->make('flasher.storage'));
|
||||
$this->assertInstanceOf('Flasher\Prime\Storage\StorageManager', $this->app->make('flasher.storage_manager'));
|
||||
$this->assertInstanceOf(
|
||||
'Flasher\Prime\EventDispatcher\EventDispatcher',
|
||||
$this->app->make('flasher.event_dispatcher')
|
||||
);
|
||||
$this->assertInstanceOf('Flasher\Prime\Filter\Filter', $this->app->make('flasher.filter'));
|
||||
}
|
||||
|
||||
public function testBladeDirective()
|
||||
{
|
||||
/** @var BladeCompiler $blade */
|
||||
$blade = $this->app->make('view')->getEngineResolver()->resolve('blade')->getCompiler();
|
||||
|
||||
$this->assertEquals(
|
||||
"<?php echo app('flasher.response_manager')->render(); ?>",
|
||||
$blade->compileString('@flasher_render()')
|
||||
);
|
||||
$this->assertEquals(
|
||||
"<?php echo app('flasher.response_manager')->render(array()); ?>",
|
||||
$blade->compileString('@flasher_render(array())')
|
||||
);
|
||||
$this->assertEquals(
|
||||
"<?php echo app('flasher.response_manager')->render(array(\"priority\" => array(\"min\" => 4, \"max\" => 5))); ?>",
|
||||
$blade->compileString('@flasher_render(array("priority" => array("min" => 4, "max" => 5)))')
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Tests\Storage;
|
||||
|
||||
use Flasher\Laravel\Storage\Storage;
|
||||
use Flasher\Laravel\Tests\TestCase;
|
||||
use Flasher\Prime\Envelope;
|
||||
use Flasher\Prime\Notification\Notification;
|
||||
use Flasher\Prime\Stamp\PriorityStamp;
|
||||
use Flasher\Prime\Stamp\UuidStamp;
|
||||
|
||||
final class StorageTest extends TestCase
|
||||
{
|
||||
public function testInitialState()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$this->assertEquals(array(), $storage->all());
|
||||
}
|
||||
|
||||
public function testAddEnvelope()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$envelope = new Envelope(new Notification());
|
||||
$storage->add($envelope);
|
||||
|
||||
$this->assertEquals(array($envelope), $storage->all());
|
||||
}
|
||||
|
||||
public function testAddMultipleEnvelopes()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$envelopes = array(
|
||||
new Envelope(new Notification()),
|
||||
new Envelope(new Notification()),
|
||||
);
|
||||
|
||||
$storage->add($envelopes);
|
||||
$this->assertEquals($envelopes, $storage->all());
|
||||
}
|
||||
|
||||
public function testUpdateEnvelopes()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$envelopes = array(
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
);
|
||||
|
||||
$storage->add($envelopes);
|
||||
$this->assertEquals($envelopes, $storage->all());
|
||||
|
||||
$envelopes[1]->withStamp(new PriorityStamp(1));
|
||||
$storage->update($envelopes[1]);
|
||||
|
||||
$this->assertEquals($envelopes, $storage->all());
|
||||
$this->assertInstanceOf(
|
||||
'Flasher\Prime\Stamp\PriorityStamp',
|
||||
$envelopes[1]->get('Flasher\Prime\Stamp\PriorityStamp')
|
||||
);
|
||||
}
|
||||
|
||||
public function testRemoveEnvelopes()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$envelopes = array(
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
);
|
||||
|
||||
$storage->add($envelopes);
|
||||
$this->assertEquals($envelopes, $storage->all());
|
||||
|
||||
$storage->remove($envelopes[1]);
|
||||
$this->assertEquals(array($envelopes[0]), $storage->all());
|
||||
}
|
||||
|
||||
public function testRemoveMultipleEnvelopes()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$envelopes = array(
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
);
|
||||
|
||||
$storage->add($envelopes);
|
||||
$this->assertEquals($envelopes, $storage->all());
|
||||
|
||||
$storage->remove($envelopes);
|
||||
$this->assertEquals(array(), $storage->all());
|
||||
}
|
||||
|
||||
public function testClearAllEnvelopes()
|
||||
{
|
||||
$storage = new Storage($this->app->make('session'));
|
||||
$envelopes = array(
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
new Envelope(new Notification(), array(
|
||||
new UuidStamp(),
|
||||
)),
|
||||
);
|
||||
|
||||
$storage->add($envelopes);
|
||||
$this->assertEquals($envelopes, $storage->all());
|
||||
|
||||
$storage->clear();
|
||||
$this->assertEquals(array(), $storage->all());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Laravel\Tests;
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Orchestra\Testbench\TestCase as Orchestra;
|
||||
|
||||
class TestCase extends Orchestra
|
||||
{
|
||||
/**
|
||||
* @param $app
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getPackageProviders($app = null)
|
||||
{
|
||||
return array(
|
||||
'Flasher\Laravel\FlasherServiceProvider',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Application $app
|
||||
*/
|
||||
protected function getEnvironmentSetUp($app)
|
||||
{
|
||||
$app['config']->set('session.driver', 'array');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-laravel",
|
||||
"description": "Laravel package integrating PHP Flasher into Laravel applications",
|
||||
"keywords": [
|
||||
"yoeunes",
|
||||
"notify",
|
||||
"flasher",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"Lumen",
|
||||
"notifications",
|
||||
"messages",
|
||||
"alerts",
|
||||
"pnotify",
|
||||
"toastr ",
|
||||
"bundle",
|
||||
"flex"
|
||||
],
|
||||
"homepage": "https://php-flasher.github.io/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes Khoubza",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://github.com/yoeunes",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"illuminate/support": "^4.0|^5.0|^6.0|^7.0|^8.0",
|
||||
"php-flasher/flasher": "^0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0",
|
||||
"orchestra/testbench": "^2.0|^3.0|^4.0|^5.0|^6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Laravel\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
],
|
||||
"files": [
|
||||
"helpers.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Laravel\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Flasher\\Laravel\\FlasherServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Noty": "Flasher\\Noty\\Laravel\\Facade\\Noty"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if (!function_exists('flasher')) {
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $type
|
||||
* @param string $title
|
||||
*
|
||||
* @return \Flasher\Prime\Flasher
|
||||
*/
|
||||
function flasher($message = null, $type = 'success', $title = '', array $options = array(), array $stamps = array())
|
||||
{
|
||||
if (null === $message && 0 === func_num_args()) {
|
||||
return app('flasher.factory');
|
||||
}
|
||||
|
||||
return app('flasher.factory')->render($type, $message, $title, $options, $stamps);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="Flasher Test Suite">
|
||||
<directory>Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
# Path-based git attributes
|
||||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
|
||||
# Ignore all test and documentation with "export-ignore".
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/.styleci.yml export-ignore
|
||||
/tests export-ignore
|
||||
/.editorconfig export-ignore
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: ['https://www.paypal.com/paypalme/yoeunes']
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
name: Running tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
laravel: [8.*, 7.*, 6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*, 5.4.*, 5.3.*, 5.2.*, 5.1.*, 5.0.*, 4.2.*, 4.1.*, 4.0.*]
|
||||
include:
|
||||
- laravel: 8.*
|
||||
testbench: 6.*
|
||||
php: 7.3
|
||||
phpunit: 9.3.*
|
||||
|
||||
- laravel: 7.*
|
||||
testbench: 5.*
|
||||
php: 7.3
|
||||
phpunit: 8.4.*
|
||||
|
||||
- laravel: 6.*
|
||||
testbench: 4.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- laravel: 5.8.*
|
||||
testbench: 3.8.*
|
||||
php: 7.1
|
||||
phpunit: 7.5.*
|
||||
|
||||
- laravel: 5.7.*
|
||||
testbench: 3.7.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- laravel: 5.6.*
|
||||
testbench: 3.6.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- laravel: 5.5.*
|
||||
testbench: 3.5.*
|
||||
php: 7.0
|
||||
phpunit: 6.0.*
|
||||
|
||||
- laravel: 5.4.*
|
||||
testbench: 3.4.*
|
||||
php: 5.6
|
||||
phpunit: 5.7.*
|
||||
|
||||
- laravel: 5.3.*
|
||||
testbench: 3.3.*
|
||||
php: 5.6
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 5.2.*
|
||||
testbench: 3.2.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 5.1.*
|
||||
testbench: 3.1.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 5.0.*
|
||||
testbench: 3.0.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 4.2.*
|
||||
testbench: 2.2.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 4.1.*
|
||||
testbench: 2.1.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
- laravel: 4.0.*
|
||||
testbench: 2.0.*
|
||||
php: 5.4
|
||||
phpunit: 4.8.*
|
||||
|
||||
name: L${{ matrix.laravel }} - P${{ matrix.php }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
|
||||
# ini-values: memory_limit=-1
|
||||
coverage: none
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench:${{ matrix.testbench }}" monolog/monolog --no-interaction --no-update
|
||||
composer update --prefer-dist --no-interaction --no-suggest
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit
|
||||
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
vendor
|
||||
composer.lock
|
||||
.phpunit.result.cache
|
||||
.phpcs-cache
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
|
||||
expectedArguments(\noty(), 1, 'success', 'error', 'info', 'warning');
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\Facade;
|
||||
|
||||
use Flasher\Noty\Prime\NotyBuilder;
|
||||
use Flasher\Prime\Envelope;
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
use Flasher\Prime\Stamp\StampInterface;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* @method static NotyBuilder addSuccess(string $message, array $options = array())
|
||||
* @method static NotyBuilder addError(string $message, array $options = array())
|
||||
* @method static NotyBuilder addWarning(string $message, array $options = array())
|
||||
* @method static NotyBuilder addInfo(string $message, array $options = array())
|
||||
* @method static NotyBuilder addFlash(string|NotificationInterface $type, string $message = null, array $options = array())
|
||||
* @method static NotyBuilder flash(StampInterface[] $stamps = array())
|
||||
* @method static NotyBuilder type(string $type, string $message = null, array $options = array())
|
||||
* @method static NotyBuilder message(string $message)
|
||||
* @method static NotyBuilder options(array $options, bool $merge = true)
|
||||
* @method static NotyBuilder option(string $name, string $value)
|
||||
* @method static NotyBuilder success(string $message = null, array $options = array())
|
||||
* @method static NotyBuilder error(string $message = null, array $options = array())
|
||||
* @method static NotyBuilder info(string $message = null, array $options = array())
|
||||
* @method static NotyBuilder warning(string $message = null, array $options = array())
|
||||
* @method static NotyBuilder priority(int $priority)
|
||||
* @method static NotyBuilder hops(int $amount)
|
||||
* @method static NotyBuilder keep()
|
||||
* @method static NotyBuilder delay(int $delay)
|
||||
* @method static NotyBuilder now()
|
||||
* @method static NotyBuilder with(StampInterface[] $stamps = array())
|
||||
* @method static NotyBuilder withStamp(StampInterface $stamp)
|
||||
* @method static NotyBuilder handler(string $handler)
|
||||
* @method static Envelope getEnvelope()
|
||||
*
|
||||
* @method static NotyBuilder text(string $text)
|
||||
* @method static NotyBuilder alert(string $message = null, array $options = array())
|
||||
* @method static NotyBuilder layout(string $layout)
|
||||
* @method static NotyBuilder theme(string $theme)
|
||||
* @method static NotyBuilder timeout(int|bool $timeout)
|
||||
* @method static NotyBuilder progressBar(bool $progressBar = false)
|
||||
* @method static NotyBuilder closeWith(string|array $closeWith)
|
||||
* @method static NotyBuilder animation(string $animation, string $effect)
|
||||
* @method static NotyBuilder sounds(string $option, mixed $value)
|
||||
* @method static NotyBuilder docTitle(string $option, mixed $docTitle)
|
||||
* @method static NotyBuilder modal(bool $modal = true)
|
||||
* @method static NotyBuilder id(bool|string $id)
|
||||
* @method static NotyBuilder force(bool $force = true)
|
||||
* @method static NotyBuilder queue(string $queue)
|
||||
* @method static NotyBuilder killer(bool|string $killer)
|
||||
* @method static NotyBuilder container(bool|string $container)
|
||||
* @method static NotyBuilder buttons(array $buttons)
|
||||
* @method static NotyBuilder visibilityControl(bool $visibilityControl)
|
||||
*/
|
||||
class Noty extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'flasher.noty';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel;
|
||||
|
||||
use Flasher\Noty\Laravel\ServiceProvider\ServiceProviderManager;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
final class FlasherNotyServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function boot()
|
||||
{
|
||||
$manager = new ServiceProviderManager($this);
|
||||
$manager->boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$manager = new ServiceProviderManager($this);
|
||||
$manager->register();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return array(
|
||||
'flasher.noty',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Container
|
||||
*/
|
||||
public function getApplication()
|
||||
{
|
||||
return $this->app;
|
||||
}
|
||||
|
||||
public function mergeConfigFrom($path, $key)
|
||||
{
|
||||
parent::mergeConfigFrom($path, $key);
|
||||
}
|
||||
|
||||
public function publishes(array $paths, $groups = null)
|
||||
{
|
||||
parent::publishes($paths, $groups);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<p align="center"><img width="600" alt="flasher" src="https://user-images.githubusercontent.com/10859693/102468596-03317180-4052-11eb-9df3-44dc6235b238.png"></p>
|
||||
|
||||
<h1 align="center">A powerful and flexible flash notifications system for PHP, Laravel, Symfony</h1>
|
||||
|
||||
<p align="center">
|
||||
:eyes: PHP Flasher helps you to add flash notifications to your PHP projects.
|
||||
This library was developed with the idea that you should be able to add flash notification to your application with ease and with few lines of code.
|
||||
No application-wide rewrites and no big investments upfront.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/badge/source-php--flasher/flasher-blue.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/releases">
|
||||
<img src="https://img.shields.io/github/tag/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/backer/badge.svg?label=backer&color=brightgreen" />
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Why use PHP Flasher ?
|
||||
|
||||
The PHP Flasher project supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__, and __notyf__
|
||||
and its highly extendable so you can add your custom notifications.
|
||||
|
||||
This library is designed, so you can take full control when creating you notifications :
|
||||
|
||||
> * Display multiple notifications
|
||||
> * Sort and filter notifications
|
||||
> * Render notification from JSON object
|
||||
> * Limit the number of displayed notifications
|
||||
> * Show notifications from different libraries at the same time
|
||||
> * Framework angostic with integration for : Symfony and Laravel
|
||||
> * Support templates
|
||||
> * Easy migration from similar libraries.
|
||||
> * Very flexible so you can add you own adapters
|
||||
> * ...and more
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHP Flasher can be found on the [PHP Flasher website](https://php-flasher.github.io/).
|
||||
|
||||
## Backers && Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your name will show up in the Contribute page of all PHP Flasher installations as well as here with a link to your website!
|
||||
|
||||
Thank you to all our backers and sponsors! 🙏
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#backers" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/backers.svg?width=890" title="Backers" alt="Backers">
|
||||
</a>
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#sponsors" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/sponsors.svg?width=890" title="Sponsors" alt="Sponsors">
|
||||
</a>
|
||||
|
||||
### Contact
|
||||
|
||||
PHP Flasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. You can reach out with questions, bug reports, or feature requests
|
||||
on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHP Flasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> <b> </p>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'scripts' => array(
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js',
|
||||
),
|
||||
'styles' => array(),
|
||||
'options' => array(
|
||||
'timeout' => 5000,
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Flasher\Prime\Notification\NotificationInterface;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
if (!function_exists('noty')) {
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $type
|
||||
*
|
||||
* @return \Flasher\Noty\Prime\NotyFactory
|
||||
*/
|
||||
function noty($message = null, $type = NotificationInterface::TYPE_SUCCESS, array $options = array())
|
||||
{
|
||||
if (null === $message) {
|
||||
return App::make('flasher.noty');
|
||||
}
|
||||
|
||||
return App::make('flasher.noty')->addFlash($type, $message, $options);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Laravel\ServiceProvider\ResourceManagerHelper;
|
||||
use Flasher\Noty\Laravel\FlasherNotyServiceProvider;
|
||||
use Flasher\Noty\Prime\NotyFactory;
|
||||
use Flasher\Prime\Flasher;
|
||||
use Flasher\Prime\Response\Resource\ResourceManager;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Foundation\Application;
|
||||
|
||||
class Laravel implements ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* @var Container
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
public function __construct(Container $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
public function shouldBeUsed()
|
||||
{
|
||||
return $this->app instanceof Application;
|
||||
}
|
||||
|
||||
public function boot(FlasherNotyServiceProvider $provider)
|
||||
{
|
||||
$provider->publishes(array(
|
||||
flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher_noty.php'),
|
||||
), 'flasher-config');
|
||||
}
|
||||
|
||||
public function register(FlasherNotyServiceProvider $provider)
|
||||
{
|
||||
$provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher_noty');
|
||||
$this->appendToFlasherConfig();
|
||||
|
||||
$this->registerServices();
|
||||
}
|
||||
|
||||
protected function registerServices()
|
||||
{
|
||||
$this->app->singleton('flasher.noty', function (Container $app) {
|
||||
return new NotyFactory($app['flasher.storage_manager']);
|
||||
});
|
||||
|
||||
$this->app->alias('flasher.noty', 'Flasher\Noty\Prime\NotyFactory');
|
||||
|
||||
$this->app->extend('flasher', function (Flasher $flasher, Container $app) {
|
||||
$flasher->addFactory('noty', $app['flasher.noty']);
|
||||
|
||||
return $flasher;
|
||||
});
|
||||
|
||||
$this->app->extend('flasher.resource_manager', function (ResourceManager $resourceManager) {
|
||||
ResourceManagerHelper::process($resourceManager, 'noty');
|
||||
|
||||
return $resourceManager;
|
||||
});
|
||||
}
|
||||
|
||||
protected function appendToFlasherConfig()
|
||||
{
|
||||
$flasherConfig = $this->app['config']->get('flasher.adapters.noty', array());
|
||||
|
||||
$notyConfig = $this->app['config']->get('flasher_noty', array());
|
||||
|
||||
$this->app['config']->set('flasher.adapters.noty', array_merge($notyConfig, $flasherConfig));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Noty\Laravel\FlasherNotyServiceProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
|
||||
final class Laravel4 extends Laravel
|
||||
{
|
||||
public function shouldBeUsed()
|
||||
{
|
||||
return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.');
|
||||
}
|
||||
|
||||
public function boot(FlasherNotyServiceProvider $provider)
|
||||
{
|
||||
$provider->package(
|
||||
'php-flasher/flasher-noty-laravel',
|
||||
'flasher_noty',
|
||||
flasher_path(__DIR__ . '/../../Resources')
|
||||
);
|
||||
$this->appendToFlasherConfig();
|
||||
}
|
||||
|
||||
public function register(FlasherNotyServiceProvider $provider)
|
||||
{
|
||||
$this->registerServices();
|
||||
}
|
||||
|
||||
protected function appendToFlasherConfig()
|
||||
{
|
||||
$flasherConfig = $this->app['config']->get('flasher::config.adapters.noty', array());
|
||||
|
||||
$notyConfig = $this->app['config']->get('flasher_noty::config', array());
|
||||
|
||||
$this->app['config']->set('flasher::config.adapters.noty', array_merge($notyConfig, $flasherConfig));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\ServiceProvider\Providers;
|
||||
|
||||
use Flasher\Noty\Laravel\FlasherNotyServiceProvider;
|
||||
|
||||
interface ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldBeUsed();
|
||||
|
||||
public function boot(FlasherNotyServiceProvider $provider);
|
||||
|
||||
public function register(FlasherNotyServiceProvider $provider);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\ServiceProvider;
|
||||
|
||||
use Flasher\Noty\Laravel\FlasherNotyServiceProvider;
|
||||
use Flasher\Noty\Laravel\ServiceProvider\Providers\ServiceProviderInterface;
|
||||
|
||||
final class ServiceProviderManager
|
||||
{
|
||||
private $provider;
|
||||
|
||||
/**
|
||||
* @var ServiceProviderInterface[]
|
||||
*/
|
||||
private $providers = array(
|
||||
'Flasher\Noty\Laravel\ServiceProvider\Providers\Laravel4',
|
||||
'Flasher\Noty\Laravel\ServiceProvider\Providers\Laravel',
|
||||
);
|
||||
|
||||
private $notifyServiceProvider;
|
||||
|
||||
public function __construct(FlasherNotyServiceProvider $notifyServiceProvider)
|
||||
{
|
||||
$this->notifyServiceProvider = $notifyServiceProvider;
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
$provider = $this->resolveServiceProvider();
|
||||
$provider->boot($this->notifyServiceProvider);
|
||||
}
|
||||
|
||||
public function register()
|
||||
{
|
||||
$provider = $this->resolveServiceProvider();
|
||||
$provider->register($this->notifyServiceProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ServiceProviderInterface
|
||||
*/
|
||||
private function resolveServiceProvider()
|
||||
{
|
||||
if ($this->provider instanceof ServiceProviderInterface) {
|
||||
return $this->provider;
|
||||
}
|
||||
|
||||
foreach ($this->providers as $providerClass) {
|
||||
$provider = new $providerClass($this->notifyServiceProvider->getApplication());
|
||||
|
||||
if ($provider->shouldBeUsed()) {
|
||||
return $this->provider = $provider;
|
||||
}
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Service Provider not found.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\Tests;
|
||||
|
||||
class FlasherNotyServiceProviderTest extends TestCase
|
||||
{
|
||||
public function testContainerContainNotifyServices()
|
||||
{
|
||||
$this->assertTrue($this->app->bound('flasher.noty'));
|
||||
$this->assertInstanceOf('Flasher\Noty\Prime\NotyFactory', $this->app->make('flasher.noty'));
|
||||
}
|
||||
|
||||
public function testNotifyFactoryIsAddedToExtensionsArray()
|
||||
{
|
||||
$flasher = $this->app->make('flasher');
|
||||
$adapter = $flasher->create('noty');
|
||||
|
||||
$this->assertInstanceOf('Flasher\Noty\Prime\NotyFactory', $adapter);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Laravel\Tests;
|
||||
|
||||
use Illuminate\Config\Repository as Config;
|
||||
use Illuminate\Foundation\AliasLoader;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Orchestra\Testbench\TestCase as Orchestra;
|
||||
|
||||
class TestCase extends Orchestra
|
||||
{
|
||||
public function createApplication()
|
||||
{
|
||||
if (0 !== strpos(Application::VERSION, '4.0')) {
|
||||
return parent::createApplication();
|
||||
}
|
||||
|
||||
$app = new Application();
|
||||
|
||||
$app->detectEnvironment(array(
|
||||
'local' => array('your-machine-name'),
|
||||
));
|
||||
|
||||
$app->bindInstallPaths($this->getApplicationPaths());
|
||||
|
||||
$app['env'] = 'testing';
|
||||
|
||||
$app->instance('app', $app);
|
||||
|
||||
Facade::clearResolvedInstances();
|
||||
Facade::setFacadeApplication($app);
|
||||
|
||||
$config = new Config($app->getConfigLoader(), $app['env']);
|
||||
$app->instance('config', $config);
|
||||
$app->startExceptionHandling();
|
||||
|
||||
if ($app->runningInConsole()) {
|
||||
$app->setRequestForConsoleEnvironment();
|
||||
}
|
||||
|
||||
date_default_timezone_set($this->getApplicationTimezone());
|
||||
|
||||
$aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases());
|
||||
AliasLoader::getInstance($aliases)->register();
|
||||
|
||||
Request::enableHttpMethodParameterOverride();
|
||||
|
||||
$providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders());
|
||||
$app->getProviderRepository()->load($app, $providers);
|
||||
|
||||
$this->getEnvironmentSetUp($app);
|
||||
|
||||
$app->boot();
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Application $app
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getPackageProviders($app = null)
|
||||
{
|
||||
return array(
|
||||
'Flasher\Laravel\FlasherServiceProvider',
|
||||
'Flasher\Noty\Laravel\FlasherNotyServiceProvider',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Application $app
|
||||
*/
|
||||
protected function getEnvironmentSetUp($app)
|
||||
{
|
||||
$separator = $this->isLaravel4() ? '::config' : '';
|
||||
|
||||
$app['config']->set('session' . $separator . '.driver', 'array');
|
||||
}
|
||||
|
||||
private function isLaravel4()
|
||||
{
|
||||
return 0 === strpos(Application::VERSION, '4.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-noty-laravel",
|
||||
"description": "PHP Flasher Laravel adapter for Noty",
|
||||
"keywords": [
|
||||
"yoeunes",
|
||||
"notify",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"Lumen",
|
||||
"notifications",
|
||||
"messages",
|
||||
"alerts",
|
||||
"pnotify",
|
||||
"noty ",
|
||||
"bundle",
|
||||
"flex"
|
||||
],
|
||||
"homepage": "https://php-flasher.github.io/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes Khoubza",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://github.com/yoeunes",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^0.4",
|
||||
"php-flasher/flasher-noty": "^0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0",
|
||||
"orchestra/testbench": "^2.0|^3.0|^4.0|^5.0|^6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Noty\\Laravel\\": ""
|
||||
},
|
||||
"files": [
|
||||
"Resources/functions/noty.php"
|
||||
],
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Noty\\Laravel\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Flasher\\Noty\\Laravel\\FlasherNotyServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Noty": "Flasher\\Laravel\\Facade\\Flasher"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="Flasher Test Suite">
|
||||
<directory>Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
; This file is for unifying the coding style for different editors and IDEs.
|
||||
; More information at http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
# Path-based git attributes
|
||||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
|
||||
# Ignore all test and documentation with "export-ignore".
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/.styleci.yml export-ignore
|
||||
/tests export-ignore
|
||||
/.editorconfig export-ignore
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: ['https://www.paypal.com/paypalme/yoeunes']
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
name: Running tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php: [ 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4 ]
|
||||
|
||||
name: php ${{ matrix.php }} - ${{ matrix.dependency-version }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
|
||||
- name: Require phpunit 4.8 for php <= 5.6
|
||||
if: matrix.php <= 5.6
|
||||
run: composer require "phpunit/phpunit:4.8.36" --no-interaction --no-update
|
||||
|
||||
- name: Require phpunit 6 for php >= 7.0
|
||||
if: matrix.php >= 7.0
|
||||
run: composer require "phpunit/phpunit:6.*" --no-interaction --no-update
|
||||
|
||||
- name: Require phpunit 9 for php >= 7.3
|
||||
if: matrix.php >= 7.3
|
||||
run: composer require "phpunit/phpunit:9.*" --no-interaction --no-update
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer update --prefer-dist --no-interaction --no-suggest
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit
|
||||
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
vendor
|
||||
composer.lock
|
||||
.phpunit.result.cache
|
||||
.phpcs-cache
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::layout(), 0, 'top', 'topLeft', 'topCenter', 'topRight', 'center', 'centerLeft', 'centerRight', 'bottom', 'bottomLeft', 'bottomCenter', 'bottomRight');
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::theme(), 0, 'relax', 'mint', 'metroui');
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::timeout(), 0, false, 1000, 3000, 3500, 5000);
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::closeWith(), 0, 'click', 'button', array('click', 'button'));
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::animation(), 0, 'open', 'close');
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::sounds(), 0, 'sources', 'volume', 'conditions');
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::docTitle(), 0, 'conditions');
|
||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::queue(), 0, 'global');
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\Notification;
|
||||
|
||||
final class Noty extends Notification
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationBuilder;
|
||||
|
||||
final class NotyBuilder extends NotificationBuilder
|
||||
{
|
||||
/**
|
||||
* This string can contain HTML too. But be careful and don't pass user inputs to this parameter.
|
||||
*
|
||||
* @param string $text
|
||||
*
|
||||
* @return NotyBuilder
|
||||
*/
|
||||
public function text($text)
|
||||
{
|
||||
return $this->message($text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return NotyBuilder
|
||||
*/
|
||||
public function alert($message = null, array $options = array())
|
||||
{
|
||||
return $this->type('alert', $message, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* top, topLeft, topCenter, topRight, center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, bottomRight
|
||||
* - ClassName generator uses this value → noty_layout__${layout}
|
||||
*
|
||||
* @param string $layout
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function layout($layout)
|
||||
{
|
||||
$this->option('layout', $layout);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* relax, mint, metroui - ClassName generator uses this value → noty_theme__${theme}
|
||||
*
|
||||
* @param string $theme
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function theme($theme)
|
||||
{
|
||||
$this->option('theme', $theme);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* false, 1000, 3000, 3500, etc. Delay for closing event in milliseconds (ms). Set 'false' for sticky notifications.
|
||||
*
|
||||
* @param int|bool $timeout
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function timeout($timeout)
|
||||
{
|
||||
$this->option('timeout', $timeout);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* true, false - Displays a progress bar if timeout is not false.
|
||||
*
|
||||
* @param bool $progressBar
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function progressBar($progressBar = false)
|
||||
{
|
||||
$this->option('progressBar', $progressBar);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* click, button
|
||||
*
|
||||
* @param string|array $closeWith
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function closeWith($closeWith)
|
||||
{
|
||||
$this->option('closeWith', (array) $closeWith);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If string, assumed to be CSS class name. If null, no animation at all. If function, runs the function. (v3.0.1+)
|
||||
* You can use animate.css class names or your custom css animations as well.
|
||||
*
|
||||
* @param string $animation
|
||||
* @param string $effect
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function animation($animation, $effect)
|
||||
{
|
||||
$this->option('animation.' . $animation, $effect);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $option
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function sounds($option, $value)
|
||||
{
|
||||
$this->option('sounds.' . $option, $value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $option
|
||||
* @param mixed $docTitle
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function docTitle($option, $docTitle)
|
||||
{
|
||||
$this->option('docTitle' . $option, $docTitle);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $modal
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function modal($modal = true)
|
||||
{
|
||||
$this->option('modal', $modal);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* You can use this id with querySelectors. Generated automatically if false.
|
||||
*
|
||||
* @param bool|string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function id($id)
|
||||
{
|
||||
$this->option('id', $id);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOM insert method depends on this parameter. If false uses append, if true uses prepend.
|
||||
*
|
||||
* @param bool $force
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function force($force = true)
|
||||
{
|
||||
$this->option('force', $force);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $queue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function queue($queue)
|
||||
{
|
||||
$this->option('queue', $queue);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If true closes all visible notifications and shows itself. If string(queueName) closes all visible notification
|
||||
* on this queue and shows itself.
|
||||
*
|
||||
* @param string|bool $killer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function killer($killer)
|
||||
{
|
||||
$this->option('killer', $killer);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom container selector string. Like '.my-custom-container'. Layout parameter will be ignored.
|
||||
*
|
||||
* @param string|bool $container
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function container($container)
|
||||
{
|
||||
$this->option('container', $container);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of Noty.button, for creating confirmation dialogs.
|
||||
*
|
||||
* @param array $buttons
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function buttons($buttons)
|
||||
{
|
||||
$this->option('buttons', $buttons);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If true Noty uses PageVisibility API to handle timeout. To ensure that users do not miss their notifications.
|
||||
*
|
||||
* @param bool $visibilityControl
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function visibilityControl($visibilityControl)
|
||||
{
|
||||
$this->option('visibilityControl', $visibilityControl);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Prime;
|
||||
|
||||
use Flasher\Prime\Factory\NotificationFactory;
|
||||
|
||||
/**
|
||||
* @mixin NotyBuilder
|
||||
*/
|
||||
final class NotyFactory extends NotificationFactory
|
||||
{
|
||||
public function createNotificationBuilder()
|
||||
{
|
||||
return new NotyBuilder($this->getStorageManager(), new Noty(), 'noty');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<p align="center"><img width="600" alt="flasher" src="https://user-images.githubusercontent.com/10859693/102468596-03317180-4052-11eb-9df3-44dc6235b238.png"></p>
|
||||
|
||||
<h1 align="center">A powerful and flexible flash notifications system for PHP, Laravel, Symfony</h1>
|
||||
|
||||
<p align="center">
|
||||
:eyes: PHP Flasher helps you to add flash notifications to your PHP projects.
|
||||
This library was developed with the idea that you should be able to add flash notification to your application with ease and with few lines of code.
|
||||
No application-wide rewrites and no big investments upfront.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/badge/source-php--flasher/flasher-blue.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/releases">
|
||||
<img src="https://img.shields.io/github/tag/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE">
|
||||
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg">
|
||||
</a>
|
||||
<a href="https://packagist.org/packages/php-flasher/flasher">
|
||||
<img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg?style=flat-square">
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/backer/badge.svg?label=backer&color=brightgreen" />
|
||||
</a>
|
||||
<a href="https://opencollective.com/php-flasher">
|
||||
<img src="https://opencollective.com/php-flasher/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Why use PHP Flasher ?
|
||||
|
||||
The PHP Flasher project supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__, and __notyf__
|
||||
and its highly extendable so you can add your custom notifications.
|
||||
|
||||
This library is designed, so you can take full control when creating you notifications :
|
||||
|
||||
> * Display multiple notifications
|
||||
> * Sort and filter notifications
|
||||
> * Render notification from JSON object
|
||||
> * Limit the number of displayed notifications
|
||||
> * Show notifications from different libraries at the same time
|
||||
> * Framework angostic with integration for : Symfony and Laravel
|
||||
> * Support templates
|
||||
> * Easy migration from similar libraries.
|
||||
> * Very flexible so you can add you own adapters
|
||||
> * ...and more
|
||||
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for PHP Flasher can be found on the [PHP Flasher website](https://php-flasher.github.io/).
|
||||
|
||||
## Backers && Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your name will show up in the Contribute page of all PHP Flasher installations as well as here with a link to your website!
|
||||
|
||||
Thank you to all our backers and sponsors! 🙏
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#backers" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/backers.svg?width=890" title="Backers" alt="Backers">
|
||||
</a>
|
||||
|
||||
<a href="https://opencollective.com/php-flasher#sponsors" target="_blank">
|
||||
<img src="https://opencollective.com/php-flasher/sponsors.svg?width=890" title="Sponsors" alt="Sponsors">
|
||||
</a>
|
||||
|
||||
### Contact
|
||||
|
||||
PHP Flasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. You can reach out with questions, bug reports, or feature requests
|
||||
on any of the following:
|
||||
|
||||
- [Github Issues](https://github.com/php-flasher/flasher/issues)
|
||||
- [Github](https://github.com/yoeunes)
|
||||
- [Twitter](https://twitter.com/yoeunes)
|
||||
- [Linkedin](https://www.linkedin.com/in/younes-khoubza/)
|
||||
- [Email me directly](mailto:younes.khoubza@gmail.com)
|
||||
|
||||
## License
|
||||
|
||||
PHP Flasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes-khoubza/">Younes KHOUBZA</a> <b> </p>
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-noty",
|
||||
"description": "PHP Flasher adapter for Noty",
|
||||
"keywords": [
|
||||
"notify",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"Lumen",
|
||||
"notifications",
|
||||
"messages",
|
||||
"alerts",
|
||||
"pnotify",
|
||||
"noty "
|
||||
],
|
||||
"homepage": "https://php-flasher.github.io/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes Khoubza",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://github.com/yoeunes",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0|^8.0|^9.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Noty\\Prime\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Noty\\Prime\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="Flasher Test Suite">
|
||||
<directory>Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
# Path-based git attributes
|
||||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
|
||||
# Ignore all test and documentation with "export-ignore".
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/.scrutinizer.yml export-ignore
|
||||
/.styleci.yml export-ignore
|
||||
/tests export-ignore
|
||||
/.editorconfig export-ignore
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: ['https://www.paypal.com/paypalme/yoeunes']
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
name: Running tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
symfony: [5.2.*, 5.1.*, 5.0.*, 4.4.*, 4.3.*, 4.2.*, 4.1.*, 4.0.*, 3.4.*, 3.3.*, 3.2.*, 3.1.*, 3.0.*, 2.8.*, 2.7.*]
|
||||
include:
|
||||
- symfony: 5.2.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- symfony: 5.1.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- symfony: 5.0.*
|
||||
php: 7.2
|
||||
phpunit: 8.3.*
|
||||
|
||||
- symfony: 4.4.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.3.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.2.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.1.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 4.0.*
|
||||
php: 7.1
|
||||
phpunit: 7.0.*
|
||||
|
||||
- symfony: 3.4.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.3.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.2.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.1.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 3.0.*
|
||||
php: 5.5
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 2.8.*
|
||||
php: 5.3
|
||||
phpunit: 4.8.36
|
||||
|
||||
- symfony: 2.7.*
|
||||
php: 5.3
|
||||
phpunit: 4.8.36
|
||||
|
||||
name: S${{ matrix.symfony }} - P${{ matrix.php }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: dependencies-symfony-${{ matrix.symfony }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
|
||||
coverage: none
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer require "symfony/symfony:${{ matrix.symfony }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
|
||||
composer config extra.symfony.require "${{ matrix.symfony }}"
|
||||
composer update --prefer-dist --no-interaction --no-suggest
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit
|
||||
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
vendor
|
||||
composer.lock
|
||||
.phpunit.result.cache
|
||||
.phpcs-cache
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Symfony\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
||||
final class Configuration implements ConfigurationInterface
|
||||
{
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('flasher_noty');
|
||||
|
||||
if (\method_exists($treeBuilder, 'getRootNode')) {
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
} else {
|
||||
// BC layer for symfony/config 4.1 and older
|
||||
$rootNode = $treeBuilder->root('flasher_noty');
|
||||
}
|
||||
|
||||
$rootNode
|
||||
->children()
|
||||
->arrayNode('scripts')
|
||||
->prototype('scalar')->end()
|
||||
->defaultValue(array(
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js',
|
||||
))
|
||||
->end()
|
||||
->arrayNode('styles')
|
||||
->prototype('scalar')->end()
|
||||
->defaultValue(array())
|
||||
->end()
|
||||
->arrayNode('options')
|
||||
->prototype('variable')->end()
|
||||
->ignoreExtraKeys(false)
|
||||
->defaultValue(array(
|
||||
'timeout' => 5000,
|
||||
))
|
||||
->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Noty\Symfony\DependencyInjection;
|
||||
|
||||
use Flasher\Symfony\DependencyInjection\Extension;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
|
||||
final class FlasherNotyExtension extends Extension
|
||||
{
|
||||
protected function getConfigFileLocator()
|
||||
{
|
||||
return new FileLocator(__DIR__ . '/../Resources/config');
|
||||
}
|
||||
|
||||
protected function getConfigClass()
|
||||
{
|
||||
return new Configuration();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user