Download the PHP package leopardd/url-shortener-bundle without Composer

On this page you can find all versions of the php package leopardd/url-shortener-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package url-shortener-bundle

UrlShortenerBundle

Latest Version on Packagist Build Status

Getting started

Folder structure

Feature & Update & Note

Algorithm

Get "short-url" process

  1. Insert "long-url" into database then return row-id
  2. Encode row-id then save it

Redirect "short-url" process

  1. Decode incoming "short-url" then we get row-id
  2. Return item in that row-id

Reason behind "row-id" approach

Short url: produce shortened version of url

  1. Generate: produce a shortened version of the URL submitted
  2. Lookup: when the shortened version is called, look up this reference in database then return it

And the challenge is

  1. Lookup time
  2. Allow very very large number of unique ids and at the same time
  3. Keep the ID length as small as possible
  4. ID should be sort of user friendly and possibly a memorable (if possible)
  5. Scale with multiple instances (Sharding)
  6. What happens when ID reach the maximum value e.g. (if the length is 7 containing [A-Z, a-z, 0-9], we can serve 62^7 (~35k billion) urls)
  7. Replication, database can be crashed by many problems, how to replicate instances, recover fast ?, keep read / write consistent ?

In this bundle, we will focus on point 1. How we can reduce loop-up time.

So, In this project decide to using "Attemp 4" by using Hashids for hash function (Hashids will generate unique code from difference id)

Reference && Tool

Algorithm


All versions of url-shortener-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ~5.6|~7.0
symfony/framework-bundle Version ~2.6|~3.0
doctrine/orm Version ^2.5
doctrine/doctrine-bundle Version ^1.6
hashids/hashids Version ^2.0
jms/serializer-bundle Version ^1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package leopardd/url-shortener-bundle contains the following files

Loading the files please wait ....