lighturl/lighturl
Composer 安装命令:
composer require lighturl/lighturl
包简介
Open Source Url Shortener
README 文档
README
Open Source Url Shortener
Requirements
- PHP 5.6.4+
Installation
Via Composer Install
$ composer require lighturl/lighturl
Database Migration
use Phinx PHP Database Migrations
edit phinx.yml $ phinx migrate -e <development - production - testing>
Docs
Coming soon
Quick Start
require 'vendor/autoload.php'; use Illuminate\Database\Capsule\Manager as Capsule; use LightUrl\LightUrl;
$capsule = new Capsule; $capsule->addConnection([ 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'lighturl', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ]); // Make this Capsule instance available globally via static methods... (optional) $capsule->setAsGlobal(); // Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher()) $capsule->bootEloquent(); $connection=$capsule->getConnection();
$light = new LightUrl($connection); if(isset($_GET['shortkey'])){ $light->redirectTo($_GET['shortkey']); }else { $key = $light->lighten($heavyUrl); echo $key; }
Changelog
Details changes for each release are documented in the release notes.
License
MIT
统计信息
- 总下载量: 40
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-07