承接 rezzza/shorty 相关项目开发

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

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

rezzza/shorty

最新稳定版本:v1.3.1

Composer 安装命令:

composer require rezzza/shorty

包简介

Underwear for your long urls

README 文档

README

https://poser.pugx.org/rezzza/Shorty/version.png https://travis-ci.org/rezzza/Shorty.png?branch=master https://insight.sensiolabs.com/projects/92606d9e-f7ee-48a9-adf0-d7d7cd4d8918/mini.png

Underwear for your long urls

Installation

Use Composer to install: rezzza/shorty.

In your composer.json you should have:

{
    "require": {
        "rezzza/shorty": "1.0.*"
    }
}

Requirements

Shorty requires Guzzle.

Usage

Example with the Google shortener:

$googleShortener = new \Rezzza\Shorty\Provider\Google();
$googleShortener->setHttpAdapter(new \Rezzza\Shorty\Http\GuzzleAdapter());
// or
// $googleShortener->setHttpAdapter(new \Rezzza\Shorty\Http\CurlAdapter());
$shortUrl        = $googleShortener->shorten('http://www.verylastroom.com/');
$longUrl         = $googleShortener->expand('http://goo.gl/YY5Tz');

Example with the Chain shortener:

$chainShortener = new \Rezzza\Shorty\Provider\Chain();
$chainShortener->addProvider($googleShortener); // see example above
$chainShortener->addProvider($bitlyShortener);

$shortUrl       = $chainShortener->shorten('http://www.verylastroom.com/');
$longUrl        = $chainShortener->expand('http://goo.gl/YY5Tz');

Unit Tests

You can run tests with:

bin/atoum -d tests/units

Release notes

1.1.0

  • Added Chain provider.

1.0.0

  • Added Google Url Shortener.
  • Added Bitly Url Shortener.
  • Added Curl Http adapter.

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 5
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-21