From 8c91736586373196a205efc489ec9cfa32e0451a Mon Sep 17 00:00:00 2001 From: viktorprogger Date: Wed, 25 Aug 2021 11:04:14 +0000 Subject: [PATCH 1/2] Schedule GitHub workflows --- .github/workflows/build.yml | 6 +- .github/workflows/dependency.yml | 6 +- .github/workflows/static.yml | 6 +- config/packages/dist.lock | 156 +++++++++ config/packages/merge_plan.php | 302 ++++++++++++++++++ config/packages/yiisoft/aliases/common.php | 14 + config/packages/yiisoft/aliases/params.php | 9 + config/packages/yiisoft/assets/params.php | 29 ++ config/packages/yiisoft/assets/web.php | 66 ++++ config/packages/yiisoft/cache-file/common.php | 14 + config/packages/yiisoft/cache-file/params.php | 11 + config/packages/yiisoft/csrf/params.php | 13 + config/packages/yiisoft/csrf/web.php | 39 +++ config/packages/yiisoft/data-response/web.php | 27 ++ config/packages/yiisoft/error-handler/web.php | 14 + .../yiisoft/log-target-file/common.php | 40 +++ .../yiisoft/log-target-file/params.php | 29 ++ .../packages/yiisoft/log/events-console.php | 17 + config/packages/yiisoft/log/events-web.php | 17 + .../yiisoft/mailer-swiftmailer/common.php | 63 ++++ .../yiisoft/mailer-swiftmailer/params.php | 25 ++ .../yiisoft/middleware-dispatcher/web.php | 10 + .../packages/yiisoft/profiler/events-web.php | 12 + config/packages/yiisoft/profiler/params.php | 28 ++ .../yiisoft/router-fastroute/common.php | 13 + .../packages/yiisoft/router-fastroute/web.php | 21 ++ config/packages/yiisoft/router/common.php | 12 + config/packages/yiisoft/session/params.php | 12 + config/packages/yiisoft/session/web.php | 21 ++ config/packages/yiisoft/user/params.php | 13 + config/packages/yiisoft/user/web.php | 31 ++ config/packages/yiisoft/validator/common.php | 15 + config/packages/yiisoft/view/common.php | 24 ++ config/packages/yiisoft/view/web.php | 39 +++ config/packages/yiisoft/widget/bootstrap.php | 12 + .../yiisoft/yii-bootstrap5/params.php | 20 ++ .../packages/yiisoft/yii-console/console.php | 38 +++ .../yiisoft/yii-console/events-console.php | 12 + .../yiisoft/yii-console/providers-console.php | 5 + config/packages/yiisoft/yii-cycle/common.php | 67 ++++ config/packages/yiisoft/yii-cycle/console.php | 22 ++ .../yiisoft/yii-cycle/events-console.php | 12 + .../yiisoft/yii-cycle/providers-web.php | 7 + .../yiisoft/yii-debug-api/providers-web.php | 13 + .../packages/yiisoft/yii-debug-api/routes.php | 50 +++ config/packages/yiisoft/yii-debug-api/web.php | 15 + .../yii-debug-viewer/config/params.php | 31 ++ .../yii-debug-viewer/config/routes.php | 47 +++ .../yiisoft/yii-debug-viewer/config/web.php | 13 + config/packages/yiisoft/yii-debug/common.php | 67 ++++ config/packages/yiisoft/yii-debug/console.php | 26 ++ .../yiisoft/yii-debug/events-console.php | 36 +++ .../packages/yiisoft/yii-debug/events-web.php | 49 +++ .../packages/yiisoft/yii-debug/providers.php | 13 + config/packages/yiisoft/yii-debug/tests.php | 10 + config/packages/yiisoft/yii-debug/web.php | 27 ++ config/packages/yiisoft/yii-event/common.php | 13 + config/packages/yiisoft/yii-event/console.php | 12 + .../yiisoft/yii-event/events-console.php | 5 + .../packages/yiisoft/yii-event/events-web.php | 5 + config/packages/yiisoft/yii-event/events.php | 5 + config/packages/yiisoft/yii-event/web.php | 12 + .../yiisoft/yii-filesystem/common.php | 41 +++ .../yiisoft/yii-filesystem/providers.php | 9 + config/packages/yiisoft/yii-view/web.php | 17 + public/assets/.gitignore | 0 66 files changed, 1859 insertions(+), 6 deletions(-) create mode 100644 config/packages/dist.lock create mode 100644 config/packages/merge_plan.php create mode 100644 config/packages/yiisoft/aliases/common.php create mode 100644 config/packages/yiisoft/aliases/params.php create mode 100644 config/packages/yiisoft/assets/params.php create mode 100644 config/packages/yiisoft/assets/web.php create mode 100644 config/packages/yiisoft/cache-file/common.php create mode 100644 config/packages/yiisoft/cache-file/params.php create mode 100644 config/packages/yiisoft/csrf/params.php create mode 100644 config/packages/yiisoft/csrf/web.php create mode 100644 config/packages/yiisoft/data-response/web.php create mode 100644 config/packages/yiisoft/error-handler/web.php create mode 100644 config/packages/yiisoft/log-target-file/common.php create mode 100644 config/packages/yiisoft/log-target-file/params.php create mode 100644 config/packages/yiisoft/log/events-console.php create mode 100644 config/packages/yiisoft/log/events-web.php create mode 100644 config/packages/yiisoft/mailer-swiftmailer/common.php create mode 100644 config/packages/yiisoft/mailer-swiftmailer/params.php create mode 100644 config/packages/yiisoft/middleware-dispatcher/web.php create mode 100644 config/packages/yiisoft/profiler/events-web.php create mode 100644 config/packages/yiisoft/profiler/params.php create mode 100644 config/packages/yiisoft/router-fastroute/common.php create mode 100644 config/packages/yiisoft/router-fastroute/web.php create mode 100644 config/packages/yiisoft/router/common.php create mode 100644 config/packages/yiisoft/session/params.php create mode 100644 config/packages/yiisoft/session/web.php create mode 100644 config/packages/yiisoft/user/params.php create mode 100644 config/packages/yiisoft/user/web.php create mode 100644 config/packages/yiisoft/validator/common.php create mode 100644 config/packages/yiisoft/view/common.php create mode 100644 config/packages/yiisoft/view/web.php create mode 100644 config/packages/yiisoft/widget/bootstrap.php create mode 100644 config/packages/yiisoft/yii-bootstrap5/params.php create mode 100644 config/packages/yiisoft/yii-console/console.php create mode 100644 config/packages/yiisoft/yii-console/events-console.php create mode 100644 config/packages/yiisoft/yii-console/providers-console.php create mode 100644 config/packages/yiisoft/yii-cycle/common.php create mode 100644 config/packages/yiisoft/yii-cycle/console.php create mode 100644 config/packages/yiisoft/yii-cycle/events-console.php create mode 100644 config/packages/yiisoft/yii-cycle/providers-web.php create mode 100644 config/packages/yiisoft/yii-debug-api/providers-web.php create mode 100644 config/packages/yiisoft/yii-debug-api/routes.php create mode 100644 config/packages/yiisoft/yii-debug-api/web.php create mode 100644 config/packages/yiisoft/yii-debug-viewer/config/params.php create mode 100644 config/packages/yiisoft/yii-debug-viewer/config/routes.php create mode 100644 config/packages/yiisoft/yii-debug-viewer/config/web.php create mode 100644 config/packages/yiisoft/yii-debug/common.php create mode 100644 config/packages/yiisoft/yii-debug/console.php create mode 100644 config/packages/yiisoft/yii-debug/events-console.php create mode 100644 config/packages/yiisoft/yii-debug/events-web.php create mode 100644 config/packages/yiisoft/yii-debug/providers.php create mode 100644 config/packages/yiisoft/yii-debug/tests.php create mode 100644 config/packages/yiisoft/yii-debug/web.php create mode 100644 config/packages/yiisoft/yii-event/common.php create mode 100644 config/packages/yiisoft/yii-event/console.php create mode 100644 config/packages/yiisoft/yii-event/events-console.php create mode 100644 config/packages/yiisoft/yii-event/events-web.php create mode 100644 config/packages/yiisoft/yii-event/events.php create mode 100644 config/packages/yiisoft/yii-event/web.php create mode 100644 config/packages/yiisoft/yii-filesystem/common.php create mode 100644 config/packages/yiisoft/yii-filesystem/providers.php create mode 100644 config/packages/yiisoft/yii-view/web.php mode change 100644 => 100755 public/assets/.gitignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2b2b0558..cdd2359cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,8 @@ on: - - pull_request - - push + pull_request: + push: + schedule: + - cron: '0 0 * * *' name: build diff --git a/.github/workflows/dependency.yml b/.github/workflows/dependency.yml index d3f7a985b..f44e8c5de 100644 --- a/.github/workflows/dependency.yml +++ b/.github/workflows/dependency.yml @@ -1,6 +1,8 @@ on: - - pull_request - - push + pull_request: + push: + schedule: + - cron: '0 0 * * *' name: dependency checker diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 6d2ee4b09..c32a1869f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -1,6 +1,8 @@ on: - - pull_request - - push + pull_request: + push: + schedule: + - cron: '0 0 * * *' name: static analysis diff --git a/config/packages/dist.lock b/config/packages/dist.lock new file mode 100644 index 000000000..475946596 --- /dev/null +++ b/config/packages/dist.lock @@ -0,0 +1,156 @@ +{ + "yiisoft/aliases": { + "version": "2.0.0", + "params.php": "438593225862690b00d87fbccaa99bf8", + "common.php": "1c3045e19fad0f6a45dbeb59136c4144" + }, + "yiisoft/assets": { + "version": "1.0.0", + "params.php": "b2a8c65beb1d47653683536471665231", + "web.php": "e77af09d154e27f85f2f72fb4f2da448" + }, + "yiisoft/cache": { + "version": "1.0.1", + "common.php": "46175aab966be00c21b0d8424fab2f30" + }, + "yiisoft/cache-file": { + "version": "1.0.1", + "common.php": "cab74307fa6d3af175dae285be910a47", + "params.php": "c60b7d1813b3dde2a43e433f8d6fed5a" + }, + "yiisoft/csrf": { + "version": "1.0.2", + "params.php": "25b272f2729f9d5e85c930d1bf64f1ed", + "web.php": "2b6cc33099a25d6414d8c1198f07e0e1" + }, + "yiisoft/data-response": { + "version": "1.0.0", + "web.php": "37abfd4390e1a4db8622b3fe476a4705" + }, + "yiisoft/error-handler": { + "version": "1.0.0", + "web.php": "e6f389ca4fc59c9acaf87a05794d39e3" + }, + "yiisoft/log": { + "version": "1.0.2", + "events-console.php": "dba155a1e9ddff313d6899eebe684799", + "events-web.php": "550b5ab87519380102e93143cee95913" + }, + "yiisoft/log-target-file": { + "version": "1.0.3", + "common.php": "a0a485940ce6f720b44264901a71d0c6", + "params.php": "16e4ea41a7d8964fff91d711bc5bb173" + }, + "yiisoft/mailer-swiftmailer": { + "version": "1.0.0", + "params.php": "ad25e7c8fd1c1934646e04d266a776d2", + "common.php": "69b8a8e588214e13ea1c12556fcc03b3" + }, + "yiisoft/middleware-dispatcher": { + "version": "dev-master ffb9446", + "web.php": "06eae76af898d597371ca530ef90d00d" + }, + "yiisoft/profiler": { + "version": "1.0.0", + "common.php": "2123a9974b089ef8f249b8c004a70c8e", + "events-web.php": "4c43138ab4d6bfa896e48e606c362ddc", + "params.php": "d62d1a018bd5504d38a811d24d6ab7e2" + }, + "yiisoft/router": { + "version": "dev-master 694aa09", + "common.php": "9f3ec9233e0ea471e68b0bd6363e2285" + }, + "yiisoft/router-fastroute": { + "version": "dev-master 1af8225", + "params.php": "07d80a035e80e1df4fc59332f0bbf17a", + "common.php": "dec33ba20e36c348e3edeb7d0468e4c1", + "web.php": "beb2272d9b3e8a51c6eab67286c86b74" + }, + "yiisoft/session": { + "version": "1.0.2", + "web.php": "cf8f19353f10ce798ba694941c44a301", + "params.php": "7581377094a3f76d9f1712e3f8dd18b7" + }, + "yiisoft/user": { + "version": "dev-master 5d267ea", + "params.php": "27eea805ad7297566be80d505b7e10e0", + "web.php": "b67dcfcf9a690d301dedfa7ee19935a0" + }, + "yiisoft/validator": { + "version": "dev-master a20a6f4", + "common.php": "49c02d9de47834a2d5141ae9df93d0f3" + }, + "yiisoft/view": { + "version": "1.0.0", + "params.php": "6354581fa1448a07bee0120ed1ac82ae", + "common.php": "2c019d27145a3db34582585935cda2ae", + "web.php": "e0aa4613e5ffa9f4255d8dd8ddcc2902" + }, + "yiisoft/widget": { + "version": "dev-master c5c6e6d", + "bootstrap.php": "726fd077e95280953eb5a1997b966176" + }, + "yiisoft/yii-bootstrap5": { + "version": "dev-master 6db7352", + "params.php": "646952dcbee186196fa986478dc8549f", + "web/field.php": "c443ef2f9d461456542eeb9a5ac18992" + }, + "yiisoft/yii-console": { + "version": "dev-master 4f6ff4b", + "params.php": "3f530a78778873a4e841a8b15fd79097", + "console.php": "b633ce29f1e3a1cb3618e5e213e54987", + "events-console.php": "dbc14d9b634c9319468a203d2ae77c35", + "providers-console.php": "b140cb50c88c8560f2d370c27a9ea541" + }, + "yiisoft/yii-cycle": { + "version": "dev-master 629433d", + "params.php": "0a6447a7d1674b3db7d25a468b1675e8", + "common.php": "f221c2b80d32cb999fdd1b0ab65759ea", + "console.php": "23195136c7f46b4b610ce4489f847bc0", + "events-console.php": "19b16102837aa5b788383dd33cbeafa1", + "providers-web.php": "7209cc28a3d80321515e57371d5b10b1" + }, + "yiisoft/yii-debug": { + "version": "dev-master 9dccc68", + "tests.php": "8cc8cb7f41dece781a14025adab8c428", + "params.php": "616487d4cd1d1b85fc4132764e931881", + "common.php": "7e51f83ad60495a4632efc156c3c9ec2", + "console.php": "7b4623798311e0fb42f5523aa3163d6f", + "web.php": "3864e4e815a9dca22392e8dd47ef8587", + "providers.php": "1516a90d16296c7059c015ec2c0d3ecb", + "events-web.php": "c4f7a8d7b2d44054f7ace6e3e04b98d7", + "events-console.php": "65afe6461b57d0a7c2f5290026132080" + }, + "yiisoft/yii-debug-api": { + "version": "dev-master a14de25", + "params.php": "3191ae09c2919ae6d840123d9ed89ebc", + "web.php": "ab114bc27086bd6d97e468040c48538e", + "routes.php": "a6054c944efb0de196dd21d6b5eb6b4d", + "providers-web.php": "86472aaced83c7e5b3c70bfb0a816e7c" + }, + "yiisoft/yii-debug-viewer": { + "version": "dev-master 65c3753", + "config/web.php": "cba66f44ead38f9bdd008a490d147e78", + "config/params.php": "e453ec0d92612026657f8eda643631d8", + "config/routes.php": "b135e538e70c8e65be2ad2712b1f4cd3" + }, + "yiisoft/yii-event": { + "version": "1.0.0", + "common.php": "c0e82623530c3eefe6896598717052bc", + "console.php": "95dec8db5406503efb918c1896625e97", + "events.php": "b140cb50c88c8560f2d370c27a9ea541", + "events-web.php": "b140cb50c88c8560f2d370c27a9ea541", + "events-console.php": "b140cb50c88c8560f2d370c27a9ea541", + "web.php": "7b30a1ef334d708d7df893d10badf134" + }, + "yiisoft/yii-filesystem": { + "version": "dev-master 5ae1b79", + "common.php": "79313c43d01e9b02cffdeadb14bdc25e", + "providers.php": "a9096f5fbb53a068d4125a7801e7e42b" + }, + "yiisoft/yii-view": { + "version": "1.0.0", + "params.php": "7f0dfffdbc1c1ddb026ce038c43caf72", + "web.php": "8d3eda4ddba4e34ac79735e3ec9a56a7" + } +} \ No newline at end of file diff --git a/config/packages/merge_plan.php b/config/packages/merge_plan.php new file mode 100644 index 000000000..bba4cfea5 --- /dev/null +++ b/config/packages/merge_plan.php @@ -0,0 +1,302 @@ + [ + 'bootstrap' => [ + '/' => [ + 'config/bootstrap.php', + ], + 'yiisoft/widget' => [ + 'bootstrap.php', + ], + ], + 'bootstrap-console' => [ + '/' => [ + '$bootstrap', + 'config/bootstrap-console.php', + ], + ], + 'bootstrap-web' => [ + '/' => [ + '$bootstrap', + 'config/bootstrap-web.php', + ], + ], + 'common' => [ + '/' => [ + 'config/common/*.php', + ], + 'yiisoft/cache-file' => [ + 'common.php', + ], + 'yiisoft/log-target-file' => [ + 'common.php', + ], + 'yiisoft/mailer-swiftmailer' => [ + 'common.php', + ], + 'yiisoft/router-fastroute' => [ + 'common.php', + ], + 'yiisoft/yii-cycle' => [ + 'common.php', + ], + 'yiisoft/yii-event' => [ + 'common.php', + ], + 'yiisoft/yii-debug' => [ + 'common.php', + ], + 'yiisoft/profiler' => [ + 'common.php', + ], + 'yiisoft/yii-filesystem' => [ + 'common.php', + ], + 'yiisoft/aliases' => [ + 'common.php', + ], + 'yiisoft/cache' => [ + 'common.php', + ], + 'yiisoft/validator' => [ + 'common.php', + ], + 'yiisoft/view' => [ + 'common.php', + ], + 'yiisoft/router' => [ + 'common.php', + ], + ], + 'console' => [ + '/' => [ + '$common', + 'config/console/*.php', + ], + 'yiisoft/yii-cycle' => [ + 'console.php', + ], + 'yiisoft/yii-console' => [ + 'console.php', + ], + 'yiisoft/yii-event' => [ + 'console.php', + ], + 'yiisoft/yii-debug' => [ + 'console.php', + ], + ], + 'events' => [ + '/' => [ + 'config/events.php', + ], + 'yiisoft/yii-event' => [ + 'events.php', + ], + ], + 'events-console' => [ + '/' => [ + '$events', + 'config/events-console.php', + ], + 'yiisoft/yii-cycle' => [ + 'events-console.php', + ], + 'yiisoft/log' => [ + 'events-console.php', + ], + 'yiisoft/yii-console' => [ + 'events-console.php', + ], + 'yiisoft/yii-event' => [ + '$events', + 'events-console.php', + ], + 'yiisoft/yii-debug' => [ + 'events-console.php', + ], + ], + 'events-web' => [ + '/' => [ + '$events', + 'config/events-web.php', + ], + 'yiisoft/log' => [ + 'events-web.php', + ], + 'yiisoft/yii-event' => [ + '$events', + 'events-web.php', + ], + 'yiisoft/yii-debug' => [ + 'events-web.php', + ], + 'yiisoft/profiler' => [ + 'events-web.php', + ], + ], + 'params' => [ + '/' => [ + 'config/params.php', + '?config/params-local.php', + ], + 'yiisoft/cache-file' => [ + 'params.php', + ], + 'yiisoft/log-target-file' => [ + 'params.php', + ], + 'yiisoft/mailer-swiftmailer' => [ + 'params.php', + ], + 'yiisoft/router-fastroute' => [ + 'params.php', + ], + 'yiisoft/user' => [ + 'params.php', + ], + 'yiisoft/yii-bootstrap5' => [ + 'params.php', + ], + 'yiisoft/yii-cycle' => [ + 'params.php', + ], + 'yiisoft/yii-debug-api' => [ + 'params.php', + ], + 'yiisoft/yii-debug-viewer' => [ + 'config/params.php', + ], + 'yiisoft/assets' => [ + 'params.php', + ], + 'yiisoft/session' => [ + 'params.php', + ], + 'yiisoft/yii-console' => [ + 'params.php', + ], + 'yiisoft/yii-debug' => [ + 'params.php', + ], + 'yiisoft/profiler' => [ + 'params.php', + ], + 'yiisoft/yii-view' => [ + 'params.php', + ], + 'yiisoft/aliases' => [ + 'params.php', + ], + 'yiisoft/csrf' => [ + 'params.php', + ], + 'yiisoft/view' => [ + 'params.php', + ], + ], + 'providers' => [ + '/' => [ + 'config/providers.php', + ], + 'yiisoft/yii-debug' => [ + 'providers.php', + ], + 'yiisoft/yii-filesystem' => [ + 'providers.php', + ], + ], + 'providers-console' => [ + '/' => [ + '$providers', + 'config/providers-console.php', + ], + 'yiisoft/yii-console' => [ + 'providers-console.php', + ], + ], + 'providers-web' => [ + '/' => [ + '$providers', + 'config/providers-web.php', + ], + 'yiisoft/yii-cycle' => [ + 'providers-web.php', + ], + 'yiisoft/yii-debug-api' => [ + 'providers-web.php', + ], + ], + 'routes' => [ + '/' => [ + 'config/routes.php', + ], + 'yiisoft/yii-debug-api' => [ + 'routes.php', + ], + 'yiisoft/yii-debug-viewer' => [ + 'config/routes.php', + ], + ], + 'tests' => [ + 'yiisoft/yii-debug' => [ + 'tests.php', + ], + ], + 'web' => [ + '/' => [ + '$common', + 'config/web/*.php', + ], + 'yiisoft/error-handler' => [ + 'web.php', + ], + 'yiisoft/router-fastroute' => [ + 'web.php', + ], + 'yiisoft/user' => [ + 'web.php', + ], + 'yiisoft/yii-bootstrap5' => [ + 'web/*.php', + ], + 'yiisoft/yii-debug-api' => [ + 'web.php', + ], + 'yiisoft/yii-debug-viewer' => [ + 'config/web.php', + ], + 'yiisoft/assets' => [ + 'web.php', + ], + 'yiisoft/session' => [ + 'web.php', + ], + 'yiisoft/yii-event' => [ + 'web.php', + ], + 'yiisoft/yii-debug' => [ + 'web.php', + ], + 'yiisoft/yii-view' => [ + 'web.php', + ], + 'yiisoft/csrf' => [ + 'web.php', + ], + 'yiisoft/data-response' => [ + 'web.php', + ], + 'yiisoft/view' => [ + 'web.php', + ], + 'yiisoft/middleware-dispatcher' => [ + 'web.php', + ], + ], + ], +]; diff --git a/config/packages/yiisoft/aliases/common.php b/config/packages/yiisoft/aliases/common.php new file mode 100644 index 000000000..0a59ae6c7 --- /dev/null +++ b/config/packages/yiisoft/aliases/common.php @@ -0,0 +1,14 @@ + [ + 'class' => Aliases::class, + '__construct()' => [$params['yiisoft/aliases']['aliases']], + ], +]; diff --git a/config/packages/yiisoft/aliases/params.php b/config/packages/yiisoft/aliases/params.php new file mode 100644 index 000000000..10b0bf365 --- /dev/null +++ b/config/packages/yiisoft/aliases/params.php @@ -0,0 +1,9 @@ + [ + 'aliases' => [], + ], +]; diff --git a/config/packages/yiisoft/assets/params.php b/config/packages/yiisoft/assets/params.php new file mode 100644 index 000000000..5bebdf88d --- /dev/null +++ b/config/packages/yiisoft/assets/params.php @@ -0,0 +1,29 @@ + [ + 'assetConverter' => [ + 'commands' => [ + 'scss' => ['css', '@npm/.bin/sass {options} {from} {to}'], + ], + 'forceConvert' => false, + ], + 'assetLoader' => [ + 'appendTimestamp' => false, + 'assetMap' => [], + 'basePath' => null, + 'baseUrl' => null, + ], + 'assetPublisher' => [ + 'forceCopy' => false, + 'linkAssets' => false, + ], + 'assetManager' => [ + 'allowedBundleNames' => [], + 'customizedBundles' => [], + 'register' => [], + ], + ], +]; diff --git a/config/packages/yiisoft/assets/web.php b/config/packages/yiisoft/assets/web.php new file mode 100644 index 000000000..78af831a4 --- /dev/null +++ b/config/packages/yiisoft/assets/web.php @@ -0,0 +1,66 @@ + [ + 'class' => AssetConverter::class, + '__construct()' => [ + Reference::to(Aliases::class), + Reference::to(LoggerInterface::class), + $params['yiisoft/assets']['assetConverter']['commands'], + $params['yiisoft/assets']['assetConverter']['forceConvert'], + ], + ], + + AssetLoaderInterface::class => [ + 'class' => AssetLoader::class, + '__construct()' => [ + Reference::to(Aliases::class), + $params['yiisoft/assets']['assetLoader']['appendTimestamp'], + $params['yiisoft/assets']['assetLoader']['assetMap'], + $params['yiisoft/assets']['assetLoader']['basePath'], + $params['yiisoft/assets']['assetLoader']['baseUrl'], + ], + ], + + AssetPublisherInterface::class => [ + 'class' => AssetPublisher::class, + '__construct()' => [ + Reference::to(Aliases::class), + $params['yiisoft/assets']['assetPublisher']['forceCopy'], + $params['yiisoft/assets']['assetPublisher']['linkAssets'], + ], + ], + + AssetManager::class => static function (ContainerInterface $container) use ($params): AssetManager { + $assetManager = new AssetManager( + $container->get(Aliases::class), + $container->get(AssetLoaderInterface::class), + $params['yiisoft/assets']['assetManager']['allowedBundleNames'], + $params['yiisoft/assets']['assetManager']['customizedBundles'], + ); + + $assetManager = $assetManager + ->withConverter($container->get(AssetConverterInterface::class)) + ->withPublisher($container->get(AssetPublisherInterface::class)) + ; + + $assetManager->register($params['yiisoft/assets']['assetManager']['register']); + return $assetManager; + }, +]; diff --git a/config/packages/yiisoft/cache-file/common.php b/config/packages/yiisoft/cache-file/common.php new file mode 100644 index 000000000..a91c0a42c --- /dev/null +++ b/config/packages/yiisoft/cache-file/common.php @@ -0,0 +1,14 @@ + static fn (Aliases $aliases) => new FileCache( + $aliases->get($params['yiisoft/cache-file']['fileCache']['path']) + ), +]; diff --git a/config/packages/yiisoft/cache-file/params.php b/config/packages/yiisoft/cache-file/params.php new file mode 100644 index 000000000..997fb453a --- /dev/null +++ b/config/packages/yiisoft/cache-file/params.php @@ -0,0 +1,11 @@ + [ + 'fileCache' => [ + 'path' => '@runtime/cache', + ], + ], +]; diff --git a/config/packages/yiisoft/csrf/params.php b/config/packages/yiisoft/csrf/params.php new file mode 100644 index 000000000..815a6e9fb --- /dev/null +++ b/config/packages/yiisoft/csrf/params.php @@ -0,0 +1,13 @@ + [ + 'hmacToken' => [ + 'secretKey' => '', + 'algorithm' => 'sha256', + 'lifetime' => null, + ], + ], +]; diff --git a/config/packages/yiisoft/csrf/web.php b/config/packages/yiisoft/csrf/web.php new file mode 100644 index 000000000..0d6a7897a --- /dev/null +++ b/config/packages/yiisoft/csrf/web.php @@ -0,0 +1,39 @@ + [ + 'class' => MaskedCsrfToken::class, + '__construct()' => [ + 'token' => Reference::to(SynchronizerCsrfToken::class), + ], + ], + + SynchronizerCsrfToken::class => [ + '__construct()' => [ + 'generator' => Reference::to(RandomCsrfTokenGenerator::class), + 'storage' => Reference::to(SessionCsrfTokenStorage::class), + ], + ], + + HmacCsrfToken::class => [ + '__construct()' => [ + 'identityGenerator' => Reference::to(SessionCsrfTokenIdentityGenerator::class), + 'secretKey' => $params['yiisoft/csrf']['hmacToken']['secretKey'], + 'algorithm' => $params['yiisoft/csrf']['hmacToken']['algorithm'], + 'lifetime' => $params['yiisoft/csrf']['hmacToken']['lifetime'], + ], + ], +]; diff --git a/config/packages/yiisoft/data-response/web.php b/config/packages/yiisoft/data-response/web.php new file mode 100644 index 000000000..b2f19d895 --- /dev/null +++ b/config/packages/yiisoft/data-response/web.php @@ -0,0 +1,27 @@ + HtmlDataResponseFormatter::class, + DataResponseFactoryInterface::class => DataResponseFactory::class, + ContentNegotiator::class => [ + '__construct()' => [ + 'contentFormatters' => [ + 'text/html' => new HtmlDataResponseFormatter(), + 'application/xml' => new XmlDataResponseFormatter(), + 'application/json' => new JsonDataResponseFormatter(), + ], + ], + ], +]; diff --git a/config/packages/yiisoft/error-handler/web.php b/config/packages/yiisoft/error-handler/web.php new file mode 100644 index 000000000..c0f814fff --- /dev/null +++ b/config/packages/yiisoft/error-handler/web.php @@ -0,0 +1,14 @@ + HtmlRenderer::class, +]; diff --git a/config/packages/yiisoft/log-target-file/common.php b/config/packages/yiisoft/log-target-file/common.php new file mode 100644 index 000000000..2b7e9bbf5 --- /dev/null +++ b/config/packages/yiisoft/log-target-file/common.php @@ -0,0 +1,40 @@ + static fn (FileTarget $fileTarget) => new Logger([$fileTarget]), + + FileRotatorInterface::class => [ + 'class' => FileRotator::class, + '__construct()' => [ + $params['yiisoft/log-target-file']['fileRotator']['maxFileSize'], + $params['yiisoft/log-target-file']['fileRotator']['maxFiles'], + $params['yiisoft/log-target-file']['fileRotator']['fileMode'], + $params['yiisoft/log-target-file']['fileRotator']['rotateByCopy'], + $params['yiisoft/log-target-file']['fileRotator']['compressRotatedFiles'], + ], + ], + + FileTarget::class => static function (Aliases $aliases, FileRotatorInterface $fileRotator) use ($params) { + $fileTarget = new FileTarget( + $aliases->get($params['yiisoft/log-target-file']['fileTarget']['file']), + $fileRotator, + $params['yiisoft/log-target-file']['fileTarget']['dirMode'], + $params['yiisoft/log-target-file']['fileTarget']['fileMode'], + ); + + $fileTarget->setLevels($params['yiisoft/log-target-file']['fileTarget']['levels']); + + return $fileTarget; + }, +]; diff --git a/config/packages/yiisoft/log-target-file/params.php b/config/packages/yiisoft/log-target-file/params.php new file mode 100644 index 000000000..717a96764 --- /dev/null +++ b/config/packages/yiisoft/log-target-file/params.php @@ -0,0 +1,29 @@ + [ + 'fileTarget' => [ + 'file' => '@runtime/logs/app.log', + 'levels' => [ + LogLevel::EMERGENCY, + LogLevel::ERROR, + LogLevel::WARNING, + LogLevel::INFO, + LogLevel::DEBUG, + ], + 'dirMode' => 0755, + 'fileMode' => null, + ], + 'fileRotator' => [ + 'maxFileSize' => 10240, + 'maxFiles' => 5, + 'fileMode' => null, + 'rotateByCopy' => null, + 'compressRotatedFiles' => false, + ], + ], +]; diff --git a/config/packages/yiisoft/log/events-console.php b/config/packages/yiisoft/log/events-console.php new file mode 100644 index 000000000..d8078ccbc --- /dev/null +++ b/config/packages/yiisoft/log/events-console.php @@ -0,0 +1,17 @@ + [ + static function (LoggerInterface $logger): void { + if ($logger instanceof Logger) { + $logger->flush(true); + } + }, + ], +]; diff --git a/config/packages/yiisoft/log/events-web.php b/config/packages/yiisoft/log/events-web.php new file mode 100644 index 000000000..1725c7d99 --- /dev/null +++ b/config/packages/yiisoft/log/events-web.php @@ -0,0 +1,17 @@ + [ + static function (LoggerInterface $logger): void { + if ($logger instanceof Logger) { + $logger->flush(true); + } + }, + ], +]; diff --git a/config/packages/yiisoft/mailer-swiftmailer/common.php b/config/packages/yiisoft/mailer-swiftmailer/common.php new file mode 100644 index 000000000..59e9d2d6e --- /dev/null +++ b/config/packages/yiisoft/mailer-swiftmailer/common.php @@ -0,0 +1,63 @@ + [ + 'class' => MessageBodyRenderer::class, + '__construct()' => [ + Reference::to(View::class), + DynamicReference::to(static fn (Aliases $aliases) => new MessageBodyTemplate( + $aliases->get($params['yiisoft/mailer']['messageBodyTemplate']['viewPath']), + )), + ], + ], + + MessageFactoryInterface::class => [ + 'class' => MessageFactory::class, + '__construct()' => [ + Message::class, + ], + ], + + Swift_SmtpTransport::class => [ + 'class' => Swift_SmtpTransport::class, + '__construct()' => [ + $params['swiftmailer/swiftmailer']['SwiftSmtpTransport']['host'], + $params['swiftmailer/swiftmailer']['SwiftSmtpTransport']['port'], + $params['swiftmailer/swiftmailer']['SwiftSmtpTransport']['encryption'], + ], + 'setUsername()' => [$params['swiftmailer/swiftmailer']['SwiftSmtpTransport']['username']], + 'setPassword()' => [$params['swiftmailer/swiftmailer']['SwiftSmtpTransport']['password']], + ], + + Swift_Transport::class => $params['yiisoft/mailer']['useSendmail'] + ? Swift_SendmailTransport::class : Swift_SmtpTransport::class, + + FileMailer::class => [ + 'class' => FileMailer::class, + '__construct()' => [ + 'path' => DynamicReference::to(fn (Aliases $aliases) => $aliases->get( + $params['yiisoft/mailer']['fileMailer']['fileMailerStorage'] + )), + ], + ], + + MailerInterface::class => $params['yiisoft/mailer']['writeToFiles'] + ? FileMailer::class : Mailer::class, +]; diff --git a/config/packages/yiisoft/mailer-swiftmailer/params.php b/config/packages/yiisoft/mailer-swiftmailer/params.php new file mode 100644 index 000000000..44dfd39a6 --- /dev/null +++ b/config/packages/yiisoft/mailer-swiftmailer/params.php @@ -0,0 +1,25 @@ + [ + 'messageBodyTemplate' => [ + 'viewPath' => '@resources/mail', + ], + 'fileMailer' => [ + 'fileMailerStorage' => '@runtime/mail', + ], + 'useSendmail' => false, + 'writeToFiles' => true, + ], + 'swiftmailer/swiftmailer' => [ + 'SwiftSmtpTransport' => [ + 'host' => 'smtp.example.com', + 'port' => 25, + 'encryption' => null, + 'username' => 'admin@example.com', + 'password' => '', + ], + ], +]; diff --git a/config/packages/yiisoft/middleware-dispatcher/web.php b/config/packages/yiisoft/middleware-dispatcher/web.php new file mode 100644 index 000000000..82ad43ad4 --- /dev/null +++ b/config/packages/yiisoft/middleware-dispatcher/web.php @@ -0,0 +1,10 @@ + MiddlewareFactory::class, +]; diff --git a/config/packages/yiisoft/profiler/events-web.php b/config/packages/yiisoft/profiler/events-web.php new file mode 100644 index 000000000..2ee3f748d --- /dev/null +++ b/config/packages/yiisoft/profiler/events-web.php @@ -0,0 +1,12 @@ + [ + [ProfilerInterface::class, 'flush'], + ], +]; diff --git a/config/packages/yiisoft/profiler/params.php b/config/packages/yiisoft/profiler/params.php new file mode 100644 index 000000000..dcda425d2 --- /dev/null +++ b/config/packages/yiisoft/profiler/params.php @@ -0,0 +1,28 @@ + [ + 'targets' => [ + LogTarget::class => [ + 'include' => [], + 'exclude' => [], + 'enabled' => true, + 'level' => LogLevel::DEBUG, + ], + FileTarget::class => [ + 'include' => [], + 'exclude' => [], + 'enabled' => false, + 'requestBeginTime' => $_SERVER['REQUEST_TIME_FLOAT'], + 'filename' => '@runtime/profiling/{date}-{time}.txt', + 'directoryMode' => 0775, + ], + ], + ], +]; diff --git a/config/packages/yiisoft/router-fastroute/common.php b/config/packages/yiisoft/router-fastroute/common.php new file mode 100644 index 000000000..09430d083 --- /dev/null +++ b/config/packages/yiisoft/router-fastroute/common.php @@ -0,0 +1,13 @@ + [ + 'class' => UrlGenerator::class, + 'setEncodeRaw()' => [$params['yiisoft/router-fastroute']['encodeRaw']], + ], +]; diff --git a/config/packages/yiisoft/router-fastroute/web.php b/config/packages/yiisoft/router-fastroute/web.php new file mode 100644 index 000000000..0069b5414 --- /dev/null +++ b/config/packages/yiisoft/router-fastroute/web.php @@ -0,0 +1,21 @@ + static function (Injector $injector) use ($params) { + $enableCache = $params['yiisoft/router-fastroute']['enableCache'] ?? true; + + $arguments = []; + if ($enableCache === false) { + $arguments['cache'] = null; + } + return $injector->make(UrlMatcher::class, $arguments); + }, +]; diff --git a/config/packages/yiisoft/router/common.php b/config/packages/yiisoft/router/common.php new file mode 100644 index 000000000..1cd0eab84 --- /dev/null +++ b/config/packages/yiisoft/router/common.php @@ -0,0 +1,12 @@ + RouteCollector::class, + CurrentRoute::class => CurrentRoute::class, +]; diff --git a/config/packages/yiisoft/session/params.php b/config/packages/yiisoft/session/params.php new file mode 100644 index 000000000..ace955087 --- /dev/null +++ b/config/packages/yiisoft/session/params.php @@ -0,0 +1,12 @@ + [ + 'session' => [ + 'options' => ['cookie_secure' => 0], + 'handler' => null, + ], + ], +]; diff --git a/config/packages/yiisoft/session/web.php b/config/packages/yiisoft/session/web.php new file mode 100644 index 000000000..5fe8f92bd --- /dev/null +++ b/config/packages/yiisoft/session/web.php @@ -0,0 +1,21 @@ + [ + 'class' => Session::class, + '__construct()' => [ + $params['yiisoft/session']['session']['options'], + $params['yiisoft/session']['session']['handler'], + ], + ], + FlashInterface::class => Flash::class, +]; diff --git a/config/packages/yiisoft/user/params.php b/config/packages/yiisoft/user/params.php new file mode 100644 index 000000000..3338df3ad --- /dev/null +++ b/config/packages/yiisoft/user/params.php @@ -0,0 +1,13 @@ + [ + 'authUrl' => '/login', + 'cookieLogin' => [ + 'addCookie' => false, + 'duration' => 'P5D', // 5 days, see format on http://php.net/manual/dateinterval.construct.php + ], + ], +]; diff --git a/config/packages/yiisoft/user/web.php b/config/packages/yiisoft/user/web.php new file mode 100644 index 000000000..f04c686f7 --- /dev/null +++ b/config/packages/yiisoft/user/web.php @@ -0,0 +1,31 @@ + [ + 'class' => UserAuth::class, + 'withAuthUrl()' => [$params['yiisoft/user']['authUrl']], + ], + + AuthenticationMethodInterface::class => UserAuth::class, + + CookieLoginMiddleware::class => [ + '__construct()' => [ + 'addCookie' => $params['yiisoft/user']['cookieLogin']['addCookie'], + ], + ], + + CookieLogin::class => [ + '__construct()' => [ + 'duration' => new \DateInterval($params['yiisoft/user']['cookieLogin']['duration']), + ], + ], +]; diff --git a/config/packages/yiisoft/validator/common.php b/config/packages/yiisoft/validator/common.php new file mode 100644 index 000000000..021cc8228 --- /dev/null +++ b/config/packages/yiisoft/validator/common.php @@ -0,0 +1,15 @@ + Validator::class, + FormatterInterface::class => Formatter::class, +]; diff --git a/config/packages/yiisoft/view/common.php b/config/packages/yiisoft/view/common.php new file mode 100644 index 000000000..b52999522 --- /dev/null +++ b/config/packages/yiisoft/view/common.php @@ -0,0 +1,24 @@ + [ + 'class' => View::class, + '__construct()' => [ + 'basePath' => DynamicReference::to(static fn (Aliases $aliases) => $aliases->get($params['yiisoft/view']['basePath'])), + ], + 'setCommonParameters()' => [ + $params['yiisoft/view']['commonParameters'], + ], + 'reset' => function () { + $this->clear(); + }, + ], +]; diff --git a/config/packages/yiisoft/view/web.php b/config/packages/yiisoft/view/web.php new file mode 100644 index 000000000..44b41755a --- /dev/null +++ b/config/packages/yiisoft/view/web.php @@ -0,0 +1,39 @@ + static function (Aliases $aliases) use ($params) { + $pathMap = []; + + foreach ($params['yiisoft/view']['theme']['pathMap'] as $key => $value) { + $pathMap[$aliases->get($key)] = $aliases->get($value); + } + + return new Theme( + $pathMap, + $params['yiisoft/view']['theme']['basePath'], + $params['yiisoft/view']['theme']['baseUrl'] + ); + }, + + WebView::class => [ + 'class' => WebView::class, + '__construct()' => [ + 'basePath' => DynamicReference::to(static fn (Aliases $aliases) => $aliases->get($params['yiisoft/view']['basePath'])), + ], + 'setCommonParameters()' => [ + $params['yiisoft/view']['commonParameters'], + ], + 'reset' => function () { + $this->clear(); + }, + ], +]; diff --git a/config/packages/yiisoft/widget/bootstrap.php b/config/packages/yiisoft/widget/bootstrap.php new file mode 100644 index 000000000..8127f6116 --- /dev/null +++ b/config/packages/yiisoft/widget/bootstrap.php @@ -0,0 +1,12 @@ + [ + 'bootstrap5' => [ + 'enabled' => true, + 'fieldConfig' => [ + 'enclosedByContainer()' => [true, ['class' => 'mb-3']], + 'errorCssClass()' => ['is-invalid'], + 'errorOptions()' => [['class' => 'text-danger fst-italic']], + 'hintOptions()' => [['class' => 'form-text']], + 'inputCssClass()' => ['form-control'], + 'labelOptions()' => [['class' => 'form-label']], + 'successCssClass()' => ['is-valid'], + ], + ], + ], +]; diff --git a/config/packages/yiisoft/yii-console/console.php b/config/packages/yiisoft/yii-console/console.php new file mode 100644 index 000000000..dfed2bd66 --- /dev/null +++ b/config/packages/yiisoft/yii-console/console.php @@ -0,0 +1,38 @@ + [ + 'class' => CommandLoader::class, + '__construct()' => [ + 'commandMap' => $params['yiisoft/yii-console']['commands'], + ], + ], + + Application::class => [ + 'class' => Application::class, + 'setDispatcher()' => [Reference::to(SymfonyEventDispatcher::class)], + 'setCommandLoader()' => [Reference::to(CommandLoaderInterface::class)], + 'addOptions()' => [ + new InputOption( + 'config', + null, + InputOption::VALUE_REQUIRED, + 'Set alternative configuration name' + ), + ], + 'setName()' => [$params['yiisoft/yii-console']['name']], + 'setVersion()' => [$params['yiisoft/yii-console']['version']], + 'setAutoExit()' => [$params['yiisoft/yii-console']['autoExit']], + ], +]; diff --git a/config/packages/yiisoft/yii-console/events-console.php b/config/packages/yiisoft/yii-console/events-console.php new file mode 100644 index 000000000..df1b41273 --- /dev/null +++ b/config/packages/yiisoft/yii-console/events-console.php @@ -0,0 +1,12 @@ + [ + [ErrorListener::class, 'onError'], + ], +]; diff --git a/config/packages/yiisoft/yii-console/providers-console.php b/config/packages/yiisoft/yii-console/providers-console.php new file mode 100644 index 000000000..0dae23dee --- /dev/null +++ b/config/packages/yiisoft/yii-console/providers-console.php @@ -0,0 +1,5 @@ + new DbalFactory($params['yiisoft/yii-cycle']['dbal']), + DatabaseProviderInterface::class => static function (ContainerInterface $container) { + return $container->get(DatabaseManager::class); + }, + // Cycle ORM + ORMInterface::class => new OrmFactory($params['yiisoft/yii-cycle']['orm-promise-factory']), + // Spiral Core Factory + SpiralFactoryInterface::class => static function (ContainerInterface $container) { + return new CycleDynamicFactory($container->get(Injector::class)); + }, + // Factory for Cycle ORM + CycleFactoryInterface::class => static function (ContainerInterface $container) { + return new Factory( + $container->get(DatabaseManager::class), + null, + $container->get(SpiralFactoryInterface::class), + $container + ); + }, + // Schema provider + SchemaProviderInterface::class => static function (ContainerInterface $container) use (&$params) { + return (new SchemaProviderPipeline($container))->withConfig($params['yiisoft/yii-cycle']['schema-providers']); + }, + // Schema + SchemaInterface::class => static function (ContainerInterface $container) { + $schema = $container->get(SchemaProviderInterface::class)->read(); + if ($schema === null) { + throw new SchemaWasNotProvidedException(); + } + return new Schema($schema); + }, + // Annotated Schema Conveyor + SchemaConveyorInterface::class => static function (ContainerInterface $container) use (&$params) { + $conveyor = new AnnotatedSchemaConveyor($container); + $conveyor->addEntityPaths($params['yiisoft/yii-cycle']['annotated-entity-paths']); + return $conveyor; + }, +]; diff --git a/config/packages/yiisoft/yii-cycle/console.php b/config/packages/yiisoft/yii-cycle/console.php new file mode 100644 index 000000000..5748accaf --- /dev/null +++ b/config/packages/yiisoft/yii-cycle/console.php @@ -0,0 +1,22 @@ + new MigratorFactory(), + MigrationConfig::class => new MigrationConfigFactory($params['yiisoft/yii-cycle']['migrations']), + CycleDependencyProxy::class => static function (ContainerInterface $container) { + return new CycleDependencyProxy($container); + }, +]; diff --git a/config/packages/yiisoft/yii-cycle/events-console.php b/config/packages/yiisoft/yii-cycle/events-console.php new file mode 100644 index 000000000..f6c23808f --- /dev/null +++ b/config/packages/yiisoft/yii-cycle/events-console.php @@ -0,0 +1,12 @@ + [ + [MigrationListener::class, 'onAfterMigrate'], + ], +]; diff --git a/config/packages/yiisoft/yii-cycle/providers-web.php b/config/packages/yiisoft/yii-cycle/providers-web.php new file mode 100644 index 000000000..bf51d320e --- /dev/null +++ b/config/packages/yiisoft/yii-cycle/providers-web.php @@ -0,0 +1,7 @@ + \Yiisoft\Yii\Cycle\Factory\RepositoryProvider::class, +]; diff --git a/config/packages/yiisoft/yii-debug-api/providers-web.php b/config/packages/yiisoft/yii-debug-api/providers-web.php new file mode 100644 index 000000000..fb6f88215 --- /dev/null +++ b/config/packages/yiisoft/yii-debug-api/providers-web.php @@ -0,0 +1,13 @@ + DebugApiProvider::class, +]; diff --git a/config/packages/yiisoft/yii-debug-api/routes.php b/config/packages/yiisoft/yii-debug-api/routes.php new file mode 100644 index 000000000..a7e331b66 --- /dev/null +++ b/config/packages/yiisoft/yii-debug-api/routes.php @@ -0,0 +1,50 @@ +middleware(CorsMiddleware::class) + ->middleware( + static function (ResponseFactoryInterface $responseFactory) use ($params) { + return new IpFilter( + Ip::rule()->ranges($params['yiisoft/yii-debug-api']['allowedIPs']), + $responseFactory + ); + } + ) + ->middleware(FormatDataResponseAsJson::class) + ->middleware(ResponseDataWrapper::class) + ->routes( + Route::methods([Method::GET, Method::OPTIONS], '[/]') + ->action([DebugController::class, 'index']) + ->name('debug/index'), + Route::methods([Method::GET, Method::OPTIONS], '/summary/{id}') + ->action([DebugController::class, 'summary']) + ->name('debug/summary'), + Route::methods([Method::GET, Method::OPTIONS], '/view/{id}[/{collector}]') + ->action([DebugController::class, 'view']) + ->name('debug/view'), + Route::methods([Method::GET, Method::OPTIONS], '/dump/{id}[/{collector}]') + ->action([DebugController::class, 'dump']) + ->name('debug/dump'), + Route::methods([Method::GET, Method::OPTIONS], '/object/{id}/{objectId}') + ->action([DebugController::class, 'object']) + ->name('debug/object') + ), +]; diff --git a/config/packages/yiisoft/yii-debug-api/web.php b/config/packages/yiisoft/yii-debug-api/web.php new file mode 100644 index 000000000..771b92dc8 --- /dev/null +++ b/config/packages/yiisoft/yii-debug-api/web.php @@ -0,0 +1,15 @@ + static fn (StorageInterface $storage) => new CollectorRepository($storage), +]; diff --git a/config/packages/yiisoft/yii-debug-viewer/config/params.php b/config/packages/yiisoft/yii-debug-viewer/config/params.php new file mode 100644 index 000000000..04649a093 --- /dev/null +++ b/config/packages/yiisoft/yii-debug-viewer/config/params.php @@ -0,0 +1,31 @@ + [ + 'targetHost' => '/', + 'panels' => [ + 'panel-info' => [ + 'name' => 'Info', + 'route' => '/debug/panels/info' + ], + 'panel-routes' => [ + 'name' => 'Routes', + 'route' => '/debug/panels/routes' + ], + 'panel-logs' => [ + 'name' => 'Logs', + 'route' => '/debug/panels/logs' + ], + 'panel-events' => [ + 'name' => 'Events', + 'route' => '/debug/panels/events' + ], + 'panel-services' => [ + 'name' => 'Services', + 'route' => '/debug/panels/services' + ], + ], + ], +]; diff --git a/config/packages/yiisoft/yii-debug-viewer/config/routes.php b/config/packages/yiisoft/yii-debug-viewer/config/routes.php new file mode 100644 index 000000000..1bab8e768 --- /dev/null +++ b/config/packages/yiisoft/yii-debug-viewer/config/routes.php @@ -0,0 +1,47 @@ +middleware(FormatDataResponseAsHtml::class) + ->action([IndexController::class, 'index']) + ->name('debug/panels/index'), + Group::create('/debug/panels') + ->middleware(FormatDataResponseAsHtml::class) + ->middleware(CorsMiddleware::class) + ->routes( + Route::get('/config') + ->middleware(FormatDataResponseAsJson::class) + ->action([ConfigController::class, 'index']) + ->name('debug/panels/config'), + Route::get('/info') + ->action([PanelInfoController::class, 'view']) + ->name('debug/panels/info'), + Route::get('/routes') + ->action([PanelRoutesController::class, 'view']) + ->name('debug/panels/routes'), + Route::get('/logs') + ->action([PanelLogsController::class, 'view']) + ->name('debug/panels/logs'), + Route::get('/events') + ->action([PanelEventsController::class, 'view']) + ->name('debug/panels/events'), + Route::get('/services') + ->action([PanelServicesController::class, 'view']) + ->name('debug/panels/services') + ), +]; diff --git a/config/packages/yiisoft/yii-debug-viewer/config/web.php b/config/packages/yiisoft/yii-debug-viewer/config/web.php new file mode 100644 index 000000000..3aba6bef2 --- /dev/null +++ b/config/packages/yiisoft/yii-debug-viewer/config/web.php @@ -0,0 +1,13 @@ + [ + '__construct()' => [$params['yiisoft/yii-debug-viewer']['panels']], + ] +]; diff --git a/config/packages/yiisoft/yii-debug/common.php b/config/packages/yiisoft/yii-debug/common.php new file mode 100644 index 000000000..4de3e0b7f --- /dev/null +++ b/config/packages/yiisoft/yii-debug/common.php @@ -0,0 +1,67 @@ + static function (ContainerInterface $container) use ($params) { + $params = $params['yiisoft/yii-debug']; + $filesystem = $container->get(FilesystemInterface::class); + $debuggerIdGenerator = $container->get(DebuggerIdGenerator::class); + $aliases = $container->get(Aliases::class); + $excludedClasses = $params['dumper.excludedClasses']; + $fileStorage = new FileStorage($params['path'], $filesystem, $debuggerIdGenerator, $aliases, $excludedClasses); + if (isset($params['historySize'])) { + $fileStorage->setHistorySize((int)$params['historySize']); + } + return $fileStorage; + }, +]; + +if (!(bool)($params['yiisoft/yii-debug']['enabled'] ?? false)) { + return $common; +} + +return array_merge([ + LogCollectorInterface::class => LogCollector::class, + EventCollectorInterface::class => EventCollector::class, + RouterCollectorInterface::class => RouterCollector::class, + ServiceCollectorInterface::class => ServiceCollector::class, + ContainerProxyConfig::class => static function (ContainerInterface $container) use ($params) { + $params = $params['yiisoft/yii-debug']; + $collector = $container->get(ServiceCollectorInterface::class); + $dispatcher = $container->get(EventDispatcherInterface::class); + $debuggerEnabled = (bool)($params['enabled'] ?? false); + $trackedServices = (array)($params['trackedServices'] ?? []); + $path = $container->get(Aliases::class)->get('@runtime/cache/container-proxy'); + $logLevel = $params['logLevel'] ?? 0; + return new ContainerProxyConfig( + $debuggerEnabled, + $trackedServices, + $dispatcher, + $collector, + $path, + $logLevel + ); + }, +], $common); diff --git a/config/packages/yiisoft/yii-debug/console.php b/config/packages/yiisoft/yii-debug/console.php new file mode 100644 index 000000000..d7e9b80d7 --- /dev/null +++ b/config/packages/yiisoft/yii-debug/console.php @@ -0,0 +1,26 @@ + static function (ContainerInterface $container) use ($params) { + $params = $params['yiisoft/yii-debug']; + return new Debugger( + $container->get(DebuggerIdGenerator::class), + $container->get(StorageInterface::class), + array_map( + static fn ($class) => $container->get($class), + array_merge($params['collectors'], $params['collectors.console'] ?? []) + ) + ); + }, +]; diff --git a/config/packages/yiisoft/yii-debug/events-console.php b/config/packages/yiisoft/yii-debug/events-console.php new file mode 100644 index 000000000..67bc2e792 --- /dev/null +++ b/config/packages/yiisoft/yii-debug/events-console.php @@ -0,0 +1,36 @@ + [ + [Debugger::class, 'startup'], + [ConsoleAppInfoCollector::class, 'collect'], + ], + ApplicationShutdown::class => [ + [ConsoleAppInfoCollector::class, 'collect'], + [Debugger::class, 'shutdown'], + ], + ConsoleCommandEvent::class => [ + [CommandCollector::class, 'collect'], + ], + ConsoleErrorEvent::class => [ + [CommandCollector::class, 'collect'], + ], + ConsoleTerminateEvent::class => [ + [CommandCollector::class, 'collect'], + ], +]; diff --git a/config/packages/yiisoft/yii-debug/events-web.php b/config/packages/yiisoft/yii-debug/events-web.php new file mode 100644 index 000000000..6fd6e84b0 --- /dev/null +++ b/config/packages/yiisoft/yii-debug/events-web.php @@ -0,0 +1,49 @@ + [ + [WebAppInfoCollector::class, 'collect'], + ], + ApplicationShutdown::class => [ + [WebAppInfoCollector::class, 'collect'], + ], + BeforeRequest::class => [ + [Debugger::class, 'startup'], + [WebAppInfoCollector::class, 'collect'], + [RequestCollector::class, 'collect'], + ], + AfterRequest::class => [ + [WebAppInfoCollector::class, 'collect'], + [RequestCollector::class, 'collect'], + ], + AfterEmit::class => [ + [ProfilerInterface::class, 'flush'], + [WebAppInfoCollector::class, 'collect'], + [Debugger::class, 'shutdown'], + ], + BeforeMiddleware::class => [ + [MiddlewareCollector::class, 'collect'], + ], + AfterMiddleware::class => [ + [MiddlewareCollector::class, 'collect'], + ], +]; diff --git a/config/packages/yiisoft/yii-debug/providers.php b/config/packages/yiisoft/yii-debug/providers.php new file mode 100644 index 000000000..589618230 --- /dev/null +++ b/config/packages/yiisoft/yii-debug/providers.php @@ -0,0 +1,13 @@ + ProxyServiceProvider::class, +]; diff --git a/config/packages/yiisoft/yii-debug/tests.php b/config/packages/yiisoft/yii-debug/tests.php new file mode 100644 index 000000000..830d0903a --- /dev/null +++ b/config/packages/yiisoft/yii-debug/tests.php @@ -0,0 +1,10 @@ + MemoryStorage::class, +]; diff --git a/config/packages/yiisoft/yii-debug/web.php b/config/packages/yiisoft/yii-debug/web.php new file mode 100644 index 000000000..872375af0 --- /dev/null +++ b/config/packages/yiisoft/yii-debug/web.php @@ -0,0 +1,27 @@ + static function (ContainerInterface $container) use ($params) { + $params = $params['yiisoft/yii-debug']; + return new Debugger( + $container->get(DebuggerIdGenerator::class), + $container->get(StorageInterface::class), + array_map( + static fn ($class) => $container->get($class), + array_merge($params['collectors'], $params['collectors.web'] ?? []) + ), + $params['optionalRequests'] + ); + }, +]; diff --git a/config/packages/yiisoft/yii-event/common.php b/config/packages/yiisoft/yii-event/common.php new file mode 100644 index 000000000..92449d868 --- /dev/null +++ b/config/packages/yiisoft/yii-event/common.php @@ -0,0 +1,13 @@ + Dispatcher::class, + ListenerProviderInterface::class => Provider::class, +]; diff --git a/config/packages/yiisoft/yii-event/console.php b/config/packages/yiisoft/yii-event/console.php new file mode 100644 index 000000000..4e41a2bc4 --- /dev/null +++ b/config/packages/yiisoft/yii-event/console.php @@ -0,0 +1,12 @@ + static fn (Factory $factory) => $factory->create($config->get('events-console')), +]; diff --git a/config/packages/yiisoft/yii-event/events-console.php b/config/packages/yiisoft/yii-event/events-console.php new file mode 100644 index 000000000..0dae23dee --- /dev/null +++ b/config/packages/yiisoft/yii-event/events-console.php @@ -0,0 +1,5 @@ + static fn (Factory $factory) => $factory->create($config->get('events-web')), +]; diff --git a/config/packages/yiisoft/yii-filesystem/common.php b/config/packages/yiisoft/yii-filesystem/common.php new file mode 100644 index 000000000..d8946a329 --- /dev/null +++ b/config/packages/yiisoft/yii-filesystem/common.php @@ -0,0 +1,41 @@ + static function () use ($params) { + $aliases = $params['yiisoft/aliases']['aliases'] ?? []; + if (!isset($aliases['@root'])) { + throw new \RuntimeException('Alias of the root directory is not defined.'); + } + + $adapter = new LocalFilesystemAdapter( + $aliases['@root'], + PortableVisibilityConverter::fromArray([ + 'file' => [ + 'public' => 0644, + 'private' => 0600, + ], + 'dir' => [ + 'public' => 0755, + 'private' => 0700, + ], + ]), + LOCK_EX, + LocalFilesystemAdapter::DISALLOW_LINKS + ); + + return new Filesystem($adapter, $aliases); + }, + FileStorageConfigs::class => static fn () => new FileStorageConfigs($params['file.storage'] ?? []), +]; diff --git a/config/packages/yiisoft/yii-filesystem/providers.php b/config/packages/yiisoft/yii-filesystem/providers.php new file mode 100644 index 000000000..ad0928156 --- /dev/null +++ b/config/packages/yiisoft/yii-filesystem/providers.php @@ -0,0 +1,9 @@ + FileStorageServiceProvider::class, +]; diff --git a/config/packages/yiisoft/yii-view/web.php b/config/packages/yiisoft/yii-view/web.php new file mode 100644 index 000000000..96dbb2570 --- /dev/null +++ b/config/packages/yiisoft/yii-view/web.php @@ -0,0 +1,17 @@ + [ + '__construct()' => [ + 'viewPath' => $params['yiisoft/yii-view']['viewPath'], + 'layout' => $params['yiisoft/yii-view']['layout'], + 'injections' => $params['yiisoft/yii-view']['injections'], + ], + ], +]; diff --git a/public/assets/.gitignore b/public/assets/.gitignore old mode 100644 new mode 100755 From a22c22598abfe2c8b1e7416c1685cb6686fddfcb Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 25 Aug 2021 11:05:24 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- .../yii-debug-viewer/config/params.php | 20 +++++++++---------- .../yii-debug-viewer/config/routes.php | 2 +- .../yiisoft/yii-debug-viewer/config/web.php | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/packages/yiisoft/yii-debug-viewer/config/params.php b/config/packages/yiisoft/yii-debug-viewer/config/params.php index 04649a093..ce77032df 100644 --- a/config/packages/yiisoft/yii-debug-viewer/config/params.php +++ b/config/packages/yiisoft/yii-debug-viewer/config/params.php @@ -8,24 +8,24 @@ 'panels' => [ 'panel-info' => [ 'name' => 'Info', - 'route' => '/debug/panels/info' + 'route' => '/debug/panels/info', ], 'panel-routes' => [ 'name' => 'Routes', - 'route' => '/debug/panels/routes' + 'route' => '/debug/panels/routes', ], - 'panel-logs' => [ + 'panel-logs' => [ 'name' => 'Logs', - 'route' => '/debug/panels/logs' - ], + 'route' => '/debug/panels/logs', + ], 'panel-events' => [ 'name' => 'Events', - 'route' => '/debug/panels/events' - ], - 'panel-services' => [ + 'route' => '/debug/panels/events', + ], + 'panel-services' => [ 'name' => 'Services', - 'route' => '/debug/panels/services' - ], + 'route' => '/debug/panels/services', + ], ], ], ]; diff --git a/config/packages/yiisoft/yii-debug-viewer/config/routes.php b/config/packages/yiisoft/yii-debug-viewer/config/routes.php index 1bab8e768..fd2515a3d 100644 --- a/config/packages/yiisoft/yii-debug-viewer/config/routes.php +++ b/config/packages/yiisoft/yii-debug-viewer/config/routes.php @@ -34,7 +34,7 @@ Route::get('/routes') ->action([PanelRoutesController::class, 'view']) ->name('debug/panels/routes'), - Route::get('/logs') + Route::get('/logs') ->action([PanelLogsController::class, 'view']) ->name('debug/panels/logs'), Route::get('/events') diff --git a/config/packages/yiisoft/yii-debug-viewer/config/web.php b/config/packages/yiisoft/yii-debug-viewer/config/web.php index 3aba6bef2..ac66fcc13 100644 --- a/config/packages/yiisoft/yii-debug-viewer/config/web.php +++ b/config/packages/yiisoft/yii-debug-viewer/config/web.php @@ -9,5 +9,5 @@ return [ PanelCollection::class => [ '__construct()' => [$params['yiisoft/yii-debug-viewer']['panels']], - ] + ], ];