PHPackages                             zjh/portrait - 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. zjh/portrait

ActiveLibrary

zjh/portrait
============

desc

v1.1.2(8y ago)020MITCSS

Since May 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zhangjiahao93/yii2-portrait)[ Packagist](https://packagist.org/packages/zjh/portrait)[ RSS](/packages/zjh-portrait/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (6)Used By (0)

portrait
========

[](#portrait)

### 安装

[](#安装)

Either run

```
$ php composer.phar require zjh/portrait "*"

```

or add

```
zjh/portrait "*"

```

to the `require` section of your `composer.json` file.

### 应用

[](#应用)

controller:

```
public function actions()
{
    'headpic'=>[
		'class'=>'zjh\portrait\PortraitAction',
		'config' => [
			'imageRoot' =>Yii::getAlias('@webroot'),//总目录地址D://webpath/
			"publicPath"=>"/uploads/public/original/",//原图保存路径
			"publicHeadpicPath"=>"/uploads/public/headpic/",//默认头像保存路径
			"publicTmpPath"=>"/uploads/public/headpicTmp/",//默认头像保存路径
			'CConfig' => [
				"width" => 120,
				"height" => 120
			],//最终头像大小设置
			'maxsize'=>1024*1024*2,//2M上传图片最大尺寸
			'userModelTableName'=>'user_backend',//需要修改头像的用户模型
			'portraitKeyword'=>'thumb',//用户表要修改的关键词
		]
	],
}
```

### 说明

[](#说明)

需要yii2框架支持 该组件为 Yii2 上传头像组件 引用了Jcrop-0.9.12,jq.thumb

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~0 days

Total

4

Last Release

3269d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b61a4e0bc9bf6ef2f4c18a48fa559e2c063d8eb125720b8cc49d2567451d605?d=identicon)[zhangjiahao93](/maintainers/zhangjiahao93)

---

Top Contributors

[![zhangjiahao93](https://avatars.githubusercontent.com/u/17284947?v=4)](https://github.com/zhangjiahao93 "zhangjiahao93 (7 commits)")

---

Tags

javascriptphp

### Embed Badge

![Health badge](/badges/zjh-portrait/health.svg)

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

PHPackages © 2026

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