PHPackages                             thxyh99/composer\_advance - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thxyh99/composer\_advance

ActiveProject[Utility &amp; Helpers](/categories/utility)

thxyh99/composer\_advance
=========================

composer advance

03

Since Mar 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/thxyh99/composer_advance)[ Packagist](https://packagist.org/packages/thxyh99/composer_advance)[ RSS](/packages/thxyh99-composer-advance/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Composer如何创建并发布一个自己的包
=====================

[](#composer如何创建并发布一个自己的包)

### **有哪些步骤**

[](#有哪些步骤)

1. 编写代码
2. 编写composer.json文件,选择合适的包加载方式
3. github拖管代码
4. 提交包到[packagist](https://packagist.org)
5. 配置github hook自动更新

### **编写类库代码**

[](#编写类库代码)

作为一个使用composer的现代php程序员，建议使用 [psr4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) 标准 来组织代码（这不是必须，但是建议），代码参见github

### **编写composer.json文件**

[](#编写composerjson文件)

```
{
  "name": "thxyh99/zendframework",
  "description": "Just for fun",
  "require": {
  },
  "autoload": {
    "psr-4": {

    }
  }
}

```

### **github拖管代码**

[](#github拖管代码)

在github上创建一个项目，提交代码。同时建议发布一个稳定的tag。

这不是必须，可以选择其他代码仓库，git或者svn都可以，但是建议放在这。

### **提交包到 packagist**

[](#提交包到-packagist)

packagist 是 Composer 的主要资源库，原生支持。任何支持 Composer 的开源项目应该发布自己的包在 packagist 上。

当然这也不是必须，但是建议，毕竟 packagist 使用的人最多，资源最丰富。

登录[packagist.org](https://packagist.org/packages/submit) 官方站点，如果没有账号，直接选择 github 账号登录就好了

输入项目的 github 地址，点击check，判断项目代码中包含 composer.json 文件，包名不重复，就可以直接 submit 了。

### **配置github hook自动更新**

[](#配置github-hook自动更新)

配置自动更新的好处是，如果提交了代码，或者发布了新的版本，packagist 会自动拉取最新的代码供他人使用。

在[webhook](https://webhook.site)网站生成Payload URL

```
To do so you can:
1.Go to your project repository.
2.Go to "settings" in the right corner.
3.Click on "webhooks."
4.Click "Add webhooks."
5.Write the Payload URL as https://webhook.site/6161ee36-21ac-48ea-8a21-809511ed1775

```

### **过程**

[](#过程)

[![](https://camo.githubusercontent.com/1f95179a76978b7063aaa726aaca781be0e36216e0c13cb713af9a7bc6c5ff9e/68747470733a2f2f692e696d6775722e636f6d2f594534627233372e706e67)](https://camo.githubusercontent.com/1f95179a76978b7063aaa726aaca781be0e36216e0c13cb713af9a7bc6c5ff9e/68747470733a2f2f692e696d6775722e636f6d2f594534627233372e706e67)

[![](https://camo.githubusercontent.com/ab10863afc3a180cb2d351835735255e5106636deef5827e445a7f8ec839c0f4/68747470733a2f2f692e696d6775722e636f6d2f61516951506e322e706e67)](https://camo.githubusercontent.com/ab10863afc3a180cb2d351835735255e5106636deef5827e445a7f8ec839c0f4/68747470733a2f2f692e696d6775722e636f6d2f61516951506e322e706e67)

[![](https://camo.githubusercontent.com/687ceb127d8cc801b73e64ce38b9fa50c9c236cbd38d45985d00fd8996747b0f/68747470733a2f2f692e696d6775722e636f6d2f4a6e6945306b7a2e706e67)](https://camo.githubusercontent.com/687ceb127d8cc801b73e64ce38b9fa50c9c236cbd38d45985d00fd8996747b0f/68747470733a2f2f692e696d6775722e636f6d2f4a6e6945306b7a2e706e67)

### **使用**

[](#使用)

`composer require thxyh99/zendframework dev-master`

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea89e48fd4e4099bcde6a4230b8571acdfa87e4166248c11f92f93fd84132712?d=identicon)[thxyh99](/maintainers/thxyh99)

---

Top Contributors

[![thxyh99](https://avatars.githubusercontent.com/u/8088426?v=4)](https://github.com/thxyh99 "thxyh99 (2 commits)")

### Embed Badge

![Health badge](/badges/thxyh99-composer-advance/health.svg)

```
[![Health](https://phpackages.com/badges/thxyh99-composer-advance/health.svg)](https://phpackages.com/packages/thxyh99-composer-advance)
```

###  Alternatives

[sbodak/magento2-checkout-custom-form

Add a custom form to Magento 2 checkout on the shipping step.

1013.5k](/packages/sbodak-magento2-checkout-custom-form)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
