Download the PHP package alex-kassel/stub-engine without Composer

On this page you can find all versions of the php package alex-kassel/stub-engine. 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 stub-engine

⚡ StubEngine

Hierarchical template and stub scaffolding engine with token interpolation and host overrides for PHP and Laravel.

Why This Exists • Key Features • Requirements • Installation • Quickstart • Usage & Recipes • Documentation • API Reference • Testing • Changelog • License

Latest Version Laravel Support PHP Support


Why This Exists

Generators, module builders, manifest installers, and CLI scaffolding tools repeatedly reinvent low-level filesystem operations:

  1. Interpolating token placeholders in file contents.
  2. Interpolating token placeholders in directory and file names (e.g. src/{{ ClassName }}.php.stub).
  3. Stripping template extensions (.stub).
  4. Enabling consumer applications to override default stubs without modifying vendor packages.
  5. Handling single-file stubs (e.g. compiling a standalone script or configuration) alongside multi-file directory trees.

StubEngine extracts this entire lifecycle into a lightweight, zero-bloat service. Whether you need to render an in-memory string, scaffold an individual file with host overrides, or generate an entire directory hierarchy, StubEngine provides a clean, unified API.


Key Features


Requirements


Installation

Install via Composer:

If you are using Laravel, the service provider and StubEngine facade are automatically registered via package discovery.


Quickstart

1. Scaffold a Single File (e.g. CLI Runner or Config)

2. Render In-Memory Content from a Stub

3. Scaffold a Complete Directory Tree

Organize your stubs directory keeping the natural folder hierarchy:

Execute scaffolding:


Usage & Recipes

1. Dependency Injection in Console Commands

In clean architecture, inject AlexKassel\StubEngine\StubEngine directly into your console commands:

2. Configuration & Global Tokens

Publish the package configuration file to customize delimiters and register application-wide tokens:

The published config/stub-engine.php file:

3. Dual Override Strategies: Overlay vs Replace

When consumer applications provide custom stubs, choose between two distinct strategies using OverrideStrategy:

4. Custom Delimiters (Preventing Syntax Collisions)

When scaffolding templates that already contain Blade, Vue, or bash syntax, specify custom delimiters at runtime or via config:

In your stubs and file paths, use <% entity|studly %> or <% entity|kebab %>, while preserving native Blade syntax like {{ $user->name }} without interference.

5. Built-in Token Case Modifiers

Tokens can be automatically transformed using built-in pipe modifiers in both file contents and file paths:

In any stub file or file path, you can use:

Registering Custom Modifiers

Extend the engine at runtime with custom domain modifiers:

6. Strict Mode Diagnostics

Prevent broken PHP code caused by forgotten placeholder variables:

7. Inspecting Scaffold Results & Dry-Run Mode

The ScaffoldResult DTO provides fine-grained visibility into file operations through strongly-typed, public readonly properties:


Documentation

Comprehensive deep-dive guides are available in the docs/ directory:


API Reference

StubEngine::from

Starts a fluent scaffolding pipeline for a source stub file or directory.


StubEngine::renderFile

Renders a single stub file into a string with token replacements using a ScaffoldRequest DTO. Throws InvalidArgumentException if the source is a directory.


StubEngine::scaffold

Executes scaffolding for either a single file or a complete directory tree (automatically determined from $request->source). Returns a ScaffoldResult object detailing created, overwritten, and skipped files.


StubEngine::registerModifier

Registers a custom runtime token modifier function (e.g. {{ var|name }}) delegated to the Interpolator service.

StubEngine::extractTokens

Scans raw template or generated content and returns an array of unique unescaped token names (before any modifier pipes) found within delimiters.


Testing

Run the test suite using PHPUnit:

Or via direct PHPUnit binary:


Changelog

Please see CHANGELOG.md for more information on recent changes.

Contributing

Contributions are welcome! Please review CONTRIBUTING.md for details.

License

The MIT License (MIT). Please see License File for more information.


All versions of stub-engine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
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 alex-kassel/stub-engine contains the following files

Loading the files please wait ...