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

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

davidecesarano/embryo-assets
============================

Simple PHP library that combines, minify and serves css or javascript files in inline mode or in a bundle file.

1.0.1(5y ago)0581MITPHPPHP &gt;=7.1

Since Aug 30Pushed 5y ago1 watchersCompare

[ Source](https://github.com/davidecesarano/Embryo-Assets)[ Packagist](https://packagist.org/packages/davidecesarano/embryo-assets)[ Docs](https://github.com/davidecesarano/embryo-assets)[ RSS](/packages/davidecesarano-embryo-assets/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

Embryo Assets
=============

[](#embryo-assets)

Embryo Assets is a simple PHP library that combines, minify and serves css or javascript files in inline mode or in a bundle file.

Features
--------

[](#features)

- Files combined, compressed and cached until they are modified.
- Uses an online service provided by Andy Chilton, .
- Replace relative path with root public path in css file.
- PSR-7 compatible.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1
- A [PSR-7](https://www.php-fig.org/psr/psr-7/) http message implementation and [PSR-17](https://www.php-fig.org/psr/psr-17/) http factory implementation (ex. [Embryo-Http](https://github.com/davidecesarano/Embryo-Http))

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

[](#installation)

Using Composer:

```
$ composer require davidecesarano/embryo-assets

```

Usage
-----

[](#usage)

```
use Embryo\Assets\Assets;
use Embryo\Http\Factory\ServerRequestFactory;

$request = (new ServerRequestFactory)->createServerRequestFromServer();
$css = Assets::css([
    '/path/to/css/file1.css',
    '/path/to/css/file2.css',
    '/path/to/css/file3.css'
])
->setRequest($request)
->build('/path/to/source/compilers/');
```

This will produce:

```
/path/to/compilers/app.css.map -> Sources array
/path/to/compilers/app.css -> Css code

```

Now, you may use it in your template file:

```

```

Files are combined, compressed and cached in one file. When you modify one file or change array css file, it compiling the file again.

You may quickly test this using the built-in PHP server going to .

```
$ cd example
$ php -S localhost:8000

```

### Use bundle

[](#use-bundle)

If you want include bundle file instead of inline mode, be sure the compile file in a public folder (for example, in `assets` folder).

```
Assets::css([
    '/path/to/css/file1.css',
    '/path/to/css/file2.css',
    '/path/to/css/file3.css'
])
->setRequest($request)
->build('/path/to/assets/');
```

Now, you may include the file in `` tag:

```

```

### JS

[](#js)

It's same the CSS example. You must replace css static method with `js` static method.

Options
-------

[](#options)

### `forceBuild(bool $forceBuild): self`

[](#forcebuildbool-forcebuild-self)

If `true` build file for every request. Default is `false`.

### `setFilename(string $filename): self`

[](#setfilenamestring-filename-self)

Set the filename. Default is `app`.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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 ~69 days

Total

2

Last Release

2011d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16277144?v=4)[Davide Cesarano](/maintainers/davidecesarano)[@davidecesarano](https://github.com/davidecesarano)

---

Top Contributors

[![davidecesarano](https://avatars.githubusercontent.com/u/16277144?v=4)](https://github.com/davidecesarano "davidecesarano (1 commits)")

---

Tags

php minifierphp minify jsphp minify css

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mirazmac/dotenvwriter

A PHP library to write values to .env (DotEnv) files

19129.3k7](/packages/mirazmac-dotenvwriter)[joegreen0991/config

Config component based on laravel's

233.3k](/packages/joegreen0991-config)

PHPackages © 2026

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