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.
#A wrapper for the less binary written in PHP
for tests
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
The library is tested with PHPUnit.
Go to the base library folder and run the test suites
$ phpunit
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
LessElephantBundle let symfony do the work for you
How can I help you explore Laravel packages today?