mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
update paths for windows (c:)
This commit is contained in:
2
FAQ
2
FAQ
@@ -139,4 +139,4 @@ Q: My ISP did not setup the PEAR repository, nor will they set it up. How do I
|
|||||||
A: The easiest thing to do is grab all of PEAR and install it locally for your
|
A: The easiest thing to do is grab all of PEAR and install it locally for your
|
||||||
own use. There's nothing that says PEAR must be installed in its default
|
own use. There's nothing that says PEAR must be installed in its default
|
||||||
directory. There won't be a version of Smarty that runs without PEAR, as it
|
directory. There won't be a version of Smarty that runs without PEAR, as it
|
||||||
quite dependant on it.
|
dependant on it, and may become moreso in the future.
|
||||||
|
4
NEWS
4
NEWS
@@ -13,8 +13,8 @@ Version 1.4.0
|
|||||||
- updated GLOBAL_ASSIGN to take SCRIPT_NAME from HTTP_SERVER_VARS
|
- updated GLOBAL_ASSIGN to take SCRIPT_NAME from HTTP_SERVER_VARS
|
||||||
instead of global variable. You can also assign several variables
|
instead of global variable. You can also assign several variables
|
||||||
in one shot with an array. (Monte, Roman Neuhauser)
|
in one shot with an array. (Monte, Roman Neuhauser)
|
||||||
- added template filters, register_filer() and unregister_filter() API
|
- added template prefilters, register_prefilter() and
|
||||||
functions. (Monte)
|
unregister_prefilter() API functions. (Monte)
|
||||||
- added RELEASE_NOTES file to distribution. (Monte)
|
- added RELEASE_NOTES file to distribution. (Monte)
|
||||||
- moved CREDITS out of manual into its own file. (Monte)
|
- moved CREDITS out of manual into its own file. (Monte)
|
||||||
- added register_resource() and unregister_resource() API functions. (Monte)
|
- added register_resource() and unregister_resource() API functions. (Monte)
|
||||||
|
@@ -54,10 +54,10 @@ bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any
|
|||||||
date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
|
date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
|
||||||
etc. Just give some formats a try and see what works.
|
etc. Just give some formats a try and see what works.
|
||||||
|
|
||||||
Smarty now has template filters, meaning that you can run your templates
|
Smarty now has template prefilters, meaning that you can run your templates
|
||||||
through custom functions before they are compiled. This is good for things like
|
through custom functions before they are compiled. This is good for things like
|
||||||
removing unwanted comments, keeping an eye on words or functionality people are
|
removing unwanted comments, keeping an eye on words or functionality people are
|
||||||
putting in templates, translating XML -> HTML, etc. See the register_filter
|
putting in templates, translating XML -> HTML, etc. See the register_prefilter
|
||||||
documentation for more info.
|
documentation for more info.
|
||||||
|
|
||||||
Another addition are the so-called compiler functions. These are custom
|
Another addition are the so-called compiler functions. These are custom
|
||||||
@@ -65,7 +65,7 @@ functions registered by the user that are executed at compilation time of the
|
|||||||
template. They can be used to inject PHP code or time-sensitive static content
|
template. They can be used to inject PHP code or time-sensitive static content
|
||||||
into the compiled template.
|
into the compiled template.
|
||||||
|
|
||||||
The run-time custom functions are now passed Smarty object as the second
|
The run-time custom functions are now passed the Smarty object as the second
|
||||||
parameter. This can be used, for example, to assign or clear template variables
|
parameter. This can be used, for example, to assign or clear template variables
|
||||||
from inside the custom function.
|
from inside the custom function.
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ clear_compile_dir() was added for clearing out compiled versions of your
|
|||||||
templates. Not something normally needed, but you may have a need for this if
|
templates. Not something normally needed, but you may have a need for this if
|
||||||
you have $compile_check set to false and you periodically update templates via
|
you have $compile_check set to false and you periodically update templates via
|
||||||
some automated process. As of 1.4.0, uncompiled templates _always_ get
|
some automated process. As of 1.4.0, uncompiled templates _always_ get
|
||||||
compiled, regardless of $compile_check setting, although they won't be checked
|
compiled regardless of $compile_check setting, although they won't be checked
|
||||||
for recompile if $compile_check is set to false.
|
for recompile if $compile_check is set to false.
|
||||||
|
|
||||||
You can now refer to properties of objects assigned from PHP by using the '->'
|
You can now refer to properties of objects assigned from PHP by using the '->'
|
||||||
@@ -89,9 +89,9 @@ The format of the files created in the $compile_dir are now a bit different.
|
|||||||
The compiled template filename is the template resource name url-encoded.
|
The compiled template filename is the template resource name url-encoded.
|
||||||
Therefore, all compiled files are now in the top directory of $compile_dir.
|
Therefore, all compiled files are now in the top directory of $compile_dir.
|
||||||
This was done to make way for arbitrary template resources. Each compiled
|
This was done to make way for arbitrary template resources. Each compiled
|
||||||
template has a header that states what template resource was used to create it.
|
template also has a header that states what template resource was used to
|
||||||
From a unix command prompt, you can use "head -2 *" to see the first two lines
|
create it. From a unix command prompt, you can use "head -2 *" to see the first
|
||||||
of each file.
|
two lines of each file.
|
||||||
|
|
||||||
When upgrading to 1.4.0, you will want to clear out all your old files in the
|
When upgrading to 1.4.0, you will want to clear out all your old files in the
|
||||||
$compile_dir. If you have $compile_check set to false and the compiled template
|
$compile_dir. If you have $compile_check set to false and the compiled template
|
||||||
|
@@ -624,7 +624,7 @@ class Smarty
|
|||||||
|
|
||||||
switch ($resource_type) {
|
switch ($resource_type) {
|
||||||
case 'file':
|
case 'file':
|
||||||
if ($resource_name{0} != '/') {
|
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/",$resource_name)) {
|
||||||
// relative pathname to $template_dir
|
// relative pathname to $template_dir
|
||||||
$resource_name = $this->template_dir.'/'.$resource_name;
|
$resource_name = $this->template_dir.'/'.$resource_name;
|
||||||
}
|
}
|
||||||
@@ -637,7 +637,6 @@ class Smarty
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (isset($this->resource_funcs[$resource_type])) {
|
if (isset($this->resource_funcs[$resource_type])) {
|
||||||
$funcname = $this->resource_funcs[$resource_type];
|
$funcname = $this->resource_funcs[$resource_type];
|
||||||
|
@@ -624,7 +624,7 @@ class Smarty
|
|||||||
|
|
||||||
switch ($resource_type) {
|
switch ($resource_type) {
|
||||||
case 'file':
|
case 'file':
|
||||||
if ($resource_name{0} != '/') {
|
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/",$resource_name)) {
|
||||||
// relative pathname to $template_dir
|
// relative pathname to $template_dir
|
||||||
$resource_name = $this->template_dir.'/'.$resource_name;
|
$resource_name = $this->template_dir.'/'.$resource_name;
|
||||||
}
|
}
|
||||||
@@ -637,7 +637,6 @@ class Smarty
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (isset($this->resource_funcs[$resource_type])) {
|
if (isset($this->resource_funcs[$resource_type])) {
|
||||||
$funcname = $this->resource_funcs[$resource_type];
|
$funcname = $this->resource_funcs[$resource_type];
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* This script is for upgrading from 1.3.2 -> 1.4.0.
|
||||||
* This script will convert Smarty variable references from the old format to
|
* This script will convert Smarty variable references from the old format to
|
||||||
* the new one. For example, what used to look like $section1/foo.bar will now
|
* the new one. For example, what used to look like $section1/foo.bar will now
|
||||||
* be $foo[section1].bar. This allows for more readable syntax and also allows
|
* be $foo[section1].bar. This allows for more readable syntax and also allows
|
||||||
|
Reference in New Issue
Block a user