PHPackages                             xutl/yii2-snowflake - 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. [Framework](/categories/framework)
4. /
5. xutl/yii2-snowflake

ActiveYii2-extension[Framework](/categories/framework)

xutl/yii2-snowflake
===================

The snowflake extension for the Yii framework

1.0.0(8y ago)730.9k↓33.3%3[2 issues](https://github.com/xutl/yii2-snowflake/issues)MITPHPPHP &gt;=5.4.0

Since Oct 23Pushed 8y agoCompare

[ Source](https://github.com/xutl/yii2-snowflake)[ Packagist](https://packagist.org/packages/xutl/yii2-snowflake)[ RSS](/packages/xutl-yii2-snowflake/feed)WikiDiscussions master Synced 1mo ago

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

yii2-snowflake
==============

[](#yii2-snowflake)

适用于 Yii2 的 雪花算法ID生成器。Based on the Twitter Snowflake algorithm.

[![Latest Stable Version](https://camo.githubusercontent.com/3c9ff2f3d5418e7df4dd77bd340a2fe37c0d5a42eb23a7f806e1d41c8302e443/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d736e6f77666c616b652f762f737461626c652e706e67)](https://packagist.org/packages/xutl/yii2-snowflake)[![Total Downloads](https://camo.githubusercontent.com/2a315dc9b1ca93378d23f3db4052c37761eac0278202f08d0e3b3f432861e83a/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d736e6f77666c616b652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/xutl/yii2-snowflake)[![Reference Status](https://camo.githubusercontent.com/e58d753da3ba294bdb05fb82bda564e3ae368e465a1bd501602910411f59e776/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7875746c3a796969322d736e6f77666c616b652f7265666572656e63655f62616467652e737667)](https://www.versioneye.com/php/xutl:yii2-snowflake/references)[![Build Status](https://camo.githubusercontent.com/881c9417379b1a8d34c953fa63aac2e39b68b7600fcb0078ef1be8145353e5d8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7875746c2f796969322d736e6f77666c616b652e737667)](http://travis-ci.org/xutl/yii2-snowflake)[![Dependency Status](https://camo.githubusercontent.com/be1f83499bdf735dcf6bd607550e66aa99f8c7679c5f96f4ac46d6840feeb094/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7875746c3a796969322d736e6f77666c616b652f6465762d6d61737465722f62616467652e706e67)](https://www.versioneye.com/php/xutl:yii2-snowflake/dev-master)[![License](https://camo.githubusercontent.com/350c798f05d2e88f554f69970e9acd5b637193bc769a8f7579f2bbb70d21337e/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d736e6f77666c616b652f6c6963656e73652e737667)](https://packagist.org/packages/xutl/yii2-snowflake)

Installation
------------

[](#installation)

Next steps will guide you through the process of installing using [composer](http://getcomposer.org/download/). Installation is a quick and easy three-step process.

### Step 1: Install component via composer

[](#step-1-install-component-via-composer)

Either run

```
composer require --prefer-dist xutl/yii2-snowflake

```

or add

```
"xutl/yii2-snowflake": "~1.0.0"
```

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

### Step 2: Configuring your application

[](#step-2-configuring-your-application)

Add following lines to your main configuration file:

```
'components' => [
    'snowflake' => [
        'class' => 'xutl\snowflake\Snowflake',
        'workerId' => 0,
        'dataCenterId' => 0,
    ],
],
```

### Step 3: Configuring your Model Behavior

[](#step-3-configuring-your-model-behavior)

```
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'snowflake'=>[
                'class' => 'xutl\snowflake\SnowflakeBehavior',
                'attribute' => 'id',
            ],
        ];
    }
```

License
-------

[](#license)

This is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87b658aa9d49e0c80cfc609fa2b9dc6d615672b1d895f421f751945a0e394087?d=identicon)[larvacent](/maintainers/larvacent)

---

Top Contributors

[![xutl](https://avatars.githubusercontent.com/u/20939388?v=4)](https://github.com/xutl "xutl (10 commits)")

---

Tags

snowflakeyii2yii2-extensionyiisnowflake

### Embed Badge

![Health badge](/badges/xutl-yii2-snowflake/health.svg)

```
[![Health](https://phpackages.com/badges/xutl-yii2-snowflake/health.svg)](https://phpackages.com/packages/xutl-yii2-snowflake)
```

###  Alternatives

[yiisoft/yii2-queue

Yii2 Queue Extension which supports queues based on DB, Redis, RabbitMQ, Beanstalk, SQS, and Gearman

1.1k10.4M155](/packages/yiisoft-yii2-queue)[omnilight/yii2-scheduling

Scheduling extension for Yii2 framework

3181.0M7](/packages/omnilight-yii2-scheduling)[skeeks/yii2-assets-auto-compress

Automatically compile and merge files js + css + html in yii2 project

162437.6k6](/packages/skeeks-yii2-assets-auto-compress)[omnilight/yii2-shopping-cart

Yii2 extension that adds shopping cart functions

221110.9k4](/packages/omnilight-yii2-shopping-cart)[iiifx-production/yii2-autocomplete-helper

Yii2 Autocomplete Helper

4226.9k2](/packages/iiifx-production-yii2-autocomplete-helper)

PHPackages © 2026

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