{"id":19114843,"url":"https://github.com/namelesscoder/typo3-cms-fluid-precompiler","last_synced_at":"2025-07-03T00:05:30.433Z","repository":{"id":57023498,"uuid":"81853423","full_name":"NamelessCoder/typo3-cms-fluid-precompiler","owner":"NamelessCoder","description":"TYPO3 Fluid Template Compiling / Analysis tool","archived":false,"fork":false,"pushed_at":"2018-07-16T10:02:16.000Z","size":17,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T08:07:32.043Z","etag":null,"topics":["checker","cli","compiler","fluid","linter","typo3"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NamelessCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-13T17:47:13.000Z","updated_at":"2023-09-28T00:13:13.000Z","dependencies_parsed_at":"2022-08-23T14:20:45.980Z","dependency_job_id":null,"html_url":"https://github.com/NamelessCoder/typo3-cms-fluid-precompiler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NamelessCoder/typo3-cms-fluid-precompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamelessCoder%2Ftypo3-cms-fluid-precompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamelessCoder%2Ftypo3-cms-fluid-precompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamelessCoder%2Ftypo3-cms-fluid-precompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamelessCoder%2Ftypo3-cms-fluid-precompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NamelessCoder","download_url":"https://codeload.github.com/NamelessCoder/typo3-cms-fluid-precompiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamelessCoder%2Ftypo3-cms-fluid-precompiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260780204,"owners_count":23061984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["checker","cli","compiler","fluid","linter","typo3"],"created_at":"2024-11-09T04:44:40.012Z","updated_at":"2025-07-03T00:05:29.883Z","avatar_url":"https://github.com/NamelessCoder.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"TYPO3 CMS Fluid Template Precompiler\n====================================\n\nCommand line tool which scans your TYPO3 site for and compiles without rendering, Fluid template files. Simply put,\nwarms up the Fluid template cache by parsing and compiling all templates without rendering them.\n\nAlso functions as a basic linting utility - any errors automatically cause the template to be uncompilable and the\nparsing-specific extension message such as \"undeclared arguments passed to ViewHelper\" is presented as failure message.\n\n\nInstallation\n------------\n\nOnly available through composer:\n\n    composer require namelesscoder/typo3-cms-fluid-precompiler\n\n\nPurpose\n-------\n\nThe purpose of this utility is to allow Fluid templates to be compiled (\"cached\") without having to render each one, as\nis normally required before the Fluid template gets compiled.\n\nThe intention is to enable:\n\n* Development / continuous integration (optional failure exit code) and reporting of uncompilable templates.\n* Fairly verbose output containing mitigation suggestions when a template is uncompilable.\n* Ability to \"warm up\" all Fluid templates' compiled states as part of a deployment script.\n\nThe utility exclusively supports pre-compiling of templates which conform to the TYPO3 template folder naming\nconventions - that means that only templates which exist in the *default paths of each extension* will be compiled.\nAnd this means templates are expected in `EXT:$extkey/Resources/Private/Templates`, layouts are expected in\n`EXT:$extkey/Resources/Private/Layouts` and partials in `EXT:$extkey/Resources/Private/Partials`. Any template file not\nlocated in those paths will be ignored.\n\n\nUsage\n-----\n\nAll parameters can be combined as needed and all parameters have a short name like `-h` and a long name like `--help`.\nOnly one of the parameters - `-e` or `--extension` - takes an argument value.\n\n### Print this help text\n\n    ./vendor/bin/fluid-precompile -h\n    ./vendor/bin/fluid-precompile --help\n\n### Pre-compile every template in every installed extension.\n\n    ./vendor/bin/fluid-precompile\n\n### Pre-compile every template in a specific, installed extension.\n\n    ./vendor/bin/fluid-precompile -e my_extension\n    ./vendor/bin/fluid-precompile --extension my_extension\n\n### Silence output\n\n    ./vendor/bin/fluid-precompile -s\n    ./vendor/bin/fluid-precompile --silent\n\n### Verbose output\n\n    ./vendor/bin/fluid-precompile -v\n    ./vendor/bin/fluid-precompile --verbose\n\n### Fail (exit code 1) on any uncompilable template\n\n    ./vendor/bin/fluid-precompile -f\n    ./vendor/bin/fluid-precompile --fail\n\n\nCI Usage\n--------\n\nThe tool can also be used with Composer's `--require-dev` and called from a continuous integration framework, in case\nyou want to prevent any uncompilable or otherwise error prone templates from being committed to your project.\n\nI recommend the following command to perform the check:\n\n    ./vendor/bin/fluid-precompile -e $EXTKEY -v -f\n\nWhich will attempt to compile all templates in extension `$EXTKEY` (which you must define/substitute, of course) and\nbe verbose about the output (to include any failure messages and print all status for all templates) and finally to fail\nif any uncompilable templates are detected (but still report all failures if there are more than one).\n\nBonus effect: this performs basic linting on your Fluid template files to ensure that they can be parsed correctly.\nNote that this doesn't necessarily mean that your templates also *render* correctly; the linting does not take things\nlike TypoScript variables or potentially missing sections/partials into account, it only validates the syntax you used.\n\n\nA word on custom implementations\n--------------------------------\n\nIt is perfectly possible to implement your own template pre-compiling logic - and do so very quickly. If you look into\nthe source code of the `FluidPrecompiler` class shipped with this utility you can see that the requirements are\nexcessively simple:\n\n* You need the TYPO3 context, to include things like the cache definitions (a custom bootstrapping application class\n  is used to do that - if you do this from within an existing TYPO3 context no such thing is necessary).\n* You need to build an instance of a RenderingContext which is specific to one extension - once you have the instance\n  you can then override settings to provide different template paths.\n* The pre-compiling (in Fluid terms, warmup) result contains information about all detected files with their individual\n  status and any failure reasons if the template was uncompilable.\n\nThis makes it fairly easy to implement a custom warmup feature in for example a TYPO3 backend module, as hook that\ntriggers after caches are flushed, as part of your extension installation process, and so on.\n\nWhen you encounter cases which appear to require a custom implementation, consider the following:\n\n* Are you breaking MVC in your template file naming - would it be better to conform to MVC?\n* Would it be better to place your Fluid template files in the default locations as per convention?\n* Is your rendering setup perhaps too complex - for example, does it demand a lot of custom View initialisation?\n* Are you placing your template files in `fileadmin`? Then urgently consider putting them in an extension.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamelesscoder%2Ftypo3-cms-fluid-precompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamelesscoder%2Ftypo3-cms-fluid-precompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamelesscoder%2Ftypo3-cms-fluid-precompiler/lists"}