PHPackages                             pean/wash - 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. pean/wash

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

pean/wash
=========

Tiny URL Shortener

00PHP

Since May 14Pushed 10y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Wash Tiny URL Shortener
=======================

[](#wash-tiny-url-shortener)

Wash is tiny url shortener composer package that will store a url and return a tiny url from a JSON REST API request.

It is build to work from the index file and will identify a tiny url and redirect or else continue with your regular website. Some .htaccess magic might be required though.

I use this together with a keyword workfow in [Alfred](http://www.alfredapp.com/) that will copy the shortened url to clipboard.

Wash can also be used with the [Wash Android App](https://github.com/pean/wash-android)

Hits on shortened url will create a pageview in Google Analytics.

Wash is available on [Packagist](https://packagist.org/packages/pean/wash)

This is built for my own use as I happen to own a super short domain and needed something self-hosted.

/Peter

API Call to create url
----------------------

[](#api-call-to-create-url)

POST Payload:

```
{
  "token": "TOKEN",
  "url": "http://wa.se"
}

```

Return:

```
http://wa.se/s5f4

```

Error response:

```
{
  "status": 0,
  "errorMsg": "Descriptive error message"
}

```

CURL Example
------------

[](#curl-example)

```
curl —X POST -d '{ "token": "TOKEN","url": "http://wa.se" }' http://wa.se/

```

Install
=======

[](#install)

Add this to composer.json:

```
"require": {
  "pean/wash": "dev-master",
},

```

Create the tables from `tables.sql` and then do this:

Set up .htaccess something like this:

```
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9]+)$ index.php [L]

```

And the run everything:

```
$wash = new Pean\Wash(
  array(
    'db' => array (
      'host' => 'localhost',
      'user' => 'root',
      'passw' => '',
      'db' => 'wa',
    ),
    'salt' => '[something salty]',
    'ga' => array (
      'id' => 'UA-12345-6',
      'site' => 'wa.se'
    ),
    'test' => '0',
    'pushbullet' = array(
      'token' => '658a17ac3a4ce4b2e80887347a2caf8a'
    )
  )
);

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![pean](https://avatars.githubusercontent.com/u/681780?v=4)](https://github.com/pean "pean (28 commits)")

### Embed Badge

![Health badge](/badges/pean-wash/health.svg)

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

###  Alternatives

[react/event-loop

ReactPHP's core reactor event loop that libraries can use for evented I/O.

1.3k139.6M664](/packages/react-event-loop)[safran-cassiopee/php-taf-decoder

TAF weather forecast decoder

1211.2k](/packages/safran-cassiopee-php-taf-decoder)[yahnis-elsts/ajax-wrapper

AJAX action wrapper for WordPress

213.3k](/packages/yahnis-elsts-ajax-wrapper)

PHPackages © 2026

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