2017 © Pedro Peláez
 

yii2-extension yii2-snowflake

The snowflake extension for the Yii framework

image

xutl/yii2-snowflake

The snowflake extension for the Yii framework

  • Monday, November 6, 2017
  • by xutl
  • Repository
  • 0 Watchers
  • 3 Stars
  • 1,345 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

yii2-snowflake

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

Latest Stable Version Total Downloads Reference Status Build Status Dependency Status License, (*2)

Installation

Next steps will guide you through the process of installing using composer. Installation is a quick and easy three-step process., (*3)

Step 1: Install component via composer

Either run, (*4)

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

or add, (*5)

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

to the require section of your composer.json., (*6)

Step 2: Configuring your application

Add following lines to your main configuration file:, (*7)

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

Step 3: Configuring your Model Behavior

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

License

This is released under the MIT License. See the bundled LICENSE.md for details., (*8)

The Versions

06/11 2017

dev-master

9999999-dev

The snowflake extension for the Yii framework

  Sources   Download

MIT

The Requires

 

by Avatar xutl

yii snowflake

23/10 2017

1.0.0

1.0.0.0

The snowflake extension for the Yii framework

  Sources   Download

MIT

The Requires

 

by Avatar xutl

yii snowflake