gpt4 book ai didi

php - Symfony 在调试 :container --show-private 中不显示私有(private)服务

转载 作者:行者123 更新时间:2023-12-05 04:13:21 25 4
gpt4 key购买 nike

运行

app/console debug:container --show-private 

不列出使用 public: false 声明的服务,例如:

 another_service:
public: false
class: MineBundle\Service\FirstService

但是,如果我运行 app/console debug:container --show-private | wc -lapp/console debug:container | wc -l 我会得到不同的结果。

尝试使用 symfony 2.8 和 3.1 并得到相同的行为。

有什么想法吗?

谢谢!

最佳答案

Sorry, it's in the doc :)

If a private service is only used as an argument to just one other service, it won't be displayed by the debug:container command, even when using the --show-private option. See Inline Private Services for more details.

然后

What makes private services special is that, if they are only injected once, they are converted from services to inlined instantiations (e.g. new PrivateThing()). This increases the container's performance.

关于php - Symfony 在调试 :container --show-private 中不显示私有(private)服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38005407/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com