Lots of additional cross linking by Peter.

This commit is contained in:
messju
2005-05-23 15:43:01 +00:00
parent 4b80984d6a
commit a6e4f90a69
56 changed files with 490 additions and 161 deletions

View File

@@ -6,7 +6,9 @@
This is the name of the directory where template caches are
stored. By default this is "./cache", meaning that it will look
for the cache directory in the same directory as the executing
php script. You can also use your own custom cache handler
php script. You can also use your own
<link linkend="section.template.cache.handler.func">
custom cache handler</link>
function to control cache files, which will ignore this
setting.
</para>

View File

@@ -4,7 +4,8 @@
<title>$cache_handler_func</title>
<para>
You can supply a custom function to handle cache files instead
of using the built-in method using the $cache_dir. See the
of using the built-in method using the
<link linkend="variable.cache.dir">$cache_dir</link>. See the
custom <link linkend="section.template.cache.handler.func">cache
handler function section</link> for details.
</para>

View File

@@ -24,8 +24,9 @@
<para>
If you want to give certain templates their own cache lifetime, you could
do this by setting <link linkend="variable.caching">$caching</link> = 2,
then set $cache_lifetime to a unique value just before calling display()
or fetch().
then set $cache_lifetime to a unique value just before calling
<link linkend="api.display">display()</link>
or <link linkend="api.fetch">fetch()</link>.
</para>
</note>
</sect1>

View File

@@ -8,17 +8,22 @@
redundant redundant content, it is advisable to turn on caching. This
will result in significant performance gains. You can also have multiple
caches for the same template. A value of 1 or 2 enables caching. 1 tells
Smarty to use the current $cache_lifetime variable to determine if the
Smarty to use the current
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
variable to determine if the
cache has expired. A value of 2 tells Smarty to use the cache_lifetime
value at the time the cache was generated. This way you can set the
cache_lifetime just before fetching the template to have granular
control over when that particular cache expires. See also <link
linkend="api.is.cached">is_cached</link>.
control over when that particular cache expires.
See also <link linkend="api.is.cached">is_cached()</link>.
</para>
<para>
If $compile_check is enabled, the cached content will be regenerated if
If <link linkend="variable.compile.check">$compile_check</link>
is enabled, the cached content will be regenerated if
any of the templates or config files that are part of this cache are
changed. If $force_compile is enabled, the cached content will always be
changed. If
<link linkend="variable.force.compile">$force_compile</link>
is enabled, the cached content will always be
regenerated.
</para>
</sect1>

View File

@@ -12,11 +12,13 @@
step is no longer needed. Be sure to set $compile_check to "false" for
maximal performance. Note that if you change this to "false" and a
template file is changed, you will *not* see the change since the
template will not get recompiled. If caching is enabled and
template will not get recompiled. If
<link linkend="variable.caching">caching</link>
is enabled and
compile_check is enabled, then the cache files will get regenerated if
an involved template file or config file was updated. See <link
linkend="variable.force.compile">$force_compile</link> or <link
linkend="api.clear.compiled.tpl">clear_compiled_tpl</link>.
linkend="api.clear.compiled.tpl">clear_compiled_tpl()</link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -9,12 +9,17 @@
</para>
<para>
With a compile_id you can work around the limitation that you cannot
use the same compile_dir for different template_dirs. If you set a
use the same
<link linkend="variable.compile.dir">$compile_dir</link>
for different
<link linkend="variable.template.dir">$template_dirs</link>. If you set a
distinct compile_id for each template_dir then smarty can tell the
compiled templates apart by their compile_id.
</para>
<para>
If you have for example a prefilter that localizes your templates
If you have for example a
<link linkend="plugins.prefilters.postfilters">prefilter</link>
that localizes your templates
(that is: translates language dependend parts) at compile time, then
you should use the current language as compile_id and you will get a
set of compiled templates for each language you use.

View File

@@ -3,7 +3,9 @@
<sect1 id="variable.config.dir">
<title>$config_dir</title>
<para>
This is the directory used to store config files used in the
This is the directory used to store
<link linkend="config.files">config files</link>
used in the
templates. Default is "./configs", meaning that it will look
for the configs directory in the same directory as the
executing php script.

View File

@@ -4,7 +4,9 @@
<title>$config_read_hidden</title>
<para>
If set to true, hidden sections (section names beginning with a period)
in config files can be read from templates. Typically you would leave
in
<link linkend="config.files">config files</link>
can be read from templates. Typically you would leave
this false, that way you can store sensitive data in the config files
such as database parameters and not worry about the template loading
them. false by default.

View File

