PHPackages                             wbf/compiler - 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. wbf/compiler

ActiveLibrary

wbf/compiler
============

An helper component for styles compiling

06PHP

Since Dec 1Pushed 9y ago3 watchersCompare

[ Source](https://github.com/wagaweb/wbf_compiler)[ Packagist](https://packagist.org/packages/wbf/compiler)[ RSS](/packages/wbf-compiler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Styles Compiler
===============

[](#styles-compiler)

An extensible style compiler.

By now it has a build-in Less compiler, but developers can implement new compilers thanks to Base\_Compiler interface.

Usage example for LESS files
----------------------------

[](#usage-example-for-less-files)

```
//Setup the base compiler:
$output_dir = "...."

$base_compiler = new WBF\components\compiler\less\Less_Compiler([
    "sets" => [
        "theme_frontend" => [
            "input" => get_stylesheet_directory()."/assets/src/less/input.less",
            "output" => $output_dir."/output.css",
            "map" => $output_dir."/output.css.map",
            "map_url" => $output_uri."/output.css.map",
            "cache" => get_stylesheet_directory()."/assets/cache",
            "import_url" => get_stylesheet_directory_uri(),
            "primary" => true //This is the primary set (by now this is just a label for further usage)
        ]
    ],
    "sources_path" => get_stylesheet_directory()."/assets/src/less/"
]);

//Create a new instance of compiler
$c = new components\compiler\Styles_Compiler($base_compiler); //This is a wrapper which rely on Base_Compiler implementation of $base_compiler.

$c->compile(); //Wraps the call to $base_compiler compile() method
```

The compile actions is more useful if hooked at some WordPress or user action.

Sets
----

[](#sets)

Base\_Compiler provides `add_set()` and `remove_set()` functions and the `compile()` functions allows to specify a set name to compile. So new compilers have to be developed with this concept in mind.

A set has a name and some properties specified with an array.

This is, for example, a set valid for Less\_Compiler:

```
[
    "input" => "...",
    "output" => "...",
    "map" => "...",
    "map_url" => "...",
    "cache" => "...",
    "import_url" => "...",
    "primary" => true
]

```

The number of properties is arbitrary.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecab5a59cfdd434af4feb082bcb4c24e264ea99574713c876789c3ea8a088c65?d=identicon)[Waga Dev](/maintainers/Waga%20Dev)

---

Top Contributors

[![LostCore](https://avatars.githubusercontent.com/u/2674299?v=4)](https://github.com/LostCore "LostCore (14 commits)")

### Embed Badge

![Health badge](/badges/wbf-compiler/health.svg)

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

PHPackages © 2026

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