PHPackages                             richardowen/url-shortener - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. richardowen/url-shortener

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

richardowen/url-shortener
=========================

A comprehensive URL shortener library with analytics and multiple storage backends

v1.0.0(10mo ago)01MITPHPPHP &gt;=8.0

Since Jul 11Pushed 10mo agoCompare

[ Source](https://github.com/RichardOwen2/url-shortener-php)[ Packagist](https://packagist.org/packages/richardowen/url-shortener)[ Docs](https://github.com/richardowen/url-shortener)[ RSS](/packages/richardowen-url-shortener/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

URL Shortener PHP Library
=========================

[](#url-shortener-php-library)

A comprehensive, well-structured PHP library for URL shortening with analytics tracking and multiple storage backends.

Features
--------

[](#features)

- **URL Shortening &amp; Expansion**: Convert long URLs to short codes and vice versa
- **Analytics Tracking**: Track clicks, referrers, user agents, and timestamps
- **Multiple Storage Backends**: Memory, File, and Database storage options
- **Flexible Code Generation**: Custom strategies for generating short codes
- **PSR Compliance**: Follows PSR-4 autoloading and PSR-12 coding standards
- **Dependency Injection**: Clean architecture with SOLID principles
- **Extensible Design**: Easy to add new storage backends and features

Installation
------------

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require richardowen/url-shortener
```

### Alternative Installation Methods

[](#alternative-installation-methods)

#### From GitHub (Development Version)

[](#from-github-development-version)

```
git clone https://github.com/RichardOwen2/url-shortener-php.git
cd url-shortener-php
composer install
```

#### Specific Version

[](#specific-version)

```
composer require richardowen/url-shortener:^1.0
```

### Requirements

[](#requirements)

- **PHP**: 8.0 or higher
- **Composer**: For dependency management
- **Extensions**: `json`, `pdo` (for database storage)

### Verify Installation

[](#verify-installation)

After installation, create a test file to verify everything works:

```