@@ -7,6 +7,12 @@
default, it is named debug.tpl and is located in the <link
linkend="constant.smarty.dir">SMARTY_DIR</link>.
</para>
<para>
See also
<link linkend="variable.debugging">$debugging</link>
and
<link linkend="chapter.debugging.console">Debugging console</link>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -6,9 +6,13 @@
This allows alternate ways to enable debugging. NONE means no
alternate methods are allowed. URL means when the keyword
SMARTY_DEBUG is found in the QUERY_STRING, debugging is enabled
for that invocation of the script. If $debugging is true, this
for that invocation of the script. If
<link linkend="variable.debugging">$debugging</link> is true, this
value is ignored.
</para>
<para>
See also <link linkend="chapter.debugging.console">Debugging console</link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -9,6 +9,12 @@
included templates and assigned variables for the current
template page.
</para>
<para>
See also
<link linkend="language.function.debug">{debug}</link>,
<link linkend="variable.debug.tpl">$debug_tpl</link>,
and <link linkend="variable.debugging.ctrl">$debuging_ctrl</link>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -4,7 +4,8 @@
<title>$error_reporting</title>
<para>
When this value is set to a non-null-value it's value is used as php's
error_reporting-level inside of <link linkend="api.display">display()</link>
<ulink url="&url.php-manual;error_reporting">error_reporting</ulink>
level inside of <link linkend="api.display">display()</link>
and <link linkend="api.fetch">fetch()</link>. When <link
linkend="chapter.debugging.console">debugging</link> is enabled this value
is ignored and the error-level is left untouched.

View File

@@ -4,9 +4,13 @@
<title>$force_compile</title>
<para>
This forces Smarty to (re)compile templates on every
invocation. This setting overrides $compile_check. By default
this is disabled. This is handy for development and debugging.
It should never be used in a production environment. If caching
invocation. This setting overrides
<link linkend="variable.compile.check">$compile_check</link>.
By default
this is disabled. This is handy for development and
<link linkend="chapter.debugging.console">debugging</link>.
It should never be used in a production environment. If
<link linkend="variable.caching">caching</link>
is enabled, the cache file(s) will be regenerated every time.
</para>
</sect1>

View File

@@ -4,8 +4,10 @@
<title>$plugins_dir</title>
<para>
This is the directory (or directories) where Smarty will look for the
plugins that it needs. Default is "plugins" under the SMARTY_DIR. If you
supply a relative path, Smarty will first look under the SMARTY_DIR, then
plugins that it needs. Default is "plugins" under the
<link linkend="constant.smarty.dir">SMARTY_DIR</link>. If you
supply a relative path, Smarty will first look under the
<link linkend="constant.smarty.dir">SMARTY_DIR</link>, then
relative to the cwd (current working directory), then relative to the PHP
include_path. If $plugins_dir is an array of directories, Smarty will
search for your plugin in each plugin directory in the order they are

View File

@@ -6,9 +6,10 @@
Specifies if Smarty should use php's $HTTP_*_VARS[]
($request_use_auto_globals=false which is the default value) or
$_*[] ($request_use_auto_globals=true). This affects templates
that make use of {$smarty.request.*}, {$smarty.get.*} etc. .
that make use of
<link linkend="language.variables.smarty">{$smarty.request.*}, {$smarty.get.*}</link> etc. .
Caution: If you set $request_use_auto_globals to true, <link
linkend="variable.request.vars.order">variable.request.vars.order
linkend="variable.request.vars.order">$request_vars_order
</link> has no effect but php's configuration value
<literal>gpc_order</literal> is used.
</para>

View File

@@ -6,6 +6,11 @@
The order in which request variables are registered, similar to
variables_order in php.ini
</para>
<para>
See also <link linkend="language.variables.smarty">$smarty.request</link>
and
<link linkend="variable.request.use.auto.globals">$request_use_auto_globals</link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -4,8 +4,18 @@
<title>$secure_dir</title>
<para>
This is an array of all local directories that are considered
secure. {include} and {fetch} use this when security is enabled.
secure.
<link linkend="language.function.include">{include}</link>
and <link linkend="language.function.fetch">{fetch}</link>
use this when
<link linkend="variable.security">security is enabled</link>.
</para>
<para>
See also
<link linkend="variable.security.settings">Security settings</link>,
and <link linkend="variable.trusted.dir">$trusted_dir</link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -4,23 +4,51 @@
<title>$security_settings</title>
<para>
These are used to override or specify the security settings when
security is enabled. These are the possible settings:
<link linkend="variable.security">security is enabled</link>.
These are the possible settings:
</para>
<itemizedlist>
<listitem><para>PHP_HANDLING - true/false. If set to true, the
$php_handling setting is not checked for security.</para></listitem>
<listitem><para>IF_FUNCS - This is an array of the names of permitted
PHP functions in IF statements.</para></listitem>
<listitem><para>INCLUDE_ANY - true/false. If set to true, any
<listitem>
<para>
PHP_HANDLING - true/false. If set to true, the
<link linkend="variable.php.handling">$php_handling</link>
setting is not checked for security.
</para>
</listitem>
<listitem>
<para>
IF_FUNCS - This is an array of the names of permitted PHP functions in
<link linkend="language.function.if">IF</link> statements.
</para>
</listitem>
<listitem>
<para>
INCLUDE_ANY - true/false. If set to true, any
template can be included from the file system, regardless of the
$secure_dir list.</para></listitem>
<listitem><para>PHP_TAGS - true/false. If set to true, {php}{/php}
tags are permitted in the templates.</para></listitem>
<listitem><para>MODIFIER_FUNCS - This is an array of the names of permitted
PHP functions used as variable modifiers.</para></listitem>
<listitem><para>ALLOW_CONSTANTS - true/false. If set to true, constants via
{$smarty.const.name} are allowed in the templates. The defaults is set to
"false" for security.</para></listitem>
<link linkend="variable.secure.dir">$secure_dir</link> list.
</para>
</listitem>
<listitem>
<para>
PHP_TAGS - true/false. If set to true,
<link linkend="language.function.php">{php}{/php}</link>
tags are permitted in the templates.
</para>
</listitem>
<listitem>
<para>
MODIFIER_FUNCS - This is an array of the names of permitted
PHP functions used as variable modifiers.
</para>
</listitem>
<listitem>
<para>
ALLOW_CONSTANTS - true/false. If set to true, constants via
<link linkend="language.variables.smarty.const">{$smarty.const.name}</link>
are allowed in the templates. The defaults is set to
"false" for security.
</para>
</listitem>
</itemizedlist>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -8,20 +8,39 @@
(via ftp for example) and you want to reduce the risk of system
security compromises through the template language. Turning on
security enforces the following rules to the template language,
unless specifially overridden with $security_settings:
unless specifially overridden with
<link linkend="variable.security.settings">$security_settings</link>:
</para>
<itemizedlist>
<listitem><para>If $php_handling is set to SMARTY_PHP_ALLOW, this is
implicitly changed to SMARTY_PHP_PASSTHRU</para></listitem>
<listitem><para>PHP functions are not allowed in IF statements,
except those specified in the $security_settings</para></listitem>
<listitem><para>templates can only be included from directories
listed in the $secure_dir array</para></listitem>
<listitem><para>local files can only be fetched from directories
listed in the $secure_dir array using {fetch}</para></listitem>
<listitem><para>{php}{/php} tags are not allowed</para></listitem>
<listitem><para>PHP functions are not allowed as modifiers, except
those specified in the $security_settings</para></listitem>
<listitem>
<para>If <link linkend="variable.php.handling">$php_handling</link>
is set to SMARTY_PHP_ALLOW, this is
implicitly changed to SMARTY_PHP_PASSTHRU
</para></listitem>
<listitem>
<para>
PHP functions are not allowed in <link
linkend="language.function.if">{if}</link> statements,
except those specified in the
<link linkend="variable.security.settings">$security_settings</link>
</para></listitem>
<listitem><para>
templates can only be included from directories
listed in the
<link linkend="variable.secure.dir">$secure_dir</link> array
</para></listitem>
<listitem><para>
local files can only be fetched from directories listed in the
<link linkend="variable.secure.dir">$secure_dir</link>
array using <link linkend="language.function.fetch">{fetch}</link>
</para></listitem>
<listitem><para>
<link linkend="language.function.php">{php}{/php}</link> tags are not allowed
</para></listitem>
<listitem><para>
PHP functions are not allowed as modifiers, except those specified in the
<link linkend="variable.security.settings">$security_settings</link>
</para></listitem>
</itemizedlist>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -3,9 +3,11 @@
<sect1 id="variable.trusted.dir">
<title>$trusted_dir</title>
<para>
$trusted_dir is only for use when $security is enabled. This is an array
of all directories that are considered trusted. Trusted directories are
where you keep php scripts that are executed directly from the templates
$trusted_dir is only for use when
<link linkend="variable.security">$security</link> is enabled.
This is an array of all directories that are considered trusted.
Trusted directories are where you keep php scripts that are executed
directly from the templates
with <link linkend="language.function.include.php">{include_php}</link>.
</para>
</sect1>