2017 © Pedro Peláez
 

library compass-elephant

A library to manage a compass project with PHP

image

notrix/compass-elephant

A library to manage a compass project with PHP

  • Thursday, January 25, 2018
  • by notrix
  • Repository
  • 1 Watchers
  • 0 Stars
  • 131 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 23 Versions
  • 8 % Grown

The README.md

CompassElephant License

Build Status Total Downloads SensioLabsInsight, (*1)

A wrapper for the compass binary written in PHP, (*2)

Requirements

  • php >= 5.3
  • *nix system with compass installed

Dependencies

for tests, (*3)

Installation

composer, (*4)

To install CompassElephant with composer you simply need to create a composer.json in your project root and add:, (*5)

``` json { "require": { "cypresslab/compass-elephant": ">=0.1.0" } }, (*6)


Then run ``` bash $ wget -nc http://getcomposer.org/composer.phar $ php composer.phar install

You have now CompassElephant installed in vendor/cypresslab/compasselephant, (*7)

And an handy autoload file to include in you project in vendor/.composer/autoload.php, (*8)

pear, (*9)

Add the Cypresslab channel, (*10)

``` bash $ pear channel-discover pear.cypresslab.net, (*11)


And install the package. *By now CompassElephant is in alpha state. So remember the -alpha in the library name* ``` bash $ pear install cypresslab/CompassElephant-alpha

On Cypresslab pear channel homepage you can find other useful information, (*12)

Testing

The library is fully tested with PHPUnit., (*13)

Go to the base library folder and run the test suites, (*14)

``` bash $ phpunit, (*15)


Code style ---------- * CompassElephant follows the [Symfony2 Coding Standard](https://github.com/opensky/Symfony2-coding-standard) * I'm using [gitflow](https://github.com/nvie/gitflow) so, if you want to contribute, please send a pull-request on develop branch 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 <?php $project = new CompassProject("/path/to/compass"); // create the base class, only the path is mandatory.... // Here is a full customized project $path = "/path/to/compass"; $name = "blog"; // a project name. Not used in the library...but useful if you have more than one project $binary = new CompassBinary('/usr/local/bin/compass'); // use this to set a custom path for the executable. If blank the library try with "which compass" before showing an error $stalenessChecker = 'finder'; // or native. More on this later $configFile = 'config_prod.rb'; // the name of the ruby config file. Defaults to config.rb $autoInit = false; // if true, when given a folder without a config file inside, CompassElephant will try to initialize a compass project $project = new CompassProject($path, $name, $binary, $stalenessChecker, $configFile, $autoInit); // Here is the full constructor signature /** * Class constructor * * @param string $projectPath the path to the compass project * @param null $name the project name * @param \CompassElephant\CompassBinary|null $compassBinary a CompassBinary instance * @param mixed $stalenessChecker a StalenessCheckerInterface instance * @param string $configFile the compass config file name * @param bool $autoInit whether to call init() on an empty folder project * * @internal param \CompassElephant\CommandCaller $commandCaller a CommandCaller instance */ public function __construct($projectPath, $name = null, CompassBinary $compassBinary = null, $stalenessChecker = null, $configFile = 'config.rb', $autoInit = true) { // ... }

manage a compass project, (*16)

``` php <?php, (*17)

// if the project do not contains a config file, CompassElephant assumes it isn't initialized. See autoInit parameters for skip this step if (!$project->isInitialized()) { $project->init(); // call the "compass create" command } // return false if the project needs to be recompiled. In other words if you changed something in config.rb, sass or scss files after the last sylesheets generation if (!$project->isClean()) { $project->compile(); // compile the project echo $project->isClean(); // return true now } ```, (*18)

Staleness Checker, (*19)

Compass checks if the project need to be compiled in two different ways:, (*20)

finder This method uses the awesome Symfony Finder component. It parse the config.rb file for the sass path and for the stylesheet path. Then check if the modification time of the stylesheets comes before the modification of the config file or a sass file. This is the default method., (*21)

native uses the command "compass compile --dry-run" and parse the output to see if there are stylesheets not aligned with sass. This method is not so cool because it's really slow. Even by using it only in a dev environment, it adds 400-500 ms of overhead on every check. So use it only if you can't use the finder method, (*22)

Are you reinventing the wheel?

I use Assetic for my assets...and you should use it too., (*23)

But for now the Compass implementation do not work as intended. Assetic is built upon the concept of a single asset compiled. And it's not aware of dependencies, (*24)

A pull request for assetic is not so easy, because it should change the entire structure of the library. And I know that the author is working on it., (*25)

I promise that, when the issue will be adressed, I will delete this library and return to Assetic. By now you can (should) use it to rewrite/uglify the stylesheets generated by CompassElephant. And this is exactly what I'm doing now., (*26)

Symfony2

CompassElephantBundle let symfony do the work for you, (*27)

The Versions

25/01 2018

dev-master

9999999-dev http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0-or-later

The Requires

 

The Development Requires

css sass compass

25/01 2018

dev-develop

dev-develop http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

css sass compass

13/11 2014

v0.3.4

0.3.4.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

css sass compass

08/11 2014

v0.3.3

0.3.3.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

css sass compass

08/11 2014

v0.3.2

0.3.2.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

css sass compass

07/11 2014

v0.3.1

0.3.1.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

css sass compass

16/07 2014

v0.2.13

0.2.13.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

LGPL-3.0+

The Requires

 

css sass compass

31/07 2013

0.2.12

0.2.12.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

27/12 2012

0.2.11

0.2.11.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

11/12 2012

0.2.10

0.2.10.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

20/10 2012

0.2.8

0.2.8.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

22/08 2012

0.2.7

0.2.7.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

22/08 2012

0.2.6

0.2.6.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

29/06 2012

0.2.5

0.2.5.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

29/06 2012

0.2.4

0.2.4.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

18/04 2012

0.2.3

0.2.3.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

17/04 2012

0.2.2

0.2.2.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

28/03 2012

0.2.1

0.2.1.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

01/02 2012

0.2.0

0.2.0.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

01/02 2012

0.1.3

0.1.3.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

01/02 2012

0.1.2

0.1.2.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

01/02 2012

0.1.1

0.1.1.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass

01/02 2012

0.1.0

0.1.0.0 http://matteosister.github.com/CompassElephant

A library to manage a compass project with PHP

  Sources   Download

GPL3

The Requires

 

css sass compass