Download the PHP package i-lateral/silverstripe-lesscompiler without Composer

On this page you can find all versions of the php package i-lateral/silverstripe-lesscompiler. 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 silverstripe-lesscompiler

Silverstripe Lesscompiler Module

A module that compiles defined less files on execution and exportes them to a defined CSS file.

Currently this is a proof of concept and has lots of possible options for expansion.

This module uses the "less.php" module to compile less files. If not installing via composer you will need this installed to your path.

Installation via Composer

composer require i-lateral/silverstripe-lesscompiler 0.*

Operation

This module checks for updates to defined less files before controller initilisaton. If there are changes then new CSS is compiled and saved to the defined output path.

This process is only run on dev (as to not detrimentally effect performance on live sites) and all cache files are stored in the default Silverstripe temp directory.

Basic usage

Start off by setting the file_mappings config variable on LessCompilerConfig. This should be a list of less files to convert with their equivilent export file, eg:

config.yml

LessCompilerConfig:
  file_mappings:
    "styles.less": "styles.css"
    "typography.less": "typography.css"

_config.php

LessCompilerConfig::config()->file_mappings = array(
    "styles.less" => "styles.css",
    "typography.less" => "typography.css"
);

If you do not include a path to the less/css files then the module assumes that you are using the default theme directory and using folders named "less" and "css" respectively.

Custom file paths

You can define custom less and css file paths but using the following:

config.yml LessCompilerConfig: file_mappings: "themes/themename/less/styles.less": "themes/themename/css/styles.css" "themes/themename/less/typography.less": "themes/themename/css/typography.css"

_config.php

LessCompilerConfig::config()->file_mappings = array(
    "themes/themename/less/styles.less" => "themes/themename/css/styles.css",
    "themes/themename/less/typography.less" => "themes/themename/css/typography.css"
);

Compressing output

By default all output is compressed, this can be disabled using the "compress" config variable, EG:

config.yml

LessCompilerConfig:
  compress: false

_config.php

LessCompilerConfig::config()->compress = false;

Relative image URLS

The compiler attempts converts all relative image URLs to be prefixed prefixed with ../ (this assumes that the output css will be in a seperate folder to the images, but with a common root). This can be altered using the "root_path" config variable

config.yml

LessCompilerConfig:
  root_path: "../../imports"

_config.php

LessCompilerConfig::config()->root_path = "../../imports";

Before and After Compile extensions

If you need to perform custom functions just before or after Less Compiler runs you can do this using the onBeforeLessCompiler and onAfterLessCompiler extension calls.

NOTE These calls are added to controller, so rather than adding an extension to LessCompiler itself, you only need to add your custom code to an extension to Controller. EG:

app/code/extensions/AppControllerExtension.php

`

app/_config/config.yml

`


All versions of silverstripe-lesscompiler with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version >=3.1
oyejorge/less.php Version 1.*
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 i-lateral/silverstripe-lesscompiler contains the following files

Loading the files please wait ....