承接 vinelab/url-shortener 相关项目开发

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

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

vinelab/url-shortener

Composer 安装命令:

composer require vinelab/url-shortener

包简介

URL shortening the easy way.

README 文档

README

Latest Stable Version Latest Unstable Version Total Downloads Build Status Scrutinizer Code Quality License

vinelab/url-shortener is a PHP framework agnostic Package that makes it easy to shorten your URL's, with your favourite URL Shortening provider such as (Bit.ly, Goo.gl, Ow.ly).

The URL Shortening Providers are online services that takes long URLs and squeezes them into fewer characters to make the link easier to share, tweet, or send by email.

The package requires PHP 5.4+ and comes bundled with a Laravel 5 Facade and a Service Provider to simplify the optional framework integration and follows the FIG standard PSR-4 to ensure a high level of interoperability between shared PHP code and is fully unit-tested.

Highlights

Installation

The recommended way to install this package is via Composer.

Via Composer

A. Run this composer command:

	composer require vinelab/url-shortener:*

B. Or manually add the package to your composer.json and run composer update.

    {
        "require": {
            "vinelab/url-shortener": "*"
        }
    }

Integrations

url-shortener is framework agnostic and as such can be integrated easily natively or with your favorite framework.

Laravel:

The url-shortener package has optional support for Laravel 5 and it comes bundled with a Service Provider for easier integration.

After you have installed the package correctly, just follow the instructions.

.1. Register the service provider in your config/app.php:

    'providers' => array(
        ...
		'Vinelab\UrlShortener\UrlShortenerServiceProvider'
    ),

The service provider will automatically alias the Vinelab\UrlShortener\Shorten class, so you can easily use the Shorten facade anywhere in your app.

.2. Publish the configuration file:

php artisan vendor:publish --provider ='Vinelab\UrlShortener\UrlShortenerServiceProvider'

Configuration

.1. Open url-shortener.php and select your default provider:

	'default' => 'bitly',

.2. Then add your provider token:

        'bitly' => [
            'domain' => 'https://api-ssl.bitly.com',
            'endpoint' => '/v3/shorten',
            'token' => 'YOUR-TOKEN-HERE',
        ],

Note: It's very recommended to not add your token (any sensetive data) to the config file instead reference it to a .env variable.

And to do so:

  1. replace the 'token' => 'YOUR-TOKEN-HERE', with 'token' => env('BITLY_TOKEN'),

  2. open your .env file and add the token variable there with the token value: BITLY_TOKEN=YOUR-TOKEN-HERE.

  3. add the variable BITLY_TOKEN= to the .env.example for other developers.

Usage

With Laravel:

The easiest way is to use it is by the Shorten facade.

$long_url = 'http://testing.tst/something/12345/something-else/54321';

$short_url = Shorten\Shorten::url($long_url); // returns the short version of the long_url as a string

Test

To run the tests, run the following command from the project folder.

$ ./vendor/bin/phpunit

Contributing

Support new provider

To add support for a new URL shortening provider:

  1. write a driver for your URL Shortener service. check the Bitly driver Vinelab\UrlShortener\Drivers\Bitly class.
  2. add you driver configuration to the config file.
  3. write tests for your drvier.
  4. update the README file
  5. check out the Contribution Guide for general details.

Support

On Github

Security

If you discover any security related issues, please email abed.halawi@vinelab.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

vinelab/url-shortener 适用场景与选型建议

vinelab/url-shortener 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.19k 次下载、GitHub Stars 达 59, 最近一次更新时间为 2015 年 05 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「url」 「bitly」 「laravel」 「bit.ly」 「url shortener」 「shorten」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 vinelab/url-shortener 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 vinelab/url-shortener 我们能提供哪些服务?
定制开发 / 二次开发

基于 vinelab/url-shortener 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 59
  • Watchers: 9
  • Forks: 19
  • 开发语言: PHP

其他信息

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