xutl/yii2-snowflake 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xutl/yii2-snowflake

最新稳定版本:1.0.0

Composer 安装命令:

composer require xutl/yii2-snowflake

包简介

The snowflake extension for the Yii framework

README 文档

README

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

Latest Stable Version Total Downloads Reference Status Build Status Dependency Status License

Installation

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

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

Add following lines to your main configuration file:

'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.

统计信息

  • 总下载量: 31.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固