Composer를 이용 할 때 Packgist에 있는 패키지라면 composer require
로 손쉽게 이용 가능하지만, 그렇지 않은 경우 약간의 설정을 해주어야 합니다.
GitHub을 예로 들자면, 저장소에 composer.json
이 포함되어 있는 경우 간단히 repositories
내용을 추가함으로서 이용 가능합니다.
1 2 3 4 5 6 7 8 9 10 11 12 |
{ "repositories": [ { "type": "git", "url": "git@github.com:sangheonhan/pman-php-manual.git" } ], "require": { "gonzaloserrano/pman-php-manual": "dev-master" } } |
만약 composer.json
이 없는 경우라면 관련된 정보를 좀 더 상세히 기술해야 합니다. 다음은 그누보드 5 공개형 저장소를 Composer로 쓸 수 있게 설정한 예입니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
{ "repositories": { "gnuboard5": { "type": "package", "package": { "name": "gnuboard/gnuboard5", "version": "5.2.6", "source": { "url": "https://github.com/gnuboard/gnuboard5.git", "type": "git", "reference": "5.2.6" } } } }, "require": { "gnuboard/gnuboard5": "^5.2" } } |