mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54: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:
|
||||
Fatal error: Failed opening required 'PEAR.php'
|
||||
(include_path='c:\inetpub\wwwroot\intra\php') in Config_File.class.php on
|
||||
line 3
|
||||
A: The pear libraries come bundled with PHP. In Unix, the default location
|
||||
is in /usr/local/lib/php/. On Windows, it is under
|
||||
the directory you installed PHP, probably c:/php/pear/.
|
||||
Locate these files and add this directory to your php_include path.
|
||||
(include_path='') in Config_File.class.php on line 3
|
||||
A: 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.
|
||||
|
||||
|
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
@@ -47,36 +47,6 @@ DESCRIPTION:
|
||||
* it is possible to imbed PHP code right in your template files,
|
||||
although not recommended and doubtfully needed since the engine
|
||||
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(c) 2000,2001 ispi. All rights reserved.
|
||||
|
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>
|
||||
<para>
|
||||
As of now, Smarty is not a validating template parser. This means that
|
||||
the parser will blindly convert the template to PHP scripts, irregardless
|
||||
of any syntax errors in the markup tags that may be present in the template.
|
||||
Smarty can catch certain template errors like missing attributes to
|
||||
functions, but not syntax errors like missing close tags.
|
||||
These types of errors can end up in PHP run-time errors.
|
||||
When you encounter a PHP error when attempting to display the
|
||||
the parser will blindly convert the template to PHP scripts,
|
||||
irregardless of any syntax errors in the markup tags that may be
|
||||
present in the template. Smarty can catch certain template errors like
|
||||
missing attributes to functions, but not syntax errors like missing
|
||||
close tags. These types of errors can end up in PHP compile-time
|
||||
errors. When you encounter a PHP error when attempting to display 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
|
||||
or for the template designer. Our experience is to tell the
|
||||
compiled PHP script, not the template itself. This may be a bit
|
||||
confusing or for the template designer. Our experience is to tell the
|
||||
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
|
||||
syntax error. Maybe you left a delimeter off, or you didn't properly close
|
||||
an {if}{/if} or {section}{/section} tag. If you can't find it, you must open
|
||||
the compiled PHP file and go to the line number to figure out what went wrong.
|
||||
if they are really stuck. Usually you can look at the template and spot
|
||||
the syntax error. Here are some common things to look for: missing
|
||||
close tags for {if}{/if} or {section}{/section}, missing end variable
|
||||
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>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<chapter id="bugs">
|
||||
<title>BUGS</title>
|
||||
<para>
|
||||
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 <link linkend="variable.modifiers">modifiers</link>. To be absolutely
|
||||
safe, use 4.0.4pl or later with Smarty.
|
||||
Check the BUGS file that comes with the latest distribution of Smarty, or
|
||||
check the website.
|
||||
</para>
|
||||
</chapter>
|
||||
<chapter id="bugs">
|
||||
<title>PEAR</title>
|
||||
<para>
|
||||
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>
|
||||
</chapter>
|
||||
<chapter id="credits">
|
||||
|
Reference in New Issue
Block a user