Download the PHP package spmt/magento2-spmt-fast-di-compile without Composer

On this page you can find all versions of the php package spmt/magento2-spmt-fast-di-compile. 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 magento2-spmt-fast-di-compile

Magento 2 Fast DI Compile module

Companion Magento module for speedupmate/di-compiler, a Rust replacement for Magento's bin/magento setup:di:compile.

This module keeps the normal Magento command name and swaps in the Rust compiler when the binary is available.

What it does

Get started

You need a running Magento installation and a built fast-di-compile binary.

1. Installation

For local development in this repository, the package is installed through the root Composer path repository:

The module source lives in ./src.

2. Build the Rust compiler

From the Magento project root:

The module expects the executable at:

See speedupmate/di-compiler for Docker build instructions and host-platform notes.

3. Compile your Magento project

Run the normal Magento command:

If the Rust binary exists, is executable, and passes the trust checks, this module runs fast-di-compile.

To force Magento's standard PHP compiler:

Useful options

Option What it does
--standard Run Magento's standard PHP compiler instead of the Rust compiler.
--output var/tmp/fast-di-output Set the generated output folder. Must resolve inside the Magento project root.
--jobs 8 Set parallel workers. Accepted range is 1 through 256.
--fallback-php /usr/local/bin/php Set the PHP executable used by the Rust compiler for fallback reflection. Must resolve to the same PHP binary running Magento CLI.
--incremental Enable incremental compilation.
--dry-run Run without writing generated files.
--validate Validate output against PHP ground truth.
--php-generated generated Set the PHP ground-truth generated directory used with --validate. Must resolve inside the Magento project root.
--compare-archive Compare generated output against an archive baseline.
--archive-root var/tmp/magento-di-baseline Set the archive root containing _code and _metadata. Must resolve inside the Magento project root.
--compare-report-dir var/tmp/fast-di-output/diff Set where archive diff reports are written. Must resolve inside the Magento project root.
--compare-fail-on-diff Exit with failure when archive comparison finds differences.
--ignore-constructor-integrity Continue when constructor integrity validation fails.
-v, -vv, -vvv Forward verbose mode to the Rust compiler as --verbose.

How it works under the hood

Magento builds console commands through Magento\Framework\Console\CommandLoader\Aggregate.

This module registers a preference for that aggregate loader. When Magento asks for setup:di:compile, the module checks for an executable Rust binary at BP/rust/di-compiler/target/release/fast-di-compile.

If the binary is available and trusted, the module returns a wrapper command named setup:di:compile. The binary must resolve inside BP/rust/di-compiler/target/release, must not be symlinked, and its path components must not be writable by group or other users.

The wrapper runs the Rust binary with the canonical Magento root, sets Magento's root as the process working directory, passes the current Magento CLI PHP binary to --fallback-php, strips common secret-bearing environment variables, streams sanitized stdout and stderr back to Magento's console output, and returns Magento success or failure codes based on the Rust process exit code. The Rust process timeout is 15 seconds.

If the binary is not available or fails the trust checks, the original Magento command loader handles the command unchanged.

Debugging

Start with verbose output:

To compare Rust output with Magento's standard compiler, first create a baseline using Magento's compiler:

Then run the Rust compiler through Magento and compare against the baseline:

Reports are written to var/tmp/fast-di-output/diff/ unless --compare-report-dir is provided.

For compiler internals and lower-level debugging notes, see speedupmate/di-compiler.

Development

Module source is under src/.

Useful checks from the Magento installation root:

The GitHub Actions workflow for this package runs PHPUnit inside Docker Official PHP Alpine images for PHP 8.3/Symfony 6.4, PHP 8.4/Symfony 6.4, and PHP 8.5/Symfony 7.4. It also runs Magento Coding Standard validation in php:8.4-cli-alpine.

From the Magento root, verify the module is enabled:

License and copyright

Copyright © 2026 Anton Siniorg.

magento2-spmt-fast-di-compile is released under the MIT License. Use it, improve it, and share it.


All versions of magento2-spmt-fast-di-compile with dependencies

PHP Build Version
Package Version
Requires ext-curl Version *
magento/framework Version *
php Version >=8.1
symfony/console Version ^6.4 || ^7.4
symfony/process Version ^6.4 || ^7.4
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 spmt/magento2-spmt-fast-di-compile contains the following files

Loading the files please wait ...