PHPackages                             tekton/assets - 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. tekton/assets

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

tekton/assets
=============

An asset manager that can easily read manifests and also compile and combine assets.

3.0.0(7y ago)0652MITPHPPHP &gt;=7.0.0

Since Mar 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tekton-php/assets)[ Packagist](https://packagist.org/packages/tekton/assets)[ Docs](https://github.com/tekton-php/assets)[ RSS](/packages/tekton-assets/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (7)Used By (2)

Tekton Assets
=============

[](#tekton-assets)

An asset manager that supports asset manifests, queues and compilation/minification.

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

[](#installation)

```
composer require tekton/assets
```

Usage
-----

[](#usage)

### Basic

[](#basic)

The AssetManager and AssetCompiler can be used separately but are designed to work together to make asset management and processing as simple and pain free as possible.

To use it, create an instance of AssetManager and provide the filesystem and web root for your application.

```
require 'vendor/autoload.php';

use Tekton\Assets\AssetManager;

$manager = new AssetManager(__DIR__, 'http://localhost:8000/');

// Get file path and URL
$path = $manager->get('images/logo.png')->path();
$url = $manager->get('images/logo.png')->url();
```

Queues are a way to group different assets together similarily to how WordPress handles assets. Dependencies can be defined and the resulting list will be sorted in order.

```
use Tekton\Assets\AssetManager;

$manager->queue('scripts')->add('jquery', 'js/jquery.min.js');
$manager->queue('scripts')->add('app', 'js/app.js', ['jquery']);

// Output every script
foreach ($manager->queue('scripts')->all() as $asset) {
    echo '';
}
```

If assets are revisioned for cache busting as a build system step you can load the manifest and the AssetManager will first try and resolve the asset through the manifest before checking the filesystem. An AssetManifest require a cache directory so that JSON/YML files aren't parsed every request.

```
use Tekton\Assets\AssetManifest;

$manager->setManifest(new AssetManifest('manifest.json', 'cache/'));
```

### Compilation

[](#compilation)

The AssetManager also supports configuring an AssetCompiler that enables processing of files server side.

```
use Tekton\Assets\AssetCompiler;
use Tekton\Assets\Filters\MinifyFilter;

$compiler = new AssetCompiler('cache/', 'http://localhost:8000/cache/');
$compiler->registerFilter('minify', new MinifyFilter);

$manager->setCompiler($compiler);

// Compile single file
echo '';

// Compile queue
$manager->queue('styles')->add('one', 'css/one.css');
$manager->queue('styles')->add('two', 'css/two.css', ['one']);

foreach ($manager->queue('styles')->compile('minify') as $asset) {
    echo '';
}

// OR combine queue into single file
echo '';
```

For whenever cache needs to be invalidated by testing more than just one source file you can add an array of files to check for changes.

```
use Tekton\Assets\Filters\ScssFilter;

$compiler->registerFilter('scss', new ScssFilter);

// Compile SCSS and test all SCSS files for changes
echo '';

// For queues the additional paths to test are the third argument
$manager->queue('styles')->add('vendor', 'css/vendor.css');
$manager->queue('styles')->add('app', 'scss/main.scss', ['vendor']);

foreach ($manager->queue('styles')->compile('scss', false, glob('scss/*.scss')) as $asset) {
    echo '';
}
```

### Performance

[](#performance)

As much as possible is cached to avoid filesystem interactions and recompilation. But for production it's advisable to disable file modification time checks (especially if you're compiling SCSS with many additional files to test for changes) and only compile if resulting file is missing. Then you'll have to empty the cache manually or as a post-deployment step.

```
$compiler->setIgnoreCacheTime(true);

// After deployment...
$compiler->clearCache();
```

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~121 days

Recently: every ~151 days

Total

6

Last Release

2782d ago

Major Versions

1.0.1 → 2.0.02018-06-18

2.0.2 → 3.0.02018-11-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc4837ce5eb1f32142e8aefef1d53e10ae638fcff864e1c7c67c1e5b2b496e85?d=identicon)[nsrosenqvist](/maintainers/nsrosenqvist)

---

Top Contributors

[![nsrosenqvist](https://avatars.githubusercontent.com/u/1303475?v=4)](https://github.com/nsrosenqvist "nsrosenqvist (9 commits)")

### Embed Badge

![Health badge](/badges/tekton-assets/health.svg)

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

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)

PHPackages © 2026

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