PHPackages                             coppolafab/php-url-signer - 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. coppolafab/php-url-signer

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

coppolafab/php-url-signer
=========================

Create signed URLs with an expiring date

v3.0.0(5y ago)223ISCPHPPHP ~7.4 || ~8.0.0

Since Nov 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/coppolafab/php-url-signer)[ Packagist](https://packagist.org/packages/coppolafab/php-url-signer)[ RSS](/packages/coppolafab-php-url-signer/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Create signed URLs with an expiring date
========================================

[](#create-signed-urls-with-an-expiring-date)

[![License](https://camo.githubusercontent.com/f1211b41ec82385c27e53c5e4e930a7ef059665c20c1d44b4edde134f402ce20/68747470733a2f2f706f7365722e707567782e6f72672f636f70706f6c616661622f7068702d75726c2d7369676e65722f6c6963656e7365)](//packagist.org/packages/coppolafab/php-url-signer)[![Minimum PHP Version](https://camo.githubusercontent.com/1d151aaab56ac9f1a73698dc3fa09177e16b917d3a439a4f76d3535c7c546562/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253745372e34253230253743253743253230253745382e302e302d626c75652e7376673f7374796c653d666c6174)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/06e2f65c4253c07266ccc1b148ce72dd6275bfef6e0a99fcd6db07498228def1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f70706f6c616661622f7068702d75726c2d7369676e65722e737667)](https://packagist.org/packages/coppolafab/php-url-signer)[![Mutation testing badge](https://camo.githubusercontent.com/4f32189b2d0ae379347e6fa47a9bfa7d7b33c8b425bfee69c087db34b0407206/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246636f70706f6c616661622532467068702d75726c2d7369676e65722532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/coppolafab/php-url-signer/main)[![Type Coverage](https://camo.githubusercontent.com/3dddccd1f01b61dfa4e568fc6f82cbacbe7cddee7bf689ccebe1978fcd5f2600/68747470733a2f2f73686570686572642e6465762f6769746875622f636f70706f6c616661622f7068702d75726c2d7369676e65722f636f7665726167652e737667)](https://shepherd.dev/github/coppolafab/php-url-signer)

A PHP library for signing URLs and verify their validity.

It works by appending a computed signature and an expiring timestamp to an URL. The generated URL is valid if its data is not altered in any way and until the specified expiring time.

A signed URL possession, provides limited time to perform a request, and can transport publicly visible query parameters, for example tokens and other not sensitive data, without the need to store them in a backend storage like session or cache.

Some use cases:

- Login links
- Password reset links
- Email confirmation links
- etc.

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

[](#installation)

Install via Composer:

```
composer require coppolafab/php-url-signer
```

Usage
-----

[](#usage)

```
use coppolafab\UrlSigner\HashHmacUrlSigner;
use DateTimeImmutable;

$urlSigner = new HashHmacUrlSigner('valid'  /** signature key */);

// valid until 2020-09-13T12:26:40+00:00
$expirationDate = (new DateTimeImmutable())->setTimestamp(1600000000);

$signedUrl = $urlSigner->sign('https://example.com/', $expirationDate);
// 'https://example.com/?url_expires_at=1600000000&signature=d6ebe19e590813d94d1b58fe9f9e204a3c5f074ac791dbf0fc2bc3631091f2f1'

$isValid = $urlSigner->verify($signedUrl);
// true, if verified before $expirationDate
```

Testing
-------

[](#testing)

- Coding Style: `$ vendor/bin/phpcs`
- Unit tests: `$ vendor/bin/phpunit`
- Static analysis - PHPStan: `$ vendor/bin/phpstan analyse`
- Static analysis - Psalm: `$ vendor/bin/psalm`
- Mutation Testing - Infection: `vendor/bin/infection`

### Docker

[](#docker)

A docker-compose.yml file is included, with a pre-configured image that builds PHP8 and pcov.

```
# build image
docker-compose build
# install dependencies
docker-compose run --rm php-url-signer composer install
# run tests
docker-compose run --rm php-url-signer vendor/bin/phpunit
docker-compose run --rm php-url-signer ...
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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

Every ~13 days

Total

4

Last Release

2012d ago

Major Versions

v1.0.1 → v2.0.02020-11-28

v2.0.0 → v3.0.02020-12-28

PHP version history (2 changes)v1.0.0PHP ^7.4

v2.0.0PHP ~7.4 || ~8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4855987?v=4)[coppolafab](/maintainers/coppolafab)[@coppolafab](https://github.com/coppolafab)

---

Top Contributors

[![coppolafab](https://avatars.githubusercontent.com/u/4855987?v=4)](https://github.com/coppolafab "coppolafab (12 commits)")[![friendzapp](https://avatars.githubusercontent.com/u/35966806?v=4)](https://github.com/friendzapp "friendzapp (1 commits)")

---

Tags

urllinksignedexpire

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/coppolafab-php-url-signer/health.svg)

```
[![Health](https://phpackages.com/badges/coppolafab-php-url-signer/health.svg)](https://phpackages.com/packages/coppolafab-php-url-signer)
```

###  Alternatives

[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6758.1M80](/packages/jbroadway-urlify)[misd/linkify

Converts URLs and email addresses in text into HTML links

1163.2M12](/packages/misd-linkify)[shivella/laravel-bitly

Laravel package for generating bitly url

75867.0k1](/packages/shivella-laravel-bitly)[voku/urlify

PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.

274.2M8](/packages/voku-urlify)[mattwright/urlresolver

PHP class that attempts to resolve URLs to a final, canonical link.

66183.6k](/packages/mattwright-urlresolver)[linkeys/signed-url

Enhanced signed URLs for Laravel, including attaching data, click limits and expiry.

2265.2k1](/packages/linkeys-signed-url)

PHPackages © 2026

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