Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

创建自己的composer包 #41

Open
lovecn opened this issue Nov 20, 2016 · 0 comments
Open

创建自己的composer包 #41

lovecn opened this issue Nov 20, 2016 · 0 comments

Comments

@lovecn
Copy link
Owner

lovecn commented Nov 20, 2016

http://www.36nu.com/post/187.html
一 在github上创建一个项目
二 修改项目的composer.json文件
在composer.json文件添加必要信息,例如:
{
"name": "muyuren/nuf",
"description": "nuf framework",
"keywords": [
"nuf"
],
"homepage": "http://www.36nu.com/",
"license": "MIT",
"authors": [
{
"name": "muyuren",
"email": "[email protected]"
}
],
"require":{
"noahbuscher/macaw": "dev-master",
"illuminate/database": "",
"filp/whoops": "
"
},
"autoload":{
"classmap":[
"app/controllers",
"app/models",
"assists"
]
}
}

三 在https://packagist.org/上提交自己的包
在官网注册账号,然后submit自己的包,在提交页面的文本框中输入你在github上的项目地址,packagist会自动检测是否合法。如果合法点击递交即可

四 设置github的hook
版本控制工具大多支持hook,用于代码递交时触发一个事件,将代码同步到其他环境中。在github上设置hook后,每次push都会自动同步到packagist上,这样就不需要手动同步了,方法如下:
Go to your GitHub repository
Click the "Settings" button
Click "Webhooks & Services"
Add a "Packagist" service, and configure it with your API token, plus your Packagist username
Check the "Active" box and submit the form
You can then hit the "Test Service" button to trigger it and check if Packagist removes the warning about the package not being auto-updated.
注:在https://packagist.org/profile/页面可以查看自己的API token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant