2017 © Pedro Peláez
 

library yii2-snowflake

yii2 snowflake extension

image

jump2/yii2-snowflake

yii2 snowflake extension

  • Tuesday, June 26, 2018
  • by annronwoo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 173 % Grown

The README.md

yii2 snowflake

yii2 snowflake extension, your have to install swoole of php extension, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

composer require --prefer-dist jump2/yii2-snowflake "*"

or add, (*4)

"jump2/yii2-snowflake": "*"

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

Configuration

First of all , you have to configure the Server class in your console application configuration:, (*6)

'snowflakeServer' => [
    'class'         => 'Snowflake\Server',
    'host'          => '0.0.0.0',
    'port'          => 5599,
    'workerId'      => 1,
    'datacenterId'  => 1
],

and create console controller like the file below the example directory, then run it for start the snowflake server, (*7)

Next, you have to configure the Client class in your application configuration:, (*8)

'snowflakeClient' => [
    'class'         => 'Snowflake\Client',
    'host'          => '0.0.0.0',
    'port'          => 5599
],

Use below code to generate id, (*9)

<?php
echo \Yii::$app->snowflakeClient->nextId();
?>

The Versions

26/06 2018

dev-master

9999999-dev

yii2 snowflake extension

  Sources   Download

Apache-2.0

The Requires

 

by aaron woo

26/06 2018

1.0.3

1.0.3.0

yii2 snowflake extension

  Sources   Download

Apache-2.0

The Requires

 

by aaron woo

17/06 2018

1.0.2

1.0.2.0

yii2 snowflake extension

  Sources   Download

Apache-2.0

The Requires

 

by aaron woo

27/03 2018

1.0.1

1.0.1.0

yii2 snowflake extension

  Sources   Download

Apache-2.0

The Requires

 

by aaron woo

19/03 2018

1.0.0

1.0.0.0

yii2 snowflake extension

  Sources   Download

Apache-2.0

The Requires

 

by aaron woo