Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:exptemplatecheck

Check templates of every engine (.tpl, .stpl, .twig, .html.twig) for valid syntax: files, directories, designs, extensions, siteaccesses; levels syntax/compile/strict; text, json, jsonl, junit, checkstyle, github and…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/exptemplatecheck.md

On this page

exp:exptemplatecheck

Check templates of every engine (.tpl, .stpl, .twig, .html.twig) for valid syntax: files, directories, designs, extensions, siteaccesses; levels syntax/compile/strict; text, json, jsonl, junit, checkstyle, github and sarif output.

Script bin/php/exptemplatecheck.php, code in kernel/private/classes/commands/exptemplatecheck.php. Run it from the installation root, as the user the web server runs as:

./console exp:exptemplatecheck --help
./console exp:template:check --help
./console exp:template:lint --help
./console exp:template:convert:check --help
php bin/php/exptemplatecheck.php --help

Help text

Check templates of every template engine for valid syntax
Exponential templates (.tpl), Smarty templates (.stpl) and Twig templates (.twig, .html.twig), each by
its own parser and compiler with the bridge loaded. Targets: files and directories (TARGET ...), '-' for
stdin, --design, --design-dir, --extension, --extensions, --siteaccess, --all-siteaccesses; nothing:
the current siteaccess's design chain. Nothing is written: compiled output goes to a private directory.

./console exp:template:check design/standard/templates/node/view/full.tpl
./console exp:template:check --design=<design> --level=strict
./console exp:template:check --siteaccess=<siteaccess> --format=json --output=var/tmp/check.json
./console exp:template:check --changed-since=HEAD --format=github
./console exp:template:check --rules

Levels: syntax (the parser), compile (the default: + compiled and the compiled PHP linted), strict
(+ the security policy, includes resolved, unknown operators). Every finding has a rule id
(--rules, --explain=<id>). Aliases: exp:template:lint, exp:template:convert:check.
Exit code: 0 all passed; 1 a finding at or above --fail-on; 2 usage error; 3 an engine needed is
unavailable (unless --allow-missing-engine); 4 internal error.

Options

OptionValueHelp
--designrequireda design by name, in the kernel and in the (active) extensions; repeatable
--design-dirrequireda design directory by path; repeatable
--extensionrequiredevery design of the extension; repeatable
--extensionsevery design of every active extension
--all-extensionswith --design/--extensions: the inactive extensions on disk too
--siteaccessrequiredthe design chain and override rules of the siteaccess; repeatable
--all-siteaccessesevery siteaccess of AvailableSiteAccessList
--enginerequiredall (the default) or a list: tpl,stpl,twig
--suffix-maprequired<ending>:<engine>, an extra file ending (.tpl.html:tpl); repeatable
--levelrequiredsyntax, compile (the default) or strict
--securitycheck against the engine's security policy (on at strict)
--includesevery design: include must resolve (on at strict)
--overridesevery override rule must point to an existing template (on with --siteaccess)
--parityoptionalreport templates present in two engines; =render is experimental
--deprecationsreport deprecated constructs (Twig deprecations while compiling)
--encodingUTF-8 validity, byte order mark, mixed line endings
--max-depthrequiredinclude depth for --includes (default 32)
--formatrequiredtext (the default), json, jsonl, junit, checkstyle, github or sarif
--outputrequiredwrite the machine format to this file; the console keeps the text
--colorrequiredauto, always or never
--no-progressno progress counter
--progressa progress counter on a terminal
--summary-byrequiredgroup the summary by engine, design, extension, siteaccess or directory
--fail-onrequiredthe severity that fails: error (the default), warn or note
--baselinerequiredreport only findings that are not in this baseline file
--generate-baselinerequiredwrite today's findings to this baseline file
--ignorerequireda glob of files to leave out; repeatable (site.ini [TemplateCheckSettings] IgnoreList[] too)
--ruleslist every rule id and exit
--explainrequiredexplain one rule id and exit
--schemarequiredthe machine output schema version (1)
--stdin-enginerequiredthe engine of the template read from stdin (-): tpl, stpl or twig
--stdin-namerequiredthe name of the template read from stdin, for the messages
--allow-missing-enginean unavailable engine does not make the exit code 3
--keep-compiledkeep the private directory of compiled output for inspection
--jobsrequiredcheck in this many worker processes
--changed-sincerequiredonly the templates changed since this git reference (and untracked ones)
--files-fromrequiredcheck the files listed in this file, one per line (- for stdin)

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).

Arguments: [TARGET*].


Generated by ./console exp:help:examples from bin/php/exptemplatecheck.php, kernel/private/classes/commands/exptemplatecheck.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x