Download the PHP package namelesscoder/typo3-cms-fluid-precompiler without Composer

On this page you can find all versions of the php package namelesscoder/typo3-cms-fluid-precompiler. 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 typo3-cms-fluid-precompiler

TYPO3 CMS Fluid Template Precompiler

Command line tool which scans your TYPO3 site for and compiles without rendering, Fluid template files. Simply put, warms up the Fluid template cache by parsing and compiling all templates without rendering them.

Also functions as a basic linting utility - any errors automatically cause the template to be uncompilable and the parsing-specific extension message such as "undeclared arguments passed to ViewHelper" is presented as failure message.

Installation

Only available through composer:

composer require namelesscoder/typo3-cms-fluid-precompiler

Purpose

The purpose of this utility is to allow Fluid templates to be compiled ("cached") without having to render each one, as is normally required before the Fluid template gets compiled.

The intention is to enable:

The utility exclusively supports pre-compiling of templates which conform to the TYPO3 template folder naming conventions - that means that only templates which exist in the default paths of each extension will be compiled. And this means templates are expected in EXT:$extkey/Resources/Private/Templates, layouts are expected in EXT:$extkey/Resources/Private/Layouts and partials in EXT:$extkey/Resources/Private/Partials. Any template file not located in those paths will be ignored.

Usage

All parameters can be combined as needed and all parameters have a short name like -h and a long name like --help. Only one of the parameters - -e or --extension - takes an argument value.

Print this help text

./vendor/bin/fluid-precompile -h
./vendor/bin/fluid-precompile --help

Pre-compile every template in every installed extension.

./vendor/bin/fluid-precompile

Pre-compile every template in a specific, installed extension.

./vendor/bin/fluid-precompile -e my_extension
./vendor/bin/fluid-precompile --extension my_extension

Silence output

./vendor/bin/fluid-precompile -s
./vendor/bin/fluid-precompile --silent

Verbose output

./vendor/bin/fluid-precompile -v
./vendor/bin/fluid-precompile --verbose

Fail (exit code 1) on any uncompilable template

./vendor/bin/fluid-precompile -f
./vendor/bin/fluid-precompile --fail

CI Usage

The tool can also be used with Composer's --require-dev and called from a continuous integration framework, in case you want to prevent any uncompilable or otherwise error prone templates from being committed to your project.

I recommend the following command to perform the check:

./vendor/bin/fluid-precompile -e $EXTKEY -v -f

Which will attempt to compile all templates in extension $EXTKEY (which you must define/substitute, of course) and be verbose about the output (to include any failure messages and print all status for all templates) and finally to fail if any uncompilable templates are detected (but still report all failures if there are more than one).

Bonus effect: this performs basic linting on your Fluid template files to ensure that they can be parsed correctly. Note that this doesn't necessarily mean that your templates also render correctly; the linting does not take things like TypoScript variables or potentially missing sections/partials into account, it only validates the syntax you used.

A word on custom implementations

It is perfectly possible to implement your own template pre-compiling logic - and do so very quickly. If you look into the source code of the FluidPrecompiler class shipped with this utility you can see that the requirements are excessively simple:

This makes it fairly easy to implement a custom warmup feature in for example a TYPO3 backend module, as hook that triggers after caches are flushed, as part of your extension installation process, and so on.

When you encounter cases which appear to require a custom implementation, consider the following:


All versions of typo3-cms-fluid-precompiler with dependencies

PHP Build Version
Package Version
Requires typo3/cms-backend Version ^8.7 || ^9
typo3/cms-core Version ^8.7 || ^9
typo3/cms-extbase Version ^8.7 || ^9
typo3/cms-fluid Version ^8.7 || ^9
typo3fluid/fluid Version ^2.3
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 namelesscoder/typo3-cms-fluid-precompiler contains the following files

Loading the files please wait ....