Download the PHP package catlane/slink without Composer
On this page you can find all versions of the php package catlane/slink. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download catlane/slink
More information about catlane/slink
Files in catlane/slink
Download catlane/slink
More information about catlane/slink
Files in catlane/slink
Vendor catlane
Package slink
Short Description Generate short url | PHP实现轻量稳定且易用短链接短网址服务
License MIT
Package slink
Short Description Generate short url | PHP实现轻量稳定且易用短链接短网址服务
License MIT
Keywords shorturl slink php
Please rate this library. Is it a good library?
Informations about the package slink
copy自yymou/slink
https://packagist.org/packages/yymou/slink
我在大佬得基础上添加了:指定指定db、批量创建因为单例导致失败、添加永久得短链接
因为急用,故自己修改
Slink
利用redis实现的常用的短链服务, 支持redis一主多从配置, 速度快且运行稳定(建议开启redis持久化), 能满足亿级别的链接转化需求. 底层使用redis发号器递增转换成62进制,但根据简单算法实现了短链接非递增返回. 解析短链依托redis,速度快.
使用:
-
1 使用composer引入
- 执行
composer require yymou/slink
- 项目中引入composer
require 'vendor/autoload.php';
- 执行
-
2 项目中使用
- 设置redis连接: 通用配置 > 读写分离配置
- 通用配置 :
- 读写分离配置 :
-
如使用读写分离配置,则不可设置通用配置,否则不生效;
-
- 设置redis前缀(可选)
如不设置则默认前缀为slink
- 设置原始链接缓存过期时间(可选) (如设置一天则 24小时内同样的链接会返回相同的短链) 单位为秒
如不设置则默认缓存时间为永久
- 设置返回短链长度(可选) 生成短链长度 推荐是7位 一旦项目启动禁止修改该值 7位生成的数量我62的6次方 最小为4
-
生成短链接实例
- 短连接解析
项目通过短链获取原始链接后,可通过302定向原始的url地址
有意见或问题可以随时联系我交流哈 qq:875167485 WeChat:yangmeng6036
All versions of slink with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1.0
The package catlane/slink contains the following files
Loading the files please wait ....