Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Less Elephant Laravel Package

cypresslab/less-elephant

PHP wrapper around the Less (lessc) binary to manage and compile LESS projects. Uses Symfony Finder and Process, supports Composer/PEAR installation, includes PHPUnit tests, and follows Symfony2 coding standards. Requires PHP 5.3+ and a *nix system with lessc installed.

View on GitHub
Deep Wiki
Context7

LessElephant Travis build status#

A wrapper for the less binary written in PHP

Requirements

  • php >= 5.3
  • *nix system with less (lessc binary) installed

Dependencies

for tests

Installation

composer

To install LessElephant with composer you simply need to create a composer.json in your project root and add:

{
    "require": {
        "cypresslab/less-elephant": "<=1.0.0"
    }
}

Then run

$ wget -nc http://getcomposer.org/composer.phar
$ php composer.phar install

You have now LessElephant installed in vendor/cypresslab/lesselephant

And an handy autoload file to include in you project in vendor/.composer/autoload.php

pear

Add the Cypresslab channel

$ pear channel-discover pear.cypresslab.net

And install the package. By now LessElephant is in alpha state. So remember the -alpha in the library name

$ pear install cypresslab/LessElephant-alpha

On Cypresslab pear channel homepage you can find other useful information

Testing

The library is tested with PHPUnit.

Go to the base library folder and run the test suites

$ phpunit

Code style

How to use

Remember to give the user the right permissions to access the filesystem. If you are using a web server give permissions to both your user and the web server user.

constructor

<?php

$project = new LessProject("/path/to/less/folder", "screen.less", "/path/to/css/screen.css"); // create the base class

// optionally you can pass a project name and a custom LessBinary class
$project = new LessProject(
    "/path/to/less/folder",
    "main_file.less",
    "/path/to/css/file.css",
    "my-awesome-project",
    new LessBinary("/path/to/lessc")
);

manage a less project

// return false if the project needs to be recompiled. In other words if you changed something in any of your less files after the last sylesheets generation
if (!$project->isClean()) {
    $project->compile(); // compile the project
}
echo $project->isClean(); // returns true

Staleness Checker

LessElephant checks if the project need to be compiled with the awesome Symfony Finder component, by scanning your source less folder

Symfony2

LessElephantBundle let symfony do the work for you

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky