번들에 composer.json 파일을 추가하십시오. 예를 들어 내 번들 중 하나이 있습니다
이
{
"name": "cg/kint-bundle",
"type": "symfony-bundle",
"description": "This bundle lets you use the Kint function in your Twig templates. Kint is a print_r() replacement which produces a structured, collapsible and escaped output",
"keywords": ["kint", "debug", "symfony", "bundle", "twig"],
"homepage": "http://github.com/barelon/CgKintBundle",
"license": "MIT",
"authors": [
{
"name": "Carlos Granados",
"homepage": "http://github.com/barelon"
},
{
"name": "Symfony Community",
"homepage": "http://github.com/barelon/CgKintBundle"
}
],
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": ">=2.0.0",
"raveren/kint": "dev-master"
},
"minimum-stability": "dev",
"autoload": {
"psr-0": {
"Cg\\KintBundle": ""
}
},
"target-dir": "Cg/KintBundle"
}
그런 packagist.org에 번들을 추가 할 수 있습니다. 그것은 매우 간단합니다, 기본적으로 당신은 당신의 자식 주소를 제공해야하고 그것은 나머지를 할 것입니다.
번들을 packagist에서 사용할 수있게되면 심포니 프로젝트의 composer.json 파일에 의존성으로 추가하기 만하면됩니다. 내 경우에는 내가 가진 :
"require": {
....
"cg/kint-bundle": "*"
},
그런 다음 당신의 심포니 디렉토리와 이것이 전부 "작곡가 업데이트"를 실행! autoload 파일을 업데이트 할 필요조차 없습니다. 작곡가가 대신 해줍니다. 남아있는 유일한 것은 appkernel.php에서 번들을로드하는 것입니다.
@Florent, 이미 Composer 도구 인'composer-php'에 대한 태그가 있음을 기억하십시오. – Charles