PHPackages                             spazzmarticus/tus-server - 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. [API Development](/categories/api)
4. /
5. spazzmarticus/tus-server

ActiveLibrary[API Development](/categories/api)

spazzmarticus/tus-server
========================

Tus.io-protocol server implementation using PSR standards

2.0.0(2y ago)818.7k↓42.9%2GPL-3.0-or-laterPHPPHP ^8.2|^8.3CI failing

Since Mar 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/SpazzMarticus/TusServer)[ Packagist](https://packagist.org/packages/spazzmarticus/tus-server)[ RSS](/packages/spazzmarticus-tus-server/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (23)Used By (0)

Tus - Server
============

[](#tus---server)

A **server** implementation of the [*"tus.io Resumable File Uploads"*](https://tus.io/) protocol using PSR HTTP standards.

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

[](#installation)

Use [composer](https://getcomposer.org/) to install:

```
composer require spazzmarticus/tus-server
```

Don't forget to install a [PSR-7](https://packagist.org/providers/psr/http-message-implementation) and [PSR-17](https://packagist.org/providers/psr/http-factory-implementation) implementation you want to use.

[PSR](https://www.php-fig.org/)
-------------------------------

[](#psr)

### Implements

[](#implements)

- [PSR-15: HTTP Server Request Handlers](https://www.php-fig.org/psr/psr-15/) - `TusServer` implements `Psr\Http\Server\RequestHandlerInterface`

### Uses

[](#uses)

- [PSR-3: Logger Interface](https://www.php-fig.org/psr/psr-3/) - *(optional)* Pass a `Psr\Log\LoggerInterface` to `TusServer`
- [PSR-7: HTTP Message Interface](https://www.php-fig.org/psr/psr-7) - An instance of `Psr\Http\Message\ServerRequestInterface` must be passed to `TusServer` .
- [PSR-17: HTTP Factories](https://www.php-fig.org/psr/psr-17) - Responses are created by using a ` Psr\Http\Message\ResponseFactoryInterface`
- [PSR-16: Simple Cache](https://www.php-fig.org/psr/psr-16) - Is used to **store** metadata (path to the file, `Upload-Metadata` passed by client, ... ) while uploading. \[see ["Cache as storage?!"](#cache-as-storage) below\]
- [PSR-12: Extended Coding Style Guide](https://www.php-fig.org/psr/psr-12) - Code is written and formatted according to PSR-12.

Demo
----

[](#demo)

You can demo `TusServer` by installing the dev-dependencies ( `composer install` ) and running the provided `server.php` :

```
php -S localhost:8000 example/server.php
```

Open your browser, surf to [localhost:8000/](http://localhost:8000/) and use ([Uppy](https://uppy.io/)) to upload.

Uploads are stored at `example/uploads/...` , the filesystem cache is at `example/cache/` .

Surf to [localhost:8000/reset](http://localhost:8000/reset) to **permanently delete** *uploads*, *intermediate chunks* and the *metadata-storage*. There might be an error log at `example/log/php-error.php` and a server log at `example/log/tus-server.log` containing some additional information.

Test
----

[](#test)

Automated testing is done with:

- [PHPUnit](https://github.com/sebastianbergmann/phpunit) - unit- and integration-tests
- [newman](https://github.com/postmanlabs/newman) - Verify `TusServer` meets the tus. io-protocol.

Examples
--------

[](#examples)

- [Slim v4](https://github.com/SpazzMarticus/TusServer-Example-Slim) - Slim routes allow to directly call this tus-server implementation.

> 👋 This is how I use tus-server.

Cache as storage?!
------------------

[](#cache-as-storage)

`TusServer` needs something fast to store metadata about uploads. Since the payload is small and performance is important, caches can be used.

Instead of using a volatile cache only, you should use a chain containing both a fast volatile **and** a slower non-volatile cache. (Losing the metadata mid-upload does not allow for resuming uploads. )

> 👋 I use [symfony/cache](https://github.com/symfony/cache):
>
> ```
>  $volatileCache = new Symfony\Component\Cache\Adapter\ApcuAdapter('...');
>  $nonVolatileCache = new Symfony\Component\Cache\Adapter\FilesystemAdapter('', 0, __DIR__ . '/...');
>
>  $cacheChain = new Symfony\Component\Cache\Adapter\ChainAdapter([$volatileCache, $nonVolatileCache]);
>
>  $storage = new Symfony\Component\Cache\Psr16Cache($cacheChain);
> ```

Alternatives
------------

[](#alternatives)

- [ankitpokhrel/tus-php](https://github.com/ankitpokhrel/tus-php) - Did not provide enough flexibility for my needs and is the reason I decided to start my own implementation. (Provides a php tus-client, if you are looking for that.)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 90.7% 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 ~89 days

Recently: every ~79 days

Total

21

Last Release

477d ago

Major Versions

0.2.3 → 1.0.02020-08-13

1.2.0 → 2.0.0-rc12024-03-12

1.2.1 → 2.1.0-rc12025-01-16

PHP version history (2 changes)0.2.3PHP &gt;=7.4.0

2.0.0-rc1PHP ^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7671dde90009502e4cdb4576dba1a34d1db8aecd12a2eed1dbbf72b7d27a8e87?d=identicon)[SpazzMarticus](/maintainers/SpazzMarticus)

---

Top Contributors

[![SpazzMarticus](https://avatars.githubusercontent.com/u/5716457?v=4)](https://github.com/SpazzMarticus "SpazzMarticus (78 commits)")[![darthf1](https://avatars.githubusercontent.com/u/17253332?v=4)](https://github.com/darthf1 "darthf1 (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

phpresumable-uploadtustus-protocol

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spazzmarticus-tus-server/health.svg)

```
[![Health](https://phpackages.com/badges/spazzmarticus-tus-server/health.svg)](https://phpackages.com/packages/spazzmarticus-tus-server)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)

PHPackages © 2026

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