Download the PHP package shyim/sasso-ffi without Composer

On this page you can find all versions of the php package shyim/sasso-ffi. 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 sasso-ffi

shyim/sasso-ffi

A pure-PHP polyfill for ext-sasso, the PHP extension that compiles SCSS/Sass → CSS with the pure-Rust sasso compiler.

Same classes, same constants, same method signatures — implemented over PHP FFI against sasso's C ABI instead of a compiled extension. Write against Sasso\Compiler once and it runs whether or not the extension is installed.

Requires PHP >= 8.2 and ext-ffi. No node, no sass binary, no build step.

Polyfill, not an alternative

This package conflicts with both ext-sasso and shyim/sasso:

If the native extension is present, Composer refuses to install the polyfill — the extension already provides these classes, and two definitions of Sasso\Compiler cannot coexist:

The intended pattern is to depend on the polyfill and let anyone who has the extension satisfy the same API natively — so prefer the extension where you can install it, and fall back to this everywhere else (shared hosting, a base image you don't control, an environment without a compiler).

API

Identical to ext-sasso's stubs.

Setters are fluent and mutate the compiler; an out-of-range STYLE_*/SYNTAX_* value throws \ValueError at compile() time, matching the extension. The compiler is reusable across compiles.

Errors

Sasso\CompileException carries sasso's diagnostic — a byte-exact snippet when a url is set, otherwise the Error: <msg> (line:col) one-liner. The position is part of the message; like the extension, there are no extra accessors.

Custom importers

The importer is consulted first; configured import paths act as a fallback when canonicalize() returns null. That mirrors ext-sasso — note the raw C ABI does not do this (an importer there replaces load paths outright), so the polyfill emulates the fallback itself, following Sass's partial conventions (foo.scss, _foo.scss, foo/_index.scss).

Throwing from either method aborts the compile and your exception propagates unchanged rather than being flattened into a CompileException.

How the native library gets there

Provisioning is delegated to shyim/composer-binary-downloader, a generic plugin that reads extra.binaries from this package's composer.json. On composer install/update it detects the target triple for your PHP process, downloads the matching -c-api archive from the sasso release, verifies its SHA-256 against a pinned checksum, and extracts the shared library to vendor/shyim/sasso-ffi/bin/<target>/.

The consuming project allows the plugin, and — because downloading code from a URL a dependency chose is gated the same way plugins are — approves this package as a binary source:

An interactive composer install prompts for the allow-binaries entry and writes it for you; CI needs it committed.

Detection follows the PHP binary, not the host CPU — an x86_64 PHP under Rosetta gets the x86_64 library, which is the one it can actually load.

Target Library
x86_64-apple-darwin libsasso.dylib
aarch64-apple-darwin libsasso.dylib
x86_64-unknown-linux-gnu libsasso.so
aarch64-unknown-linux-gnu libsasso.so
x86_64-unknown-linux-musl libsasso.so
aarch64-unknown-linux-musl libsasso.so
x86_64-pc-windows-msvc sasso.dll

Loading the compiler never downloads anything: Sasso\Compiler resolves the already-installed path, so a web request cannot stall on a release host. If the download did not happen — --no-plugins, a vendor/ built on another platform — the first compile fails with a message naming the expected path and the command that fixes it.

composer binary:list is the diagnostic for a failing FFI::cdef(): it prints the exact path that was expected and whether it exists.

Cross-target prefetch is the useful one for Docker: bake the Linux library into an image from an arm64 laptop without waiting for the container to fetch it.

Environment variables

Variable Effect

Read by the binary downloader, which derives them from the sasso binary name:

Variable Effect
SASSO_LIBRARY Load this library file directly; skips detection and download
SASSO_TARGET Force a target triple
SASSO_DOWNLOAD_BASE_URL Fetch archives from a mirror (drops the pinned checksum)
SASSO_SKIP_DOWNLOAD Never download; a missing library is an error
BINARY_DOWNLOADER_SKIP The same, for every binary in the project

Air-gapped builds want SASSO_LIBRARY (or a vendored bin/<target>/) plus SASSO_SKIP_DOWNLOAD, which turns a missing library into an explicit error rather than a network call.

Notes

Development

The test suite is written strictly against the ext-sasso surface, so it can be run against the native extension unchanged to verify parity.

License

MIT. sasso and ext-sasso are separate projects under their own licenses.


All versions of sasso-ffi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-ffi Version *
shyim/composer-binary-downloader Version ^0.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 shyim/sasso-ffi contains the following files

Loading the files please wait ...