This behavior is referred to in the DI world as constructor injection, because the instance is passed through one of the constructors.
这个行为在DI世界中称作构造函数注入,因为实例是通过一个构造函数传递的。
The alternative (and more widely used) behavior is setter injection, where dependent classes are injected through set methods.
另一种(也是使用更广的)行为是setter注入,在这种注入中,通过set方法注入依赖类。
This statement is vulnerable to SQL injection - quotes in $_GET['username'] are not escaped and will be concatenated as part of the statement text, which can result in malicious behavior.
这条语句就容易受到 SQL 注入的威胁 —— $_GET['username'] 中的引号没有转义,因此将被加入到语句文本中,这样可以导致恶意的行为。
应用推荐