PHPackages                             artoodetoo/urly - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. artoodetoo/urly

ActiveLibrary

artoodetoo/urly
===============

Minimum viable URL shortener class

v0.1.0(9y ago)019MITPHPPHP &gt;=5.6

Since Dec 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/artoodetoo/urly)[ Packagist](https://packagist.org/packages/artoodetoo/urly)[ RSS](/packages/artoodetoo-urly/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Urly - Minimum viable URL shortener
===================================

[](#urly---minimum-viable-url-shortener)

Do you want to encode URLs like tinyurl.com does?
This is helper tool for you.

### Features

[](#features)

Urly uses PDO interface to store URLs. Just refer to your existing connection.

Optionally you can specify table name, key encode base and XOR mask.

Access methods are quite obvious: `set($url)` and `get($key)`.

### Install

[](#install)

To install with composer:

```
composer require artoodetoo/urly
```

Required table structure:

```
CREATE TABLE `urly` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `url` varchar(1000) NOT NULL,
  PRIMARY KEY (`id`)
)
```

### Basic Usage

[](#basic-usage)

Save URL and het encoded key:

```
$db = new \PDO(
    'mysql:dbname=homestead;host=127.0.0.1;charset=utf8',
    'homestead',
    'secret'
);

// Set 62 base to get alfa-numeric key in both cases and
// some magic number to make key sequence be less predictable
$shortener = new \R2\Utility\Urly($db, 'my_urly', 62, 990749);

$key = $shortener->set('http://localhost/test.txt');
echo 'http://go.to/'.$key."\n"; // Something like 'http://go.to/49Jz'
```

Get URL by key:

```
echo $shortener->get('49Jz'); // Saved URL or empty string if not found
```

### License

[](#license)

The Urly is open-source software, licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3418d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b982e008c16f8ed2e586e900267b93b01114c28edad839b80b2bad2f4cf1a15d?d=identicon)[artoodetoo](/maintainers/artoodetoo)

---

Top Contributors

[![artoodetoo](https://avatars.githubusercontent.com/u/577710?v=4)](https://github.com/artoodetoo "artoodetoo (1 commits)")

---

Tags

urlshortener

### Embed Badge

![Health badge](/badges/artoodetoo-urly/health.svg)

```
[![Health](https://phpackages.com/badges/artoodetoo-urly/health.svg)](https://phpackages.com/packages/artoodetoo-urly)
```

###  Alternatives

[yourls/yourls

Your Own URL Shortener

11.9k27.7k1](/packages/yourls-yourls)[mremi/url-shortener

A PHP5/PHP7/PHP8 library using API to shorten/expand URL

79719.0k6](/packages/mremi-url-shortener)[laracrafts/laravel-url-shortener

Powerful URL shortening tools in Laravel

97110.7k](/packages/laracrafts-laravel-url-shortener)[gallib/laravel-short-url

A Laravel package to shorten urls

16516.4k](/packages/gallib-laravel-short-url)[yorcreative/laravel-urlshortener

A laravel url shortener package that provides internal url redirects with passwords, url expirations, open limits before expiration and click tracking out of the box.

12011.0k](/packages/yorcreative-laravel-urlshortener)[mremi/url-shortener-bundle

Implementation of UrlShortener library for Symfony2/Symfony3

19135.0k](/packages/mremi-url-shortener-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
