Download the PHP package civicrm/composer-compile-lib without Composer

On this page you can find all versions of the php package civicrm/composer-compile-lib. 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 composer-compile-lib

CiviCRM Composer Compilation Library

This package provides a handful of small tasks and helpers for use with composer-compile-plugin.

Design guidelines for this package:

The primary purpose here is demonstrative - to provide examples. Consequently, it is fairly minimal / lightweight / loosely-coupled. There is no dependency on CiviCRM. Conversely, CiviCRM packages may define other tasks which are not in this library.

Require the library

All the examples below require the civicrm/composer-compile-lib package. Load via CLI:

Or via composer.json:

Task: SCSS

In this example, we generate a file dist/sandwich.css by reading scss/sandwich.scss. The file may @import mixins and variables from the ./scss/ folder.

Note that a "task" simply calls a static PHP method (@php-method \\CCL\\Tasks::scss) with the JSON data as input. You can also call the method in a PHP script. For example, we could define a task based on a script:

The following script generalizes the example from before -- it maps any SCSS files (scss/*.scss) to corresponding CSS files (dist/#1.css). This file-list is passed into \CCL\Tasks::scss for processing:

Note that this implementation of \CCL\Tasks::scss() is fairly opinionated - it combines scssphp with php-autoprefixer. The output is written as two files, a larger files (*.css) and a smaller file (*.min.css).

Task: PHP Template

In this example, we use a PHP template to generate another PHP file. Specifically, we create Sandwich.php using the specification from EntityTemplate.php:

As in the previous example, the task is simply a PHP method (@php-method \\CCL\\Tasks::template), so it can be used from a PHP script. The following script would extend the pattern, mapping any JSON files (src/Entity/*.json) to corresponding PHP files (src/Entity/#1.php):

Functions

PHP's standard library has a lot of functions that would work for basic file manipulation (copy(), rename(), chdir(), etc). The problem is error-signaling -- you have to explicitly check error-output, and this grows cumbersome for improvised glue code. It's more convenient to have a default stop-on-error behavior, e.g. throwing exceptions.

symfony/filesystem provides wrappers which throw exceptions. But it puts them into a class Filesystem which, which requires more boilerplate.

For the most part, CCL simply mirrors symfony/filesystem using static methods in the CCL class. Compare:

This is more convenient for scripting one-liners. For example, the following tasks do simple file operations. If anything goes wrong, they raise an exception and stop the compilation process.

The full function list:

For more details about each function, see CCL\Functions and symfony/filesystem.


All versions of composer-compile-lib with dependencies

PHP Build Version
Package Version
Requires civicrm/composer-compile-plugin Version ~0.19 || ~1.0
symfony/filesystem Version ~2.8 || ~3.4 || ~4.0 || ~5.0 || ~6.0 || ~7.0
scssphp/scssphp Version ^1.8.1
padaliyajay/php-autoprefixer Version ~1.2
tubalmartin/cssmin Version ^4.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 civicrm/composer-compile-lib contains the following files

Loading the files please wait ....