PHPackages                             soq/linkmunch - 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. soq/linkmunch

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

soq/linkmunch
=============

A URL Shortener

24PHP

Since Jul 24Pushed 12y ago1 watchersCompare

[ Source](https://github.com/six0h/linkmun.ch)[ Packagist](https://packagist.org/packages/soq/linkmunch)[ RSS](/packages/soq-linkmunch/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

HootURLs
========

[](#hooturls)

---

\###Foreword I just registered linkmun.ch and it may not be working properly for you yet. If you are on linux, edit your /etc/hosts, or on windows, your C:\\windows\\system32\\drivers\\etc\\hosts file and add the following in a text editor of your choosing:

```
74.208.173.8 linkmun.ch

```

*This is only required if linkmun.ch is not currently working for you*

Framework for HootSuite Technical Test
--------------------------------------

[](#framework-for-hootsuite-technical-test)

\###Introduction
----------------

[](#introduction)

This framework was built at the behest of a technical test supplied by Hootsuite, those crazy social media people. There is an API available with 3 endpoints. There is also a client demo at .

- If you make a POST to linkmun.ch/er asynchronously, you will receive a shortened link back.
- If you make a POST to linkmun.ch/y asynchronously, you will receive the full link back.
- If you make a POST to linkmun.ch/ah asynchronously, you will receive all the links (short/long) back.

Any POST Requests, other than /ah, should include some data sent along in the form of:

```
{ "url": "linkoridhere" }

```

/ah requires no data to be sent

There is no auto-redirection upon providing a link, however, this may be easily implemented, as this app was built with extensibility in mind. I have built in a routing system, which points to a method in the URLController controller, as well as the Twig templating system from Symfony for providing any synchronous pages you may want to implement.

\###Installation
----------------

[](#installation)

\####Composer

```
{
    "require": {
        "soq/linkmunch": "dev-master"
    }
}

```

\####Git

```
git clone http://github.com/six0h/linkmun.ch.git linkmunch/

```

\###Usage
---------

[](#usage)

\####Routing Routing is handled on the server side, and defined directly in the index.php file in the /web directory.

How to add Routes is clearly defined in the index file itself, and follows the order of:

```
$router->add('RouteName','URI','Method');

```

A simple *match* method is used after to match up the actual client URI with your routes:

```
$router->match($_SERVER['REQUEST_URI']);

```

\####The Controller This whole shebang is controlled through one class, the Controller/URLController.php file contains this class, and all methods should be mapped to from the Routing system. If you dont want a method mapped for now, then dont add it to the routing system.

Taking a look through the demo code in this file should be fairly clear, once you have seen the routes that are defined in the routing system. Make sure you look at the routing system before you look at the controllers, so you know what youre looking at as far as methods go.

\####Templating A class has been created to abstract away the Twig API. You may call the Template class from Library/Template.php, which provides a render method in the form of:

```
$tpl = new Template();
$tpl->render('index.html.twig', array('paramtopass'=>'valtopass','anotherparam'=>'anotherval'));

```

\####Models Currently, the framework contains only one model, which is contained in the Model/URLModel.php file. Care to take 3 guesses at what happens here? THE MAGIC BABY! Business Logic happens here.

\###Transport
-------------

[](#transport)

SURPRISE, this baby is packing zeromq, with a whack of workers to whip up some wizardry. Our current demo client POSTs to our API Endpoints, which then relays through ZeroMQ Router,Dealer,Replier, and last (but not least!) Requestor.

Thanks to ZMQ, our messaging happens at breakneck speeds. The client could be optimized to react faster on higher performing hosts, but is currently throttled as far as responses go, to make sure data is properly committed before updating the client display.

\####Broker The workers rely on a broker to relay messages from the client. To run the broker, from the terminal, in the main directory, do:

```
php zmqBroker.php

```

\####Workers How many workers do you wants? How many do you needs? Same deal as the broker, except you can fire up as many as you want with:

```
php zmqWorker.php

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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://avatars.githubusercontent.com/u/2367184?v=4)[Cody Halovich](/maintainers/six0h)[@six0h](https://github.com/six0h)

---

Top Contributors

[![six0h](https://avatars.githubusercontent.com/u/2367184?v=4)](https://github.com/six0h "six0h (21 commits)")

### Embed Badge

![Health badge](/badges/soq-linkmunch/health.svg)

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

###  Alternatives

[itwmw/color-difference

Color difference：Din99,CIE76,CIE1994,CIEDE2000,CMC l:c

178.9k](/packages/itwmw-color-difference)[mdmsoft/yii2-widgets

Widgets for Yii2

178.3k](/packages/mdmsoft-yii2-widgets)

PHPackages © 2026

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