PHPackages                             ricwein/shurl - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ricwein/shurl

AbandonedArchivedProject[Utility &amp; Helpers](/categories/utility)

ricwein/shurl
=============

PHP based URL shortener

v1.0(8y ago)23[1 PRs](https://github.com/ricwein/shurl/pulls)MITPHPPHP &gt;= 7.0.0

Since Aug 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ricwein/shurl)[ Packagist](https://packagist.org/packages/ricwein/shurl)[ RSS](/packages/ricwein-shurl/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

shurl
=====

[](#shurl)

> Another PHP based URL shortener.

Install
-------

[](#install)

### project

[](#project)

To create a new shurl instance, the project can be initialized through composer, just run the following command:

```
composer create-project ricwein/shurl -s dev
```

### Database

[](#database)

Initializing the Database structure can be done two ways. Either run the static queries from [resources/database/database.sql](resources/database/database.sql), or use the `init` commandline tool.

> This tool requires you, to first setup your wished database configuration! This can be done, as described in [Configuration](#configuration). A valid Database-user is required, and needs either: the database to be already existing, or rights to create a new one.

```
bin/shurl init
```

Since this tool, acknowledges your database-configuration, the resulting database-structure is customizable! use table-prefixes, custom charsets, or even another database name!

Configuration
-------------

[](#configuration)

The default configuration is stored in [src/Config/Config.php](src/Config/Config.php) `$__config` Array, but can be overwritten by adding a config-file at `config/config.yml`. It should has the following format:

```
---
database:
  username: usernamehere
  prefix: shurl_

cache:
  enabled: true
```

This way it's possible, to override each single setting.

You can copy an example file to start with

```
cp config/example.config.yml config/config.yml
```

### rootURL

[](#rooturl)

For some features, shurl need to know your webservers Domain and Path to shurl. This URL can be set inside the described configfile:

```
---
rootURL: https://fancy.url
```

Adding a new URL
----------------

[](#adding-a-new-url)

Adding a new URL to the shortener Server is done with the bundled CLI tool. Just run `bin/shurl url:add`, and follow the instructions. For more Informations see `bin/shurl url:add --help`.

Remove an URL
-------------

[](#remove-an-url)

Removing an URL from the list, is as easy as adding one. Execute `bin/shurl url:remove` from your command line should do the job.

List available URLs
-------------------

[](#list-available-urls)

A list of all currently available URls can be accessed through: `bin/shurl url:show`

Routes
------

[](#routes)

There are several different routes, which are supported by shurl.

- **/** The root displays a welcome message
- **/*{slug}*** redirects to a given url
- **/preview/*{slug}*** shows a resolved-URL preview
- **/api/*{slug}*** exposes a simple JSON api (`GET` Method), which provides access to the resolved URL

```
[{
	"slug": "shurl",
	"original": "https:\/\/s.ricwein.com"
}]
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

3236d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e4c46b9e849423ff1355ff0a8dc5046c29e636308378f44ed0a55933f749e83?d=identicon)[ricwein](/maintainers/ricwein)

---

Top Contributors

[![ricwein](https://avatars.githubusercontent.com/u/870354?v=4)](https://github.com/ricwein "ricwein (72 commits)")

---

Tags

composer-projectmysqlphpself-hostedshorturlurl-shortenerurlshortener

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ricwein-shurl/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k16.6k1](/packages/phpactor-phpactor)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M526](/packages/shopware-core)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)

PHPackages © 2026

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