PHPackages                             xwx/common - 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. xwx/common

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

xwx/common
==========

工具类

4.0(5y ago)231[1 PRs](https://github.com/double1025/common/pulls)MITPHPPHP &gt;=7.2

Since Sep 25Pushed 1y agoCompare

[ Source](https://github.com/double1025/common)[ Packagist](https://packagist.org/packages/xwx/common)[ RSS](/packages/xwx-common/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (11)Used By (0)

common
======

[](#common)

安装
--

[](#安装)

```
composer require xwx/common

```

介绍
--

[](#介绍)

帮忙插件，让开发更便捷

- 数据验证组件-Validate
- 数组处理组件-XArray
- URL请求组件-WebClient
- 生成验证-VCode
- 常用方法

Validate
--------

[](#validate)

```
$v = new Validate();
//添加验证条件
$v->addColumn('t1')
    ->required()
    ->lenBetween(0, 10)
    ->url();
$v->addColumn('t2')
    ->required()
    ->lenBetween(0, 10)
    ->url();
//进行参数验证
$r = $v->validate([
    't1' => '',
    't2' => 'http://baidu.com',
], true);
```

XArray
------

[](#xarray)

```
$xarr = XArray::funcIns($arr);
//链式数组处理
$r = $xarr->where('a', 1, '>')
    ->where('b', 1.1, '>')
    ->where('c', 1.1, '>')
    ->order('b', SORT_DESC)
    ->select(['a', 'd'])
    ->get();
```

WebClient
---------

[](#webclient)

```
$url = 'https://www.baidu.com';
$client = new WebClient($url);
$res = $client->get()
$return_string = $res->getBody();
```

VCode
-----

[](#vcode)

```
$v = new \XWX\Common\XImage\VCode();
//保存图片到磁盘
//$v->funcCodeSave(rand(1000, 9999), 'D:/1.jpg');
//直接输入png图片
$v->funcCodeToPng(rand(1000, 9999));
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity10

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

Every ~47 days

Recently: every ~76 days

Total

9

Last Release

2045d ago

Major Versions

1.0 → v2.02019-11-13

v2.1 → v3.02019-11-25

3.5 → 4.02020-10-11

PHP version history (2 changes)1.0PHP &gt;=7.1.0

3.5PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37128174?v=4)[double](/maintainers/double1025)[@double1025](https://github.com/double1025)

---

Top Contributors

[![double1025](https://avatars.githubusercontent.com/u/37128174?v=4)](https://github.com/double1025 "double1025 (55 commits)")

---

Tags

commonxwx

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xwx-common/health.svg)

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

###  Alternatives

[phpoffice/common

PHPOffice Common

23512.3M36](/packages/phpoffice-common)[prooph/common

Common classes used across prooph packages

852.2M27](/packages/prooph-common)

PHPackages © 2026

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