2017 © Pedro Peláez
 

library url-shortener

Make the URLs shorter

image

soleo/url-shortener

Make the URLs shorter

  • Monday, March 21, 2016
  • by soleo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

UrlShortener

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] StyleCI Quality Score ![Total Downloads][ico-downloads], (*1)

A Simple, Self-Hosted URL Shortener with MongoDB., (*2)

Install

Via Composer, (*3)

``` bash $ composer require soleo/url-shortener, (*4)


## Usage ``` php use Soleo\UrlShortener\MongoConnection; use Soleo\UrlShortener\Shorty; require "vendor/autoload.php"; $mongoURI = "mongodb://demo:demodemo@ds045757.mlab.com:45757/url_shortener"; $mongoConn = new MongoConnection($mongoURI); $shorty = new Shorty($mongoConn); if (isset($_GET['longurl'])) { echo $shorty->getShortUrl($_GET['longurl']); exit; } // Get Long URL $slug = preg_replace('[^A-Za-z0-9]', '', $_SERVER['REQUEST_URI']); $longURL = $shorty->getLongUrl($slug, true); header("Location: ".$longURL, true, 302); exit;

Change log

Please see CHANGELOG for more information what has changed recently., (*5)

Testing

bash $ composer test, (*6)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*7)

Security

If you discover any security related issues, please email shaoxinjiang@gmail.com instead of using the issue tracker., (*8)

Credits

License

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

The Versions

21/03 2016