Where to put 3rd party service providers in my Sil

2019-08-29 04:18发布

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

标签: php silex
2条回答
在下西门庆
2楼-- · 2019-08-29 04:45

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.

查看更多
3楼-- · 2019-08-29 04:47

You should just be able to install it using composer as "igorw/config-service-provider", and it will sit in the default vendor/ folder.

查看更多
登录 后发表回答