问题
I've just started exploring Silex for the first time and sorry if this sounds like a stupid question.
I'd like to use a ServiceProvider written by Igorw to load YAML files. Every 3rd party Service Provider has the same structure:
- /src
-- /Igorw
--- /Silex
---- SomeServiceProvider.php
I was wondering where to put these files in my own app? What is considered best practice? I can't really find any information about that. My own app structure looks like this:
/app
/src
/controller
/view
...
/vendor
/web
composer.json
回答1:
You should just be able to install it using composer as "igorw/config-service-provider", and it will sit in the default vendor/
folder.
回答2:
3th party libraries are sometimes called vendors, put them in the vendor directory.
Moreover, install them using composer. It'll take care of where to store them and how to autoload them. Just run php composer.phar require igorw/config-service-provider:1.2.*
and you are able to register and use the provider.
来源:https://stackoverflow.com/questions/17145288/where-to-put-3rd-party-service-providers-in-my-silex-app