PHPackages                             martin-yeung/phalapihelper - 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. martin-yeung/phalapihelper

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

martin-yeung/phalapihelper
==========================

phalapi 2.\* helper

013PHPCI failing

Since Mar 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/martin-yeung/phalapihelper)[ Packagist](https://packagist.org/packages/martin-yeung/phalapihelper)[ RSS](/packages/martin-yeung-phalapihelper/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

phalapihelper
=============

[](#phalapihelper)

phalapi 2.\* helper

//=======================================================config助手====================================================

@public/init.php defined('API\_ROOT') || define('API\_ROOT', dirname(**FILE**) . '/..');

$host\_domain = isset($\_SERVER\['HTTP\_X\_FORWARDED\_HOST'\]) ? $\_SERVER\['HTTP\_X\_FORWARDED\_HOST'\] : (isset($\_SERVER\['HTTP\_HOST'\]) ? $\_SERVER\['HTTP\_HOST'\] : $\_SERVER\['SERVER\_NAME'\].($\_SERVER\['SERVER\_PORT'\] != '80' ? ':'.$\_SERVER\['SERVER\_PORT'\] : '')); if(strpos($host\_domain, '.website.com') !== false &amp;&amp; strpos($host\_domain, '.rd.') === false) { define('APP\_PRO', true); } else { if(strpos($host\_domain, 'website.co') !== false || strpos($host\_domain, 'website.co') !== false) { define('APP\_DEBUG', true); } else { define('APP\_TEST', true); } } defined('APP\_PRO') || define('APP\_PRO', false); defined('APP\_TEST') || define('APP\_TEST', false); defined('APP\_DEBUG') || define('APP\_DEBUG', false); defined('APP\_ENV') || define('APP\_ENV', APP\_PRO ? 'pro' : (APP\_TEST ? 'test' : 'debug')); //var\_dump(\['APP\_PRO'=&gt;APP\_PRO, 'APP\_TEST'=&gt;APP\_TEST, 'APP\_DEBUG'=&gt;APP\_DEBUG\]);exit();

FileConfig用法【不用修改配置文件以兼容各个运行环境】

@config/di.php //use PhalApi\\Config\\FileConfig; use MartinYeung\\PhalapiHelper\\Config\\FileConfig;

自动处理debug等 @config/sys.php return array( /\*\* \* @var boolean 是否开启接口调试模式，开启后在客户端可以直接看到更多调试信息 \*/ 'debug' =&gt; APP\_DEBUG ? true : false,

//=======================================================微信小程序助手====================================================

@config/di.php //注册微信小程序扩展 $di-&gt;wechatmini = function() { //return new \\PhalApi\\Wechatmini\\Lite(); return new \\MartinYeung\\PhalapiHelper\\Wechatmini\\Lite(); };

//=======================================================微信支付App助手====================================================

@config/di.php //注册微信App扩展 $di-&gt;wechatapp = function() { return new \\MartinYeung\\PhalapiHelper\\Wechatapp\\Lite(); };

//=======================================================微信支付Native助手====================================================

@config/di.php //注册微信App扩展 $di-&gt;wechatnative = function() { return new \\MartinYeung\\PhalapiHelper\\Wechatnative\\Lite(); };

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

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/1ce5f870e2665fea486fbe04312689c5f7501265c43f1f623a1eb122300e0f13?d=identicon)[martin-yeung](/maintainers/martin-yeung)

---

Top Contributors

[![martin-yeung](https://avatars.githubusercontent.com/u/53016934?v=4)](https://github.com/martin-yeung "martin-yeung (25 commits)")

### Embed Badge

![Health badge](/badges/martin-yeung-phalapihelper/health.svg)

```
[![Health](https://phpackages.com/badges/martin-yeung-phalapihelper/health.svg)](https://phpackages.com/packages/martin-yeung-phalapihelper)
```

###  Alternatives

[olifanton/ton

PHP library for The Open Network blockchain

8849.8k2](/packages/olifanton-ton)[bigwhoop/sentence-breaker

Sentence boundary disambiguation (SBD) - or sentence breaking - library written in PHP.

42132.3k](/packages/bigwhoop-sentence-breaker)

PHPackages © 2026

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