PHPackages                             phalapi/barcode - 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. phalapi/barcode

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

phalapi/barcode
===============

PhalApi 2.x 扩展类库：条形码扩展，基于barcodegen实现。

22711PHP

Since Jan 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/phalapi/barcode)[ Packagist](https://packagist.org/packages/phalapi/barcode)[ RSS](/packages/phalapi-barcode/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

barcode
=======

[](#barcode)

PhalApi 条形码扩展，基于[barcodegen](http://www.barcodebakery.com/)实现。

安装和配置
-----

[](#安装和配置)

修改项目下的composer.json文件，并添加：

```
    "phalapi/barcode":"dev-master"

```

然后执行`composer update`。

注册
--

[](#注册)

在/path/to/phalapi/config/di.php文件中，注册：

```
$di->barcode = function() {
    return new \PhalApi\BarCode\Lite();
};
```

使用
--

[](#使用)

使用方式：直接输出条形码图片：

```
\PhalApi\DI()->barcode->gen('PhalApi 2.x');
```

效果类似如下：
[![](https://camo.githubusercontent.com/c940d95cd7918bd13cfef39eaa002c0eec123926c23ebe112ecbe9283d3780eb/687474703a2f2f3778697a32662e636f6d312e7a302e676c622e636c6f7564646e2e636f6d2f32303137313132313233343634355f6638653032316235633938613765346337356534666139356262346662383665)](https://camo.githubusercontent.com/c940d95cd7918bd13cfef39eaa002c0eec123926c23ebe112ecbe9283d3780eb/687474703a2f2f3778697a32662e636f6d312e7a302e676c622e636c6f7564646e2e636f6d2f32303137313132313233343634355f6638653032316235633938613765346337356534666139356262346662383665)

或者直接浏览器访问：[http://api.phalapi.net/?service=App.BarCode.Gen&amp;check\_sum=PhalApi%202.x](http://api.phalapi.net/?service=App.BarCode.Gen&check_sum=PhalApi%202.x)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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/35d70b1236f8f67d96ba3da4ba88889faf2837ff8f7ab62acc54fe6cb4992c87?d=identicon)[dogstarhuang](/maintainers/dogstarhuang)

---

Top Contributors

[![dogstarTest](https://avatars.githubusercontent.com/u/6116306?v=4)](https://github.com/dogstarTest "dogstarTest (5 commits)")[![phalapi](https://avatars.githubusercontent.com/u/12585518?v=4)](https://github.com/phalapi "phalapi (1 commits)")

### Embed Badge

![Health badge](/badges/phalapi-barcode/health.svg)

```
[![Health](https://phpackages.com/badges/phalapi-barcode/health.svg)](https://phpackages.com/packages/phalapi-barcode)
```

###  Alternatives

[voku/php-hooks

A fork of the WordPress filters hook system rolled in to a class to be ported into any PHP-based system

7637.3k3](/packages/voku-php-hooks)

PHPackages © 2026

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