承接 phpgears/identity-extra 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

phpgears/identity-extra

Composer 安装命令:

composer require phpgears/identity-extra

包简介

Identity object for PHP

README 文档

README

PHP version Latest Version License

Build Status Style Check Code Quality Code Coverage

Total Downloads Monthly Downloads

Identity Extra

Non UUID based identity objects for PHP

This package extends phpgears/identity to provide non UUID-based identities

Installation

Composer

composer require phpgears/identity-extra

Usage

Require composer autoload file

require './vendor/autoload.php';

Mongo ObjectId

You need to install and enable ext-mongodb through your distro's repos or PECL

sudo pecl install mongodb
use Gears\Identity\Extra\ObjectIdIdentity;
use Gears\Identity\Extra\ObjectIdIdentityGenerator;
use MongoDB\BSON\ObjectId;

$identity = ObjectIdIdentity::fromString((string) new ObjectId());

// From generator
$identity = (new ObjectIdIdentityGenerator())->generate();

ULID (Universally Unique Lexicographically Sortable Identifier)

you need to require https://github.com/robinvdvleuten/php-ulid

composer require obinvdvleuten/ulid
use Gears\Identity\Extra\UlidIdentity;
use Gears\Identity\Extra\UlidIdentityGenerator;
use Ulid\Ulid;

$identity = UlidIdentity::fromString((string) Ulid::generate());

// From generator
$identity = (new UlidIdentityGenerator())->generate();

Find more information about ULID at https://github.com/ulid/spec

KSUID (K-Sortable Globally Unique IDs)

you need to require https://github.com/tuupola/ksuid

composer require tuupola/ksuid
use Gears\Identity\Extra\KsuidIdentity;
use Gears\Identity\Extra\KsuidIdentityGenerator;
use Tuupola\KsuidFactory;

$identity = KsuidIdentity::fromString((string) KsuidFactory::create());

// From generator
$identity = (new KsuidIdentityGenerator())->generate();

Find more information about KSUID at https://github.com/segmentio/ksuid

Xid (Globally Unique ID)

you need to require https://github.com/fpay/xid-php

composer require fpay/xid-php
use Gears\Identity\Extra\XidIdentity;
use Gears\Identity\Extra\XidIdentityGenerator;
use Fpay\Xid\Generator;

$identity = XidIdentity::fromString((string) Generator::create());

// From generator
$identity = (new XidIdentityGenerator())->generate();

Find more information about Xid at https://github.com/fpay/xid-php

Contributing

Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.

See file CONTRIBUTING.md

License

See file LICENSE included with the source code for a copy of the license terms.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固