From 9236bb0c36436e8bb1913976cf8fdac5f4e42fe4 Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 22 Jan 2001 15:00:09 +0000 Subject: [PATCH] added BUGS and INSTALL, updated docs, FAQ, README --- BUGS | 12 ++++++++++++ FAQ | 11 +++++------ INSTALL | 24 ++++++++++++++++++++++++ README | 30 ------------------------------ doc.sgm | 46 ++++++++++++++++++++++++++-------------------- 5 files changed, 67 insertions(+), 56 deletions(-) create mode 100644 BUGS create mode 100644 INSTALL diff --git a/BUGS b/BUGS new file mode 100644 index 00000000..c39c6b52 --- /dev/null +++ b/BUGS @@ -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. diff --git a/FAQ b/FAQ index 977856c6..4417cbfa 100644 --- a/FAQ +++ b/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. diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..2dfb7729 --- /dev/null +++ b/INSTALL @@ -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. diff --git a/README b/README index a32a27fa..ca347592 100644 --- a/README +++ b/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. diff --git a/doc.sgm b/doc.sgm index ed765827..0fe2f338 100644 --- a/doc.sgm +++ b/doc.sgm @@ -1733,34 +1733,40 @@ is the first week that has at least 4 days in the current year, and with Monday Smarty/PHP errors 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. 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. + Check the BUGS file that comes with the latest distribution of Smarty, or + check the website. + + + + PEAR + + 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.