More Related Content
Similar to Introduction to rg\injection (20)
More from Bastian Hofmann (20)
Introduction to rg\injection
- 26. <?xml version="1.0" ?>
<container xmlns="http://symfony-project.org/2.0/container">
<parameters>
<parameter key="mailer.username">foo</parameter>
<parameter key="mailer.password">bar</parameter>
<parameter key="mailer.class">Zend_Mail</parameter>
</parameters>
<services>
<service id="mail.transport"
class="Zend_Mail_Transport_Smtp" shared="false">
<argument>smtp.gmail.com</argument>
<argument type="collection">
<argument key="auth">login</argument>
<argument key="username">%mailer.username%</argument>
<argument key="password">%mailer.password%</argument>
<argument key="ssl">ssl</argument>
<argument key="port">465</argument>
</argument>
</service>
<service id="mailer" class="%mailer.class%">
<call method="setDefaultTransport">
<argument type="service" id="mail.transport" />
</call>
</service>
</services>
</container>
- 27. rginjection
inspired by google-guice
http://code.google.com/p/google-guice/
- 67. But we can not create an instance of an Interface!
- 85. And if you don‘t like annotations...
... or want to integrate 3rd party code