PHPackages                             timostamm/web-resource - 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. timostamm/web-resource

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

timostamm/web-resource
======================

PHP Web Resources

v2.1.0(2mo ago)055311MITPHPPHP ^8.0CI passing

Since Dec 19Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/timostamm/web-resource)[ Packagist](https://packagist.org/packages/timostamm/web-resource)[ RSS](/packages/timostamm-web-resource/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (10)Versions (15)Used By (1)

PHP Web Resources
=================

[](#php-web-resources)

[![build](https://github.com/timostamm/web-resource/workflows/CI/badge.svg)](https://github.com/timostamm/web-resource/actions?query=workflow:%22CI%22)[![Packagist PHP Version](https://camo.githubusercontent.com/d82e52a39733bdc7eaf44bf47acd170cccff0453d911a8b7e58c2e0fb8f74b02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f74696d6f7374616d6d2f7765622d7265736f757263652f706870)](https://camo.githubusercontent.com/d82e52a39733bdc7eaf44bf47acd170cccff0453d911a8b7e58c2e0fb8f74b02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f74696d6f7374616d6d2f7765622d7265736f757263652f706870)[![GitHub tag](https://camo.githubusercontent.com/cb26edaf6219c64dd605cc3aaa346e9ee9ff5146d41b91ab92232c6aa5daf52b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f74696d6f7374616d6d2f7765622d7265736f757263653f696e636c7564655f70726572656c65617365733d26736f72743d73656d76657226636f6c6f723d626c7565)](https://github.com/timostamm/web-resource/releases/)[![License](https://camo.githubusercontent.com/d6bc2b26794002c24d023acaab01b6dbb953c57ab9cb80ba5b8aa2f2bd5de99a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c7565)](#license)

A collection of classes that represent resources, suited for delivery to a HTTP client.

The benefit of these classes is a common interface that bundles the data stream with a bunch of metadata like mimetype, modification date, etc.

This abstraction makes caching, lazy processing, media type conversion and other pipelined operations much more convenient than handling files.

#### Example

[](#example)

```
// In a Symfony Controller:
$res = Resource::fromFile('dir/my-file.txt');
$res->getMimetype(); // guessed mimetype
return new ResourceResponse($res);

// Fetch a resource from an URL:
$res = Resource::fromUrl('http://foo.bar/my-file.txt');
$res->getMimetype(); // mimetype from server
$res->getLastModified(); // modification date from server

// Overriding a mimetype and the file name:
$res = Resource::fromFile('dir/my-file.txt', [
	'mimetype' => 'applicatio/octet-stream',
	'filename' => 'text.txt'
]);
return new ResourceResponse($res); // will also set the appropriate content-disposition header
```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance88

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 67.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 ~223 days

Recently: every ~275 days

Total

13

Last Release

60d ago

Major Versions

v1.2.1 → v2.0.02025-09-15

PHP version history (5 changes)v1.0.0PHP &gt;=5.5

v1.1.0PHP ^7.1

v1.1.5PHP &gt;=7.1

v1.2.0PHP ^7.2 || ^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6364011a12f22cb5046056371bde6170218218c560eddfdc08b4644b7648af78?d=identicon)[timostamm](/maintainers/timostamm)

---

Top Contributors

[![timostamm](https://avatars.githubusercontent.com/u/4289451?v=4)](https://github.com/timostamm "timostamm (42 commits)")[![ducrot](https://avatars.githubusercontent.com/u/3525119?v=4)](https://github.com/ducrot "ducrot (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timostamm-web-resource/health.svg)

```
[![Health](https://phpackages.com/badges/timostamm-web-resource/health.svg)](https://phpackages.com/packages/timostamm-web-resource)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[spatie/flare-client-php

Send PHP errors to Flare

177156.9M21](/packages/spatie-flare-client-php)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[illuminate/validation

The Illuminate Validation package.

18837.7M1.6k](/packages/illuminate-validation)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)

PHPackages © 2026

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