exp:exptemplateconvertstpltotpl
Available since Exponential 6.0.15 (in development, not in a release yet).
Summary
Convert the Smarty templates (.stpl) of a design to Exponential templates (.tpl); --dry-run, --file, --force, --override-ini
Usage
./console exp:exptemplateconvertstpltotpl [options] php bin/php/exptemplateconvertstpltotpl.php [options] ./console exp:template:convert:stpl-to-tpl [options]
Aliases
exp:template:convert:stpl-to-tpl
Help
The output of ./console help exp:exptemplateconvertstpltotpl (the script run with --help), without the standard options:
Usage: bin/php/exptemplateconvertstpltotpl.php [OPTION]...
Convert Smarty templates (.stpl) to Exponential templates (.tpl)
Every *.stpl below --from becomes the *.tpl at the same place below --to, converted by
expSmartyReverseConverter: what the tpl -> stpl conversion writes, and common hand-written Smarty.
What has no exact .tpl form is kept as a {* SMARTY ... *} comment in the .tpl and reported as a NOTE.
--override-ini writes the -s siteaccess's override rules with MatchFile pointing at the converted .tpl.
The same as exp:template:convert --from-engine=stpl --to-engine=tpl.
./console exp:template:convert:stpl-to-tpl --from=extension/<ext>/design/<design> --to=var/tmp/<design>
./console exp:template:convert:stpl-to-tpl --from=extension/<ext>/design/<design> --dry-run
./console exp:template:convert:stpl-to-tpl --file=design/<design>/templates/<name>.stpl
./console exp:template:convert:stpl-to-tpl -s <siteaccess> --from=<design> --to=<design> --override-ini=<file>
Every written file ends with a marker comment ({* exp:template:convert stpl->tpl md5:... from ... *});
a target that has no marker, or was changed after it was written, is skipped (SKIP) unless --force
is given. The result is checked before it is written: a .tpl must parse. Prints WRITE or REPLACE for
every file written, NOTE for every construct that could not be converted exactly, ERROR for a
template that could not be converted, then PASS or FAIL with the counts.
Exit code: 0 PASS; 1 FAIL (a template could not be read, converted, checked or written); 2 wrong options.
Options:
--from=VALUE design directory with the .stpl templates (every .stpl below it is converted)
--to=VALUE design directory for the .tpl templates (default: the --from directory, next to the sources)
--file=VALUE convert this one .stpl only (below --from, or a file of its own: then --to is the target file)
--override-ini=VALUE override.ini.append.php to write for the --to design (the -s siteaccess's override rules, MatchFile pointing at the converted .tpl)
--dry-run show what would be written; nothing is written
--force also replace a .tpl that was changed or written by hand (no marker, or not matching it)Options
| Option | Value | Description |
|---|---|---|
| --from | required | design directory with the .stpl templates (every .stpl below it is converted) |
| --to | required | design directory for the .tpl templates (default: the --from directory, next to the sources) |
| --file | required | convert this one .stpl only (below --from, or a file of its own: then --to is the target file) |
| --override-ini | required | override.ini.append.php to write for the --to design (the -s siteaccess's override rules, MatchFile pointing at the converted .tpl) |
| --dry-run | - | show what would be written; nothing is written |
| --force | - | also replace a .tpl that was changed or written by hand (no marker, or not matching it) |
Standard options
Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.
Source
bin/php/exptemplateconvertstpltotpl.php, kernel/private/classes/commands/exptemplateconvertstpltotpl.php
See also
Generated example: exp:exptemplateconvertstpltotpl
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment