Note that there are some explanatory texts on larger screens.

plurals
  1. POIn Symfony2 where do I put e.g. TCPDF?
    primarykey
    data
    text
    <p>I'm on Symfony 2.0 and understood that third-party libraries go in /vendor. I have two third party classes I'm using, one is TCPDF and another is a Paypal class. Neither have formal Symfony2 Bundles. </p> <p>So I followed the instructions here which namespaces them and makes them usable inside /vendor:</p> <p><a href="http://www.kiwwito.com/article/add-third-party-libraries-to-symfony-2" rel="nofollow">Add third party libraries to Symfony 2</a></p> <p>This works and I can access them from my Controllers. However I'm rethinking if that's the right thing. Whenever I do..</p> <pre><code>php bin/vendors install --reinstall </code></pre> <p>..those custom classes disappear because they don't have a Git repo in 'deps'. This has caused real problems e.g. when trying to deploy on e.g. PagodaBox. I get the strong instinct that this code while 'third-party' belongs closer to the code of my app.</p> <p>If that's true, should it:</p> <ul> <li>Sit next to my Controllers in src/MyCompany/MyBundle/Controller/tcpdf.php</li> <li>Be with my other custom-written services in src/MyCompany/MyBundle/DependencyInjection/tcpdf.php</li> <li>Go in its own directory under my bundle: src/MyCompany/MyBundle/TCPDF/tcpdf.php</li> </ul> <p>If I move these two classes from /vendor to one of the above, would I access it from a Controller with a 'use' statement, or would I need to define it in 'services.yml'?</p> <p>I hope this isn't so much a matter of discussion or opinion but some guidance I've missed or best practise I'm unaware of that a more experienced Symfony2 dev would know.</p> <p>Would it be sensible to switch to Composer even before Symfony 2.1 is ready?</p> <p>Thanks for reading.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload