Commit f206b52
committed
feature #864 [MCP Bundle] Make MonologBundle optional (camilleislasse)
This PR was squashed before being merged into the main branch.
Discussion
----------
[MCP Bundle] Make MonologBundle optional
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| Docs? | no
| Issues | Fix #830
| License | MIT
This PR makes MonologBundle optional dependency for McpBundle. Without it installed, the container compilation was failing with "Parent definition' monolog.logger_prototype' does not exist."
## Changes
- Wrap `monolog.logger.mcp` service creation in `class_exists()` check
- Add `->nullOnInvalid()` to `setLogger()` call in services.php
- Uniformize logger references: both McpCommand and McpController now use `monolog.logger.mcp` with `NULL_ON_INVALID_REFERENCE`
- Update test to skip when MonologBundle is not installed
## Credits
Builds on the initial work in #849 by `@WebMamba`. That PR protected service creation but the service was still referenced without protection. This PR completes the fix by also protecting the service usage.
Commits
-------
f3149d6 [MCP Bundle] Make MonologBundle optionalFile tree
5 files changed
+14
-27
lines changed- src/mcp-bundle
- config
- src
- Command
- tests/DependencyInjection
5 files changed
+14
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 20 | | |
26 | | - | |
| 21 | + | |
| 22 | + | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
33 | | - | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
| 36 | + | |
| 37 | + | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
| 40 | + | |
| 41 | + | |
44 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | | - | |
| 146 | + | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 54 | | |
68 | 55 | | |
69 | 56 | | |
| |||
0 commit comments