Laravel ํจํค์ง ์ ์ Demo, (*1)
Composer ๋ฅผ ์ด์ฉํ ํจํค์ง ์์ฑ conposer init ์คํ, (*2)
composer init, (*3)
Welcome to the Composer config generator This command will guide you through creating your composer.json config. Package name (<vendor>/<name>) [anyman/test-package]: Description []: Author [๊น๊ด์ฒ <anyman@afreecatv.com>, n to skip]: Minimum Stability []: Package Type (e.g. library, project, metapackage, composer-plugin) []: License []: Define your dependencies. Would you like to define your dependencies (require) interactively [yes]? Search for a package: Would you like to define your dev dependencies (require-dev) interactively [yes]? Search for a package: { "name": "anyman/test-package", "authors": [ { "name": "๊น๊ด์ฒ ", "email": "anyman@afreecatv.com" } ], "require": {} } Do you confirm generation [yes]? yes
src ํด๋์์ฑ, (*4)
mkdir src, (*5)
composer.json ํ์ผ์ ํจํค์ง namespace ๋ฅผ ์ง์ ํด์ค๋ค., (*6)
{ "autoload": { "psr-4": { "Lomi525\\Packagestest\\": "src/" } } }
๋ผ๋ผ๋ฒจ ํจํค์ง ์ ์์ ์ํด์๋ ๋ผ๋ผ๋ฒจํด๋์ค๋ฅผ ํด์ผํ๋ฏ๋ก ์ถ๊ฐํจํค์ง๋ฅผ ์ค์นํ๋ค composer.json์ ์์ , (*7)
{ "require": { "php": ">=5.3.0", "illuminate/support": "^4.0|^5.0" }, }
ServiceProvier : ๋ผ๋ผ๋ฒจ์์ ์๋น์ค๋ ๋ Bootstrap์ ํตํด ๋ก๋๋ฉ๋๋ค., (*8)
์) PackageServiceProvider, (*9)
<?php /** * Created by PhpStorm. * User: anyman * Date: 2017-02-24 * Time: ์คํ 6:33 */ namespace Lomi525\Packagestest; use Illuminate\Support\ServiceProvider; class PackageServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { } public function register() { } }
git init git add . git commit -m "first commit" git remote add origin https://github.com/lomi525/test.git git push -u origin master
Git์ ์ฅ์์ ๋ฑ๋ก๋ ํจํค์ง๋ tag๋ก ๋ฒ์ ๊ด๋ฆฌ๊ฐ๋๋ค., (*10)
v1.0.0 * ๋ฒ์ ํ๊ทธ ํ ๋๋ 1.0.0 ๋ถํฐ ์๊ฐํด์ผ์ง Compser๊ฐ ์ธ์ํ๋๋ฏ ํฉ๋๋ค.(์ฝ์งใ ใ ), (*11)
github ์ ํจํค์ง์ ์ ๋ฒ์ ์ ๋ฆด๋ฆฌ์คํ๋ค๊ณ ๊ฐ์ ํด ๋ณด์. ๋ฆด๋ฆฌ์ค๋ง๋ค Packagist ์๋ ์ฌ๋ ค์ผ ํ๋ค๋ฉด ๋งค์ฐ ๋ฒ๊ฑฐ๋ก์ธ ๊ฒ์ด๋ค. github ์ hook ์ ์ค์ ํ๋ฉด ์ ๋ฒ์ ๋ฆด๋ฆฌ์ค์ ์๋์ผ๋ก Packagist ์ ๋ฐ์๋๋๋ก ํ ์ ์๋ค., (*12)
1) https://packagist.org/profile/ ์ ๋ค์ด๊ฐ ํ์ Your API Token ์ ์๋ ํ ํฐ์ ๋ณต์ฌํ๋ค.
, (*13)
2) github ์ ๋ก๊ทธ์ธ ํํ์ ํ๋ก์ ํธ๋ก ๋ค์ด๊ฐ๋ค.
3) ์ฐ์ธก์ ํ๋ก์ ํธ Settings ๋ฒํผ์ ํด๋ฆญํ๋ค. ์๋จ์ Settings ๋ฒํผ์ ๊ณ์ ์ค์ ์ด๋ฏ๋ก ํ๋ก์ ํธ ์ค์ ์ผ๋ก ๋ค์ด๊ฐ์ผ ํ๋ค.
4) Integrations & Services ๋ฅผ ํด๋ฆญํ๋ค.
5) Add Service ๋ฅผ ํด๋ฆญํ ํ์ Packagist ๋ฅผ ์ฐพ์์ ๋ฑ๋กํ๋ค.
, (*14)
6) User ํญ๋ชฉ์ id๋ฅผ ์
๋ ฅํ๊ณ Token ํญ๋ชฉ์ 1๋ฒ์์ ๋ณต์ฌํ API token์ ๋ถ์ฌ ๋ฃ๋๋ค.
7)Add Service ๋ฅผ ํด๋ฆญํ์ฌ ์ ์ฅํ๋ค., (*15)
composer.json ์ค์ , (*16)
{ "repositories": [ { "type": "vcs", "url": "https://test.gitlab.com/test.git" } ] }