ez.no / exponential / documentation / development / scripting / supplied scripts / template compiler
These documentation pages are no longer maintained. Please visit the new documentation site.
The template compiler script allows for compiling all templates belonging to a given siteaccess.
Using
this is quite important when getting the site ready for going live
since it will remove the need to compile the template the first time
they are accessed.
The script resides in bin/php and must be run on each siteaccess for your site.
It is also very important to set the parameters correctly, if unsure consult the examples.
Template compilation and view caching are two different things.
Compilation is is done once for a template (per siteaccess) and will not require recompilation unless the template is modified.
Caching is way to speed up viewing of objects and will usually be regenerated multiple times on a site regardless of the template.
Currently the compiled templates are placed in the cache directory.
This means that if you run the clearcache script (with --clear-all or --clear-tpl) or removes the cache directory the compilation process is done once more.
Run the bin/php/eztc.php script with the -s parameter which defines the siteaccess to compile.
The script will then figure out all design from that siteaccess, find all templates and compile them.
The syntax is
./bin/php/eztc.php -s SITEACCESS --www-dir=PATH --index-file=INDEX --access-path=ACCESS FILE...
Note: The FILE argument is available from 3.5 and up.
If you run the compiler script again it will only compile the script which has been modified.
If you want to recreate all templates you must first clear them with.
./bin/shell/clearcache.sh --clear-tpl
By passing the --force parameter you can force the recompilation of all templates.
Combining this with a specic template file can be used to recompile a specified file.
For instance if you are modifiying a subtemplate (tool or menu for instance) of some kind that is used in pagelayout.tpl you can recompile pagelayout.tpl to get it updated.
Note: This is available from 3.5 and up.
All examples has example_user as user siteaccess and example_admin as admin siteaccess.
User site: http://example.com/ Admin site: http://admin.example.com/
Run:
./bin/php/eztc.php -s example_user ./bin/php/eztc.php -s example_admin
User site: http://example.com/mysite/ Admin site: http://admin.example.com/mysite/
./bin/php/eztc.php -s example_user --www-dir='/mysite/' ./bin/php/eztc.php -s example_admin --www-dir='/mysite/'
User site: http://example.com/user/ Admin site: http://example.com/admin/
./bin/php/eztc.php -s example_user --access-path='user' ./bin/php/eztc.php -s example_admin --access-path='admin'
User site: http://example.com/index.php/ Admin site: http://admin.example.com/index.php/
./bin/php/eztc.php -s example_user --index-file='/index.php' ./bin/php/eztc.php -s example_admin --index-file='/index.php'
User site: http://example.com/mysite/index.php/ Admin site: http://admin.example.com/mysite/index.php/
./bin/php/eztc.php -s example_user --www-dir='/mysite' \ -- index-file='/index.php' ./bin/php/eztc.php -s example_admin --www-dir='/mysite' \ -- index-file='/index.php'
User site: http://example.com/index.php/user/ Admin site: http://example.com/index.php/admin/
./bin/php/eztc.php -s example_user --access-path='user' \ -- index-file='/index.php' ./bin/php/eztc.php -s example_admin --access-path='admin' \ -- index-file='/index.php'
User site: http://example.com/mysite/index.php/user/ Admin site: http://example.com/mysite/index.php/admin/
./bin/php/eztc.php -s example_user --access-path='user' \ -- index-file='/index.php' --www-dir='/mysite' ./bin/php/eztc.php -s example_admin --access-path='admin' \ -- index-file='/index.php' --www-dir='/mysite'
Comments