PHPackages                             bradcrumb/bc\_zf-less-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. [Framework](/categories/framework)
4. /
5. bradcrumb/bc\_zf-less-compiler

ActiveLibrary[Framework](/categories/framework)

bradcrumb/bc\_zf-less-compiler
==============================

A LessCompiler Module for ZF2

1.1.1(10y ago)03.4kGNU GENERAL PUBLIC LICENSEPHP

Since Apr 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/BradCrumb/BC_ZFLessCompiler)[ Packagist](https://packagist.org/packages/bradcrumb/bc_zf-less-compiler)[ Docs](https://github.com/BradCrumb/BC_ZFLessCompiler)[ RSS](/packages/bradcrumb-bc-zf-less-compiler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (5)Used By (0)

\#ZendFramework2+ LessCompiler

A module for Zend Framework 2+ to easily compile all of your Less-files by using and extending the Less.PHP Compiler of .

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

[](#requirements)

This module has the following requirements:

- PHP 5.3.0 or greater.
- ZendFramework 2.2 or greater
- Less.PHP Compiler in the vendor map (default git clone will do, or with composer) 1.7.0 or greater

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

[](#installation)

### Composer

[](#composer)

```
php composer.phar require  bradcrumb/bc_zf-less-compiler

```

### Or clone the repository

[](#or-clone-the-repository)

```
git clone https://github.com/BradCrumb/BC_ZFLessCompiler.git

```

### Load Module

[](#load-module)

- Make your application aware of the module by add the module's name to the application.config.php file. ie. return array( // This should be an array of module namespaces used in the application. 'modules' =&gt; array( 'Application', 'BC\_ZFLessCompiler', ), );
- Unless you want to set some custom configuration you´re good to go now

Configuration
-------------

[](#configuration)

Since ZF2 is no longer environment aware, so isn't this module. In de module's configuration folder you'll find a file called 'lesscompiler.global.php.dist'. To configure the LessCompiler to your needs you'll have the copy the file to the application's config/autoload folder en remove the .dist extension. Read the ZF documentation on how to use the naming conventions regarding configuration files. ie. global could also be local.

An example of the options you can configure can be found in module.config.php

The options are

- enable (default:true) Should the module be enabled or disabled for the current environment
- autoRun (default: false) Always compile the Less files (ignores the enabled option)
- pathToLessphp (default: vendor/oyejorge/less.php/lib/Less) Set the path for the Less.PHP files Defaults to "less.php" in the application's vendor map
- importDir (default: null) Import directory: please use realpath(...) to get a valid directory ie. realpath(getcwd() . '/less/inc/');
- sourceFolder (default: null) Where to look for Less files
- targetFolder (default: null) Where to put the generated css
- formatter (default: compressed) lessphp compatible formatter (see leafo.net/lessphp for the options)
- preserveComments (default: null) Preserve comments or remove them
- variables (default: array()) Array of php variables (see leafo.net/lessphp for more info)
- cache (default: null) Pass cache options as an array or pass even a complete cache adapter which extends \\Zend\\Cache\\Storage\\Adapter\\AbstractAdapter Configurable array options are the keys: name, ttl and namespace. Other array\_keys will be ignored

Documentation
-------------

[](#documentation)

The module will check for less-files to (re)compile automatically when:

- autoRun is set to true in the configuration options
- you supply a GET parameter "forceCompiling" and set "true" or 1
- Cache-time expires

The module caches the compiled files with the help of Zend\_Cache. All Less-files should be placed in the `application/less` directory (to generate css-files in the default `public/css` directory) by default.

The default duration time for the cache is 4 hours. After that time the cache expires and after a new request the module will check for updated or added less-files.

License
-------

[](#license)

GNU General Public License, version 3 (GPL-3.0)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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

Total

4

Last Release

3782d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/376972f1f11ca42dbb67dc764af57d7c051d18d69e67a8ccb7c1018b06ad3d77?d=identicon)[BradCrumb](/maintainers/BradCrumb)

---

Top Contributors

[![BradCrumb](https://avatars.githubusercontent.com/u/4476936?v=4)](https://github.com/BradCrumb "BradCrumb (25 commits)")

---

Tags

frameworklesscompilerzf2

### Embed Badge

![Health badge](/badges/bradcrumb-bc-zf-less-compiler/health.svg)

```
[![Health](https://phpackages.com/badges/bradcrumb-bc-zf-less-compiler/health.svg)](https://phpackages.com/packages/bradcrumb-bc-zf-less-compiler)
```

PHPackages © 2026

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