php - In Symfony2 where do I put e.g. TCPDF? -


i'm on symfony 2.0 , understood third-party libraries go in /vendor. have 2 third party classes i'm using, 1 tcpdf , paypal class. neither have formal symfony2 bundles.

so followed instructions here namespaces them , makes them usable inside /vendor:

add third party libraries symfony 2

this works , can access them controllers. i'm rethinking if that's right thing. whenever do..

php bin/vendors install --reinstall 

..those custom classes disappear because don't have git repo in 'deps'. has caused real problems e.g. when trying deploy on e.g. pagodabox. strong instinct code while 'third-party' belongs closer code of app.

if that's true, should it:

  • sit next controllers in src/mycompany/mybundle/controller/tcpdf.php
  • be other custom-written services in src/mycompany/mybundle/dependencyinjection/tcpdf.php
  • go in own directory under bundle: src/mycompany/mybundle/tcpdf/tcpdf.php

if move these 2 classes /vendor 1 of above, access controller 'use' statement, or need define in 'services.yml'?

i hope isn't matter of discussion or opinion guidance i've missed or best practise i'm unaware of more experienced symfony2 dev know.

would sensible switch composer before symfony 2.1 ready?

thanks reading.

if you're using deps manage vendor libraries should add git repo's libraries there.

for tcpdf can use:

[tcpdf]     git=git://tcpdf.git.sourceforge.net/gitroot/tcpdf/tcpdf     target=/tcpdf 

if have other libraries aren't in public repo may want commit them own repo.

the same hold true composer. syntax adding non-packagist repo's different.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -