Download the PHP package abm/sassphp without Composer

On this page you can find all versions of the php package abm/sassphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sassphp

sassphp

The sass extension for PHP gives you an object-oriented system of parsing Sass from within your PHP applications. Under the hood it uses libsass to provide super speedy and compatible Sass parsing.

Libsass 3.6.3 Build Status codecov Patreon

What's Sass?

Sass is a CSS pre-processor language to add on exciting, new, awesome features to CSS. Sass was the first language of its kind and by far the most mature and up to date codebase.

Sass was originally created by Hampton Catlin (@hcatlin). The extension and continuing evolution of the language has all been the result of years of work by Natalie Weizenbaum (@nex3) and Chris Eppstein (@chriseppstein).

For more information about Sass itself, please visit http://sass-lang.com

Installation

Currently, the only way to install the extension is manually:

$ git clone git://github.com/absalomedia/sassphp

Remember to grab your submodules:

$ git submodule init
$ git submodule update

Also remember that libsass now uses submodules on its own, so update those too.

...and compile it! I've written a little PHP script to do all the stuff you need to do:

$ php install.php

Run the tests:

$ make test

Finally, you can install with make:

$ make install

And then add it to your php.ini:

extension=sass.so

Always remember to enable it within PHP as well

phpenmod sass

Binary installation / deployment

As long as you have the final 'sass.so' extension file, you can deploy SASS PHP across any server. There's a few caveats, of course. The development & production servers have to run the same version of PHP. You then copy the installed 'sass.so' from the /usr/lib/php/ directory shown during 'make install' on your development environment to the same directory on your production boxes.

As usual, make sure you add the extension to your php.ini on your production environments:

extension=sass.so

Always remember to enable it within PHP as well

phpenmod sass

Usage

This extension has a very simple API:

$sass = new Sass();
$css = $sass->compile($source);

You can compile a file with compileFile():

$sass = new Sass();
$css = $sass->compileFile($source);

You can set the include path for the library to use:

$sass = new Sass();
$sass->setIncludePath('/tmp');
$css = $sass->compile($source);

You can set the style of your SASS file to suit your needs:

$sass = new Sass();
$sass->setStyle(Sass::STYLE_NESTED);

$sass = new Sass();
$sass->setStyle(Sass::STYLE_EXPANDED);

$sass = new Sass();
$sass->setStyle(Sass::STYLE_COMPACT);

$sass = new Sass();
$sass->setStyle(Sass::STYLE_COMPRESSED);

As the Libsass library has matured to get closer to 100% SASS coverage, so this extension has also matured:

The output of compileFile() is an array when creating source map files, allowing both compiled SASS file and .map file to be generated in the same function call.

As there are multiple ways of generating source comments, there are now PHP level settings to control that output.

To generate source comments for a file inline:

$sass = new Sass();
$sass->setComments(true);
$css = $sass->compileFile($source);

Aliases also exist so you can also use:

$css = $sass->compile_file($source);

You can tell the compiler to use indented syntax (SASS syntax). By default it expects SCSS syntax:

$sass = new Sass();
$sass->setIndent(true); //TRUE -> SASS, FALSE -> SCSS
$css = $sass->compile($source);

You can tell the compiler to embed the source map into the actual CSS file as well:

$sass = new Sass();
$sass->setEmbed(true);
$css = $sass->compile($source);

You can set the source map file for the library to use:

$sass = new Sass();
$sass->setMapPath('/random.output.css.map');
$css = $sass->compileFile($source);

This needs to be done prior to getting the output of the map file. As it stands, both the output of the SASS file compile & the SASS source map file generation sequence are both strings.

The first array item will always be the compiled SASS file: \$css[0]

The second array item will always be the source map output: \$css[1]

You can set the root of the generated source map file like so:

$sass = new Sass();
$sass->setMapRoot('/some/dir');
$sass->setMapPath('/random.output.css.map');
$css = $sass->compileFile($source);

If there's a problem, the extension will throw a SassException:

$sass = new Sass();

try
{
    $css = $sass->compile('dayrui3dui36di37');
}
catch (SassException $e)
{
    // $e->getMessage() - ERROR -- , line 1: invalid top-level expression

    $css = FALSE;
}

Variant builds

These extensions also utilise the Libsass library & remain in varying states of completion:

Changelog

Release Description
0.7.0 Librarian - Functions & importers
0.6.2 Solskjær - Manchester (Libsass 3.6.3)
0.6.1 Bond - Monaco (Libsass 3.6.1)
0.6.0 Symfony - Composer integration
0.5.17 Engine - Vroom vroom (Libsass 3.5.5)
0.5.16 Humpback - Maloo (Libsass 3.5.4)
0.5.15 Fallout - Atom (Libsass 3.5.2)
0.5.14 Karol - Caroline (Libsass 3.4.8)
0.5.13 Ray - Manta (Libsass 3.4.5) & PHP stub file
0.5.12 Cartography - MapRoot functions
0.5.11 Zoomer (Libsass 3.4.4) stable
0.5.10 Elwood (Libsass 3.4.3) stable & Travis fix
0.5.9 Rickshaw (Libsass 3.4.2) stable
0.5.8 AI - KITT (Libsass 3.4.0) stable
0.5.7 Hancock - Optimise loops & Travis. Simplify changelog documentation
0.5.6 Green Giant - PHP5 & PHP7 stable build - All Travis builds passing
0.5.5 Herbie (Libsass 3.3.6) stable
0.5.2 Delorean (Libsass 3.3.3) stable & continuing PHP7 rewrite
0.5.1 Eleanor (Libsass 3.3.2) stable
0.5.0 Start of PHP 7 compatibility
0.4.9 Too Fast To Furious (Libsass 3.3.1) stable
0.4.8 Greased Lightning (Libsass 3.3.0) stable
0.4.7 SCSS vs SASS detection - indents
0.4.6 Travis experimental (unreleased)
0.4.5 Holiday Patch (Libsass 3.2.5) stable
0.4.4 Refactor correctly for LibSass 3.2.4
0.4.2 CamelCase compile sequence
0.4.1 Addition of SOURCE_DEFAULT test & structure. Revise other tests
0.4.0 Refactor file compliation. Basic tests for source comments. Expand documentation
0.3.9 Addition of source map url paths to SASS file compilation
0.3.5 Restructure of compile sequence (file only at this time) to account for source map output
0.3.0 Addition of source comments - none, inline, file. Set default to none.
0.2.0 Changed methods to be non-static. Allow setting include-path and image-path
0.1.0 Initial release

All versions of sassphp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package abm/sassphp contains the following files

Loading the files please wait ....