mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
added BUGS and INSTALL, updated docs, FAQ, README
This commit is contained in:
12
BUGS
Normal file
12
BUGS
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
There are no known bugs with Smarty, although there are some bugs in PHP that
|
||||||
|
cause problems with Smarty. preg_replace() had a parameter added in 4.0.2 that
|
||||||
|
is needed for Smarty. preg_grep() previous to 4.0.4 has a bug which Smarty has
|
||||||
|
a built-in workaround for. PHP 4.0.4 has a bug with user callbacks which would
|
||||||
|
cause this syntax in Smarty to crash PHP: {$varname|@modname} Use PHP 4.0.4pl1
|
||||||
|
to fix this, or avoid using the "@" with modifiers. To be absolutely safe, use
|
||||||
|
4.0.4pl or later with Smarty.
|
||||||
|
|
||||||
|
Also be sure to include the path to the PEAR libraries in your php
|
||||||
|
include_path. Config_file.class.php uses the PEAR library for its error
|
||||||
|
handling routines. PEAR comes with the PHP distribution. Unix users check
|
||||||
|
/usr/local/lib/php, windows users check C:/php/pear.
|
11
FAQ
11
FAQ
@@ -17,10 +17,9 @@ A: preg_replace had a parameter added in PHP 4.0.2 that Smarty
|
|||||||
|
|
||||||
Q: I get the following error when running Smarty:
|
Q: I get the following error when running Smarty:
|
||||||
Fatal error: Failed opening required 'PEAR.php'
|
Fatal error: Failed opening required 'PEAR.php'
|
||||||
(include_path='c:\inetpub\wwwroot\intra\php') in Config_File.class.php on
|
(include_path='') in Config_File.class.php on line 3
|
||||||
line 3
|
A: Smarty uses the PEAR libraries for some of its error handling routines.
|
||||||
A: The pear libraries come bundled with PHP. In Unix, the default location
|
PEAR libraries come with the distribution of PHP. Be sure that the path to
|
||||||
is in /usr/local/lib/php/. On Windows, it is under
|
these libraries is included in your php include_path. Unix users check
|
||||||
the directory you installed PHP, probably c:/php/pear/.
|
/usr/local/lib/php. Windows users check C:/php/pear.
|
||||||
Locate these files and add this directory to your php_include path.
|
|
||||||
|
|
||||||
|
24
INSTALL
Normal file
24
INSTALL
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
REQUIREMENTS:
|
||||||
|
|
||||||
|
Smarty requires PHP 4.0.4pl1 or later to fix all known problems Smarty has
|
||||||
|
with PHP. Smarty was developed and tested with 4.0.4pl1. See the BUGS file
|
||||||
|
for more info.
|
||||||
|
|
||||||
|
Smarty uses the PEAR libraries for some of its error handling routines.
|
||||||
|
PEAR libraries come with the distribution of PHP. Be sure that the path to
|
||||||
|
these libraries is included in your php include_path. Unix users check
|
||||||
|
/usr/local/lib/php. Windows users check C:/php/pear.
|
||||||
|
|
||||||
|
INSTALLATION:
|
||||||
|
|
||||||
|
* copy the Smarty.class.php, Smarty.addons.php and Config_File.class.php
|
||||||
|
scripts to a directory that is in your PHP include path.
|
||||||
|
|
||||||
|
* in the same directory as your php application, create a "templates"
|
||||||
|
directory, "configs" directory and a "templates_c" directory. Be sure the
|
||||||
|
"templates_c" directory is writable by your web server user (usually nobody).
|
||||||
|
You can also chmod 777 this directory, but be aware of security issues for
|
||||||
|
multi-user systems.
|
||||||
|
|
||||||
|
* setup your php and template files. A good working example is included to get
|
||||||
|
you started.
|
30
README
30
README
@@ -48,36 +48,6 @@ DESCRIPTION:
|
|||||||
although not recommended and doubtfully needed since the engine
|
although not recommended and doubtfully needed since the engine
|
||||||
is so customizable.
|
is so customizable.
|
||||||
|
|
||||||
|
|
||||||
REQUIREMENTS:
|
|
||||||
|
|
||||||
Smarty requires PHP 4.0.2 or later. Smarty was developed and tested
|
|
||||||
with 4.0.4pl1. See the BUGS section below.
|
|
||||||
|
|
||||||
INSTALLATION:
|
|
||||||
|
|
||||||
* copy the Smarty.class.php, Smarty.addons.php and Config_File.class.php
|
|
||||||
scripts to a directory that is in your PHP include path.
|
|
||||||
|
|
||||||
* in the same directory as your php application,
|
|
||||||
create a "templates" directory and a "templates_c" directory.
|
|
||||||
Be sure the "templates_c" directory is writable by your
|
|
||||||
web server user (usually nobody), or chmod 777 the directory if
|
|
||||||
you are not sure.
|
|
||||||
|
|
||||||
* setup your php and template files. A good working example is
|
|
||||||
included to get you started.
|
|
||||||
|
|
||||||
BUGS:
|
|
||||||
|
|
||||||
There are no known bugs with Smarty, although there are some bugs in PHP
|
|
||||||
that cause problems with Smarty. preg_replace() had a parameter added in
|
|
||||||
4.0.2 that is needed for Smarty. preg_grep() previous to 4.0.4 has a bug
|
|
||||||
which Smarty has a built-in workaround for. PHP 4.0.4 has a bug with user
|
|
||||||
callbacks which would cause this syntax in Smarty to crash PHP:
|
|
||||||
{$varname|@modname} Use PHP 4.0.4pl1 to fix this, or avoid using the "@"
|
|
||||||
with modifiers. To be absolutely safe, use 4.0.4pl or later with Smarty.
|
|
||||||
|
|
||||||
COPYRIGHT:
|
COPYRIGHT:
|
||||||
Copyright(c) 2000,2001 ispi. All rights reserved.
|
Copyright(c) 2000,2001 ispi. All rights reserved.
|
||||||
This software is released under the GNU General Public License.
|
This software is released under the GNU General Public License.
|
||||||
|
46
doc.sgm
46
doc.sgm
@@ -1733,34 +1733,40 @@ is the first week that has at least 4 days in the current year, and with Monday
|
|||||||
<title>Smarty/PHP errors</title>
|
<title>Smarty/PHP errors</title>
|
||||||
<para>
|
<para>
|
||||||
As of now, Smarty is not a validating template parser. This means that
|
As of now, Smarty is not a validating template parser. This means that
|
||||||
the parser will blindly convert the template to PHP scripts, irregardless
|
the parser will blindly convert the template to PHP scripts,
|
||||||
of any syntax errors in the markup tags that may be present in the template.
|
irregardless of any syntax errors in the markup tags that may be
|
||||||
Smarty can catch certain template errors like missing attributes to
|
present in the template. Smarty can catch certain template errors like
|
||||||
functions, but not syntax errors like missing close tags.
|
missing attributes to functions, but not syntax errors like missing
|
||||||
These types of errors can end up in PHP run-time errors.
|
close tags. These types of errors can end up in PHP compile-time
|
||||||
When you encounter a PHP error when attempting to display the
|
errors. When you encounter a PHP error when attempting to display the
|
||||||
template in a browser, the error line number will correspond to the
|
template in a browser, the error line number will correspond to the
|
||||||
compiled PHP template, not the template itself. This may be a bit confusing
|
compiled PHP script, not the template itself. This may be a bit
|
||||||
or for the template designer. Our experience is to tell the
|
confusing or for the template designer. Our experience is to tell the
|
||||||
designers to check their work often, and ask the programmers for help
|
designers to check their work often, and ask the programmers for help
|
||||||
if they are really stuck. Usually you can look at the template and spot the
|
if they are really stuck. Usually you can look at the template and spot
|
||||||
syntax error. Maybe you left a delimeter off, or you didn't properly close
|
the syntax error. Here are some common things to look for: missing
|
||||||
an {if}{/if} or {section}{/section} tag. If you can't find it, you must open
|
close tags for {if}{/if} or {section}{/section}, missing end variable
|
||||||
the compiled PHP file and go to the line number to figure out what went wrong.
|
delimiters like {%sec.var} instead of {%sec.var%}, or {#var} instead of
|
||||||
|
{#var#}. If you can't find the error, you must open the compiled PHP
|
||||||
|
file and go to the line number to figure out where the corresponding
|
||||||
|
error is in the template.
|
||||||
</para>
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
<chapter id="bugs">
|
<chapter id="bugs">
|
||||||
<title>BUGS</title>
|
<title>BUGS</title>
|
||||||
<para>
|
<para>
|
||||||
There are no known bugs with Smarty, although there are some bugs in PHP
|
Check the BUGS file that comes with the latest distribution of Smarty, or
|
||||||
that cause problems with Smarty. preg_replace() had a parameter added in
|
check the website.
|
||||||
4.0.2 that is needed for Smarty. preg_grep() previous to 4.0.4 has a bug
|
</para>
|
||||||
which Smarty has a built-in workaround for. PHP 4.0.4 has a bug with user
|
</chapter>
|
||||||
callbacks which would cause this syntax in Smarty to crash PHP:
|
<chapter id="bugs">
|
||||||
{$varname|@modname} Use PHP 4.0.4pl1 to fix this, or avoid using the "@"
|
<title>PEAR</title>
|
||||||
with <link linkend="variable.modifiers">modifiers</link>. To be absolutely
|
<para>
|
||||||
safe, use 4.0.4pl or later with Smarty.
|
Smarty uses the PEAR libraries for some of its error handling routines.
|
||||||
|
PEAR libraries come with the distribution of PHP. Be sure that the path to
|
||||||
|
these libraries is included in your php include_path. Unix users check
|
||||||
|
/usr/local/lib/php. Windows users check C:/php/pear.
|
||||||
</para>
|
</para>
|
||||||
</chapter>
|
</chapter>
|
||||||
<chapter id="credits">
|
<chapter id="credits">
|
||||||
|
Reference in New Issue
Block a user