PHPackages                             razonyang/mediawiki-zhconverter - 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. razonyang/mediawiki-zhconverter

Abandoned → [razonyang/php-opencc](/?search=razonyang%2Fphp-opencc)Library[Utility &amp; Helpers](/categories/utility)

razonyang/mediawiki-zhconverter
===============================

1.0.0(6y ago)13329GPL-3.0-only

Since Aug 14Compare

[ Source](https://github.com/razonyang/mediawiki-zhconverter)[ Packagist](https://packagist.org/packages/razonyang/mediawiki-zhconverter)[ RSS](/packages/razonyang-mediawiki-zhconverter/feed)WikiDiscussions Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

**⚠️ 此项目由于以下原因，已不再维护，推荐使用 [OpenCC](https://github.com/razonyang/php-opencc) 进行简繁体转换。**

- 依赖 MediaWiki，为了简繁体转换，导致项目过于臃肿
- MediaWiki 不支持 PHP 8，并且该库状态为 [Abandoned](https://packagist.org/packages/mediawiki/core)
- MediaWiki 不支持 Composer 2\*\*

基于 MediaWiki 的简繁体转换
===================

[](#基于-mediawiki-的简繁体转换)

[![Build Status](https://camo.githubusercontent.com/6c20971526c9aace2f641494fc5216fbb749906fa6d32ff84f2bfb3f2783d2c1/68747470733a2f2f7472617669732d63692e6f72672f72617a6f6e79616e672f6d6564696177696b692d7a68636f6e7665727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/razonyang/mediawiki-zhconverter)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b99c66110c28264c1f5775688689feac224c837c5100d5a4f1fc759876a2905a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72617a6f6e79616e672f6d6564696177696b692d7a68636f6e7665727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/razonyang/mediawiki-zhconverter/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/32dc52f43af140ae346f8e6b59a6a005e820adf679d980c5e8e287610437eb1d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72617a6f6e79616e672f6d6564696177696b692d7a68636f6e7665727465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/razonyang/mediawiki-zhconverter/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/ca86c32b22084bcffd8e83f55eedf8ad73450d972395e006255e4a6c7adc85ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72617a6f6e79616e672f6d6564696177696b692d7a68636f6e7665727465722e737667)](https://packagist.org/packages/razonyang/mediawiki-zhconverter)[![Total Downloads](https://camo.githubusercontent.com/bb0dbbd4d6e5aff3197f7f10791d1cb92b7b67a56bb21a4c47949b6e91ff2a9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72617a6f6e79616e672f6d6564696177696b692d7a68636f6e7665727465722e737667)](https://packagist.org/packages/razonyang/mediawiki-zhconverter)[![LICENSE](https://camo.githubusercontent.com/49dbc26d3bf877b74c83c7a111209018ebb4864d14e74593b70e564052f76260/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f72617a6f6e79616e672f6d6564696177696b692d7a68636f6e766572746572)](LICENSE)

源码参考自 。 并在其基础上重写，以便用于 Composer 安装和方便使用。

要求
--

[](#要求)

- PHP &gt;= 5.5
- Mediawiki 请使用 [composer.json](composer.json) 指定的版本，其他版本可能不起作用。

使用
--

[](#使用)

### 安裝

[](#安裝)

```
composer require razonyang/mediawiki-zhconverter

```

如果不打算使用 Composer 安装，需要主动设置 MediaWiki 的目录路径常量： `MEDIAWIKI_PATH`：

```
define('MEDIAWIKI_PATH', '/path-to-mediawiki');
```

> 一般的，如果使用了 Composer 的类自动加载时，[ComposerHelper](src/ComposerHelper.php) 会自动识别 MediaWiki 的路径。 若无法正确识别，请手动定义 `MEDIAWIKI_PATH`。

### 示例

[](#示例)

```
$text = '书本';

// 中文简体
echo ZhConverter::toCN($text); // 书本

// 台湾繁体
echo ZhConverter::toTW($text); // 書本

// 香港繁体
echo ZhConverter::toHK($text); // 書本

// 澳门繁体
echo ZhConverter::toMO($text); // 書本

// 其他变种
$variant = 'zh-sg'; // 新加坡
echo ZhConverter::to($variant, $text); // 书本
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2512d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17720932?v=4)[Razon Yang](/maintainers/RazonYang)[@razonyang](https://github.com/razonyang)

---

Top Contributors

[![razonyang](https://avatars.githubusercontent.com/u/17720932?v=4)](https://github.com/razonyang "razonyang (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/razonyang-mediawiki-zhconverter/health.svg)

```
[![Health](https://phpackages.com/badges/razonyang-mediawiki-zhconverter/health.svg)](https://phpackages.com/packages/razonyang-mediawiki-zhconverter)
```

###  Alternatives

[liberu-genealogy/php-dna

DNA analysis toolkit for PHP 8.3+

344.8k1](/packages/liberu-genealogy-php-dna)[sas/shortcode

Use Wordpress like Shortcodes within the Text Editor of Shopware

156.4k](/packages/sas-shortcode)

PHPackages © 2026

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