* WIP converting code to PSR-4

* More PSR4 rewriting

* Removed autoload filters

* WIP making compile classes PSR-4

* WIP making compile classes PSR-4

* Replace Smarty:: with symfony/polyfill-mbstring

* WIP making compile classes PSR-4

* finished rewriting all compile classes into PSR-4

* Rewrote all Compile and Compiler classes to PSR-4

* WIP rewriting smarty_internal_method_*

* Finished moving smarty_internal_method_*

* smarty_internal_resource_* to PSR-4

* Refactored all _runtime_* by merging them into the proper classes or by transforming them into Runtime Extensions.

* src/Template/* to PSR-4

* src/sysplugins/* to PSR-4

* Entire src dir now PSR-4 compatible

* Add makefile, PSR-4 ModifierCompilers

* Rewrote all default modifiers and functions from the plugins folder to PSR-4 classes

* Rewrote remaining plugins to PSR-4, plugins dir is now gone.

* WIP moving Smarty to PSR-4.

* fixed pre/post/output filters and removed some old todo-comments

* filter tests passing

* Fixed TemplateObject test

* Fix CustomResourceAmbiguousTest

* Fixed CacheResource implementation and tests

* Fixed setfilter

* Fixed DefaultPluginHandlerTest for function plugins (blocks still break)

* move runPluginFromDefaultHandler to new Runtime class

* Introduce formatParamsArray method for recurring code fragment

* Fix code duplication in block compilers and fix (most) BlockPluginTests. Default plugin handler blocks still need fixing.

* minor fixes

* Implemented the DefaultHandlerBlockCompiler, made the dependencies of the template compiler into properties, fixed a couple of unit tests

* Removed support for PHP include path, and removed the ::loadPlugin method.

* Removed now unneeded PHPunit annotations @run(Tests)InSeparateProcess, @preserveGlobalState and @backupStaticAttributes. Made CacheResourceTestCommon abstract to prevent the base class from running tests (and always failing). Unregister a previously registered stream wrapper. Fixes a lot of tests.

* Fix scoping / global state problems in tests by using DI in Default Extension. Also removing a bunch of old fashioned phpdoc annotations that are superseded by namespaces.

* Make DefaultExtension lazy load again.

* Removed deprecated extends_recursion property and fix bug in CodeFrame compiler due to use of clone.

* Fixed BC loading of resource pluging from dir and all ResourcePluginTest tests

* Removed PHP functions and checks for the already removed php modifiers. Re-implemented functions as regular functions. Probably should compile these directly.

* Fixed stream resources

* 2 small fixes for unit tests

* Fixed modifiercompiler handling multiple/chained modifiers

* Rewrote global static global_tpl_vars to getters/setters on Smarty class, fixing several test cases. Added a ::getValue() method to Variable.

* Fixed issue related to scoping of left/right delimiter overrides

* Added strlen function, fixing some unit tests

* Fix bug in calling BC function handlers.

* WIP replacing direct access tpl_vars with proper getter/setters.

* WIP

* WIP rewriting variable scopes

* WIP fixing the complicated variables scopes architecture. Right now more tests are failing than before... :(

* Fixed minor unit tests

* Made variable scoping more sensible

* Fix configfile tests

* removed phpplugin, removed now unused uncompiled handler and all checks for this, fixed a refactorbug in InheritanceRuntime. Moved getRenderedTemplateCode method to Smarty\Template. Renamed Cache en Compiled base class to GeneratedPhpFile for more clarity and distinction from Resource classes. Inlined Cached::create into its only caller. Some other minor improvements. Removed php7.1 CI tests.

* Removed the allowUndefinedVars check from the smarty error handlers, because undefined vars no longer throw an error, unless smarty->error_unassigned is set to true.

* Replace direct access to inheritance property on Template object by proper getter.

* converted 3 public properties on Template into getters/setters. unified Template creation code. Provided a getter/setter for the has_nocache_code property. Removed the useless DataObject class. Fixed a few tests. Removed the variable-allow-php-templates property from the docs.

* Simplified the (no)caching architecture by:
- removing support for $cache_attrs for registered plugins,
- removing the undocumented {make_nocache} tag and the deprecated {insert} tag and associated code
- removing support for a compile_id property on include tags.

Fixes a bug in extends: resources by propagating the nocache-hashes between a master template and it's subtemplates in \Smarty\Template::_subTemplateRender. This might need further improvement.

* Removed unneeded magic setters/getters/destructors and the like.

* Replaced a bunch of direct property access with getters/setters.

* Update test runners: no longer support PHP7.1, add PHP8.2

* Fixed scope in variable assignments in included and extended templates, fixed dependencies for testing freshness of caches. Added some unit tests and fixed a class reference to pass some more tests.

* Fix searchParents parameter, fixing GetTemplateVarsTest

* @var integer > @var int for vsCode

* Fix function caching function name

* Fixed cacheability of block plugins.

* Moved handling of smarty.block.* to special compilers, because they aren't real tags. Organized tag-stack handling in compiler, unified nocache handling in compiler.

* Fixed block append/prepend functionality

* Fix testRegisterCompilerFunction by parsing argument correctly.

* Made exception msgs exactly the same again, fixing some unit tests

* Fix default plugin handler

* Simply the "isFresh" method by not including the first param anymore. Fix a couple of unit tests by respecting tag_nocache set by nocache vars used in a tag.

* Removed the undocumented {block_parent} and {parent} alternatives to {$smarty.block.parent}
and {block_child} and {child} alternatives to {$smarty.block.child}

* Fix inhertiance implementation for $smarty.block.child

* Fixed all inheritance issues

* Handle BC registered compilers and missed parameters for openTag and closeTag.

* Fix all foreach unit tests

* Fixed the {if} failures.

* Fix major {include} bug

* Fixed bug in {include} variable assignment and removed some unused/unrequired code

* Fix function call compilation using {functionname} syntax for in-template defined functions.

* Drop a unit tests bc we no longer support direct access to PHP-functinos such as sin()

* Fixed all scope assignment bugs

* Convert isset and empty to modifiercomilers, and smooth the error handling to fix unit tests.

* Fixed getCachedContent

* Add TODO list

* Run composer install before online test run

* Attempt to fix CI

* revise CI/CD workflows, bypass packagist for lexer

* Update ci.yml

* Update ci.yml

* fixes in source files

* Update ci.yml

* Update ci.yml

* attempt to load smarty-lexer directly from zip file

* Shouldnt need Github token now

* correct type of repository

* Updated the changelog

* Re-organized rendering (read source / compile / cache) process to avoid circular dependencies.
Deactivated merge_compiled_includes and the {include inline} attribute. They don't seem to do much in terms of performance, but we'll
have to check back.

* updated todo

* Fix smarty-lexer dependency for the time being

* Fix smarty-lexer dependency for the time being (remove direct ref to github)

* Pushed Lexers/Parsers into VCS again in order to be able to deliver using Packagist/Composer

* Re-organized rendering (read source / compile / cache) process to avoid circular dependencies.

* Run make regardless of timestamps, so we are sure unit tests run with the generated PHP code, not with accidental human made changes to Lexer/Parser.

* Update composer packages cache key

Update composer packages cache key to trigger refresh on lexer

* 4.0.2 of smarty-lexer is released, use that

* Throw compile error when using a modifier where it won't work. Fixes #526.

* verify that native PHP functions cannot be used as a modifier and verify that an easy userland workaround exists. Fixes #813.

* Add test for registering compiler plugin with positional params. Fixes #164

* move test methods because some other test methods rely on their relative positions

* Smarty no longer calls `mb_internal_encoding()` and doesn't check for deprecated `mbstring.func_overload` ini directive.
Fixes #480.

* Generated `<script>` tags lo longer have deprecated `type="text/javascript"` or `language="Javascript"` attributes.
Fixes #815.

* Fix error in docs on prepend/append. Fixes #818.

* Move all creating of templates to Smarty::createTemplate, adding a private property containing previously generated templates for speed.

* Load compiled object in template constructor so it will be cached.

* WIP for performance improvements.

Removed $smarty->_current_file and $smarty->allow_ambiguous_resources properties, both unused. Removed public Source::filepath property.
Cached an Compiled files (and Exceptions) no longer rely on the filepath being set. Removed explicit tests for cached and compiled filenames. The exact implementation is not important. Added tests for compile_check property, fixing a file_exists check that would always be done on source template files, even when compile_check was true. Remove code duplication between Source en Config classes. Added a local $_smarty_current_dir to the generated code files for backwards compatability for {$smarty.current_dir}.

* remove additional calls to getCached()

* updated todo

* Add mkdocs for docs

* add missing folder for unit tests

* Revert latest CI changes, we'll update docs by hand for now

* multiversion mkdocs config

* fixes to docs

* WIP improving the docs

* Improved another chunk of the designers docs

* Finished improving designers docs

* Update code examples to use Smarty\Smarty and autoload instead of require_once calls and new Smarty

* Further WIP improving docs

* Updated changelog and todo list

* WIP on API docs

* WIP docs (added page on config)

* Fixed markdown syntax. Fixes #879

* Added full support and documentation for ternary operator.
Fixes #881

* updated changelog

* fixed error in the mkdocs TOC

* Added support for null coalescing operator
Fixes #882

* Add docs for null coalescing

* more docs

* Improved docs on compile checking and inheritance

* Rewrote docs on filters and resources.

* Add makefile entries for generating docs

* Docs on caching

* finished docs on security and extending smarty

* Added Smarty::setExtensions(), fixed unit test for the null coalescing operator. Updated docs about registering a custom extension.

* updated todos

* fix template invalidation when migrating to 5.0
This commit is contained in:
Simon Wisselink
2023-08-08 00:04:14 +02:00
committed by GitHub
parent a3cbdc46fb
commit 8fd949ac5d
771 changed files with 27126 additions and 36092 deletions

View File

@ -1,49 +0,0 @@
addConfigDir()
add a directory to the list of directories where config files are stored
Description
===========
Smarty
addConfigDir
string\|array
config\_dir
string
key
<?php
// add directory where config files are stored
$smarty->addConfigDir('./config_1');
// add directory where config files are stored and specify array-key
$smarty->addConfigDir('./config_1', 'one');
// add multiple directories where config files are stored and specify array-keys
$smarty->addTemplateDir(array(
'two' => './config_2',
'three' => './config_3',
));
// view the template dir chain
var_dump($smarty->getConfigDir());
// chaining of method calls
$smarty->setConfigDir('./config')
->addConfigDir('./config_1', 'one')
->addConfigDir('./config_2', 'two');
?>
See also [`getConfigDir()`](#api.get.config.dir),
[`setConfigDir()`](#api.set.config.dir) and
[`$config_dir`](#variable.config.dir).

View File

@ -1,49 +0,0 @@
addTemplateDir()
add a directory to the list of directories where templates are stored
Description
===========
Smarty
addTemplateDir
string\|array
template\_dir
string
key
<?php
// add directory where templates are stored
$smarty->addTemplateDir('./templates_1');
// add directory where templates are stored and specify array-key
$smarty->addTemplateDir('./templates_1', 'one');
// add multiple directories where templates are stored and specify array-keys
$smarty->addTemplateDir(array(
'two' => './templates_2',
'three' => './templates_3',
));
// view the template dir chain
var_dump($smarty->getTemplateDir());
// chaining of method calls
$smarty->setTemplateDir('./templates')
->addTemplateDir('./templates_1', 'one')
->addTemplateDir('./templates_2', 'two');
?>
See also [`getTemplateDir()`](#api.get.template.dir),
[`setTemplateDir()`](#api.set.template.dir) and
[`$template_dir`](#variable.template.dir).

View File

@ -1,46 +0,0 @@
appendByRef()
append values by reference
Description
===========
void
appendByRef
string
varname
mixed
var
bool
merge
This is used to [`append()`](#api.append) values to the templates by
reference.
> **Note**
>
> With the introduction of PHP5, `appendByRef()` is not necessary for
> most intents and purposes. `appendByRef()` is useful if you want a PHP
> array index value to be affected by its reassignment from a template.
> Assigned object properties behave this way by default.
NOTE.PARAMETER.MERGE
<?php
// appending name/value pairs
$smarty->appendByRef('Name', $myname);
$smarty->appendByRef('Address', $address);
?>
See also [`append()`](#api.append), [`assign()`](#api.assign) and
[`getTemplateVars()`](#api.get.template.vars).

View File

@ -56,6 +56,5 @@ NOTE.PARAMETER.MERGE
See also [`appendByRef()`](#api.append.by.ref),
[`assign()`](#api.assign) and
See also [`assign()`](#api.assign) and
[`getTemplateVars()`](#api.get.template.vars)

View File

@ -1,42 +0,0 @@
assignByRef()
assign values by reference
Description
===========
void
assignByRef
string
varname
mixed
var
This is used to [`assign()`](#api.assign) values to the templates by
reference.
> **Note**
>
> With the introduction of PHP5, `assignByRef()` is not necessary for
> most intents and purposes. `assignByRef()` is useful if you want a PHP
> array index value to be affected by its reassignment from a template.
> Assigned object properties behave this way by default.
<?php
// passing name/value pairs
$smarty->assignByRef('Name', $myname);
$smarty->assignByRef('Address', $address);
?>
See also [`assign()`](#api.assign),
[`clearAllAssign()`](#api.clear.all.assign), [`append()`](#api.append),
[`{assign}`](#language.function.assign) and
[`getTemplateVars()`](#api.get.template.vars).

View File

@ -78,7 +78,6 @@ To access more complex array assignments see
[`{foreach}`](#language.function.foreach) and
[`{section}`](#language.function.section)
See also [`assignByRef()`](#api.assign.by.ref),
[`getTemplateVars()`](#api.get.template.vars),
See also [`getTemplateVars()`](#api.get.template.vars),
[`clearAssign()`](#api.clear.assign), [`append()`](#api.append) and
[`{assign}`](#language.function.assign)

View File

@ -50,7 +50,7 @@ parameters:
<?php
include('Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty;
// force compilation of all config files

View File

@ -60,7 +60,7 @@ parameters:
<?php
include('Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty;
// force compilation of all template files

View File

@ -30,7 +30,7 @@ be used to control which variables are seen by which templates.
<?php
include('Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty;
// create data object with its private variable scope

View File

@ -80,7 +80,7 @@ following parameters:
<?php
include('Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty;
// create template object with its private variable scope

View File

@ -31,7 +31,9 @@ PARAMETER.COMPILEID
<?php
include(SMARTY_DIR.'Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty();
$smarty->setCaching(true);

View File

@ -30,7 +30,7 @@ PARAMETER.COMPILEID
<?php
include('Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty;
$smarty->setCaching(true);

View File

@ -1,23 +0,0 @@
getCacheDir()
return the directory where the rendered template\'s output is stored
Description
===========
string
getCacheDir
<?php
// get directory where compiled templates are stored
$cacheDir = $smarty->getCacheDir();
?>
See also [`setCacheDir()`](#api.set.cache.dir) and
[`$cache_dir`](#variable.cache.dir).

View File

@ -1,23 +0,0 @@
getCompileDir()
returns the directory where compiled templates are stored
Description
===========
string
getCompileDir
<?php
// get directory where compiled templates are stored
$compileDir = $smarty->getCompileDir();
?>
See also [`setCompileDir()`](#api.set.compile.dir) and
[`$compile_dir`](#variable.compile.dir).

View File

@ -1,40 +0,0 @@
getTags()
return tags used by template
Description
===========
string
getTags
object
template
This function returns an array of tagname/attribute pairs for all tags
used by the template. It uses the following parameters:
- `template` is the template object.
> **Note**
>
> This function is experimental.
<?php
include('Smarty.class.php');
$smarty = new Smarty;
// create template object
$tpl = $smarty->createTemplate('index.tpl');
// get tags
$tags = $smarty->getTags($tpl);
print_r($tags);
?>

View File

@ -1,40 +0,0 @@
getTemplateDir()
return the directory where templates are stored
Description
===========
string\|array
getTemplateDir
string
key
<?php
// set some template directories
$smarty->setTemplateDir(array(
'one' => './templates',
'two' => './templates_2',
'three' => './templates_3',
));
// get all directories where templates are stored
$template_dir = $smarty->getTemplateDir();
var_dump($template_dir); // array
// get directory identified by key
$template_dir = $smarty->getTemplateDir('one');
var_dump($template_dir); // string
?>
See also [`setTemplateDir()`](#api.set.template.dir),
[`addTemplateDir()`](#api.add.template.dir) and
[`$template_dir`](#variable.template.dir).

View File

@ -22,8 +22,8 @@ string
compile\_id
- This only works if [`$caching`](#variable.caching) is set to one of
`Smarty::CACHING_LIFETIME_CURRENT` or
`Smarty::CACHING_LIFETIME_SAVED` to enable caching. See the [caching
`\Smarty\Smarty::CACHING_LIFETIME_CURRENT` or
`\Smarty\Smarty::CACHING_LIFETIME_SAVED` to enable caching. See the [caching
section](#caching) for more info.
- You can also pass a `$cache_id` as an optional second parameter in

View File

@ -18,7 +18,7 @@ string
name
The first argument specifies the type of the filter to load and can be
one of the following: `pre`, `post` or `output`. The second argument
one of the following: `variable`, `pre`, `post` or `output`. The second argument
specifies the `name` of the filter plugin.
@ -37,6 +37,5 @@ specifies the `name` of the filter plugin.
See also [`registerFilter()`](#api.register.filter),
[`$autoload_filters`](#variable.autoload.filters) and [advanced
See also [`registerFilter()`](#api.register.filter) and [advanced
features](#advanced.features).

View File

@ -15,7 +15,7 @@ handler merely inspects `$errno` and `$errfile` to determine if the
given error was produced deliberately and must be ignored, or should be
passed on to the next error handler.
`Smarty::unmuteExpectedErrors()` removes the current error handler.
`\Smarty\Smarty::unmuteExpectedErrors()` removes the current error handler.
Please note, that if you\'ve registered any custom error handlers after
the muteExpectedErrors() call, the unmute will not remove Smarty\'s
muting error handler, but the one registered last.

View File

@ -31,7 +31,7 @@ how to create custom CacheResources.
<?php
$smarty->registerCacheResource('mysql', new Smarty_CacheResource_Mysql());
$smarty->registerCacheResource('mysql', new My_CacheResource_Mysql());
?>

View File

@ -24,6 +24,7 @@ otherwise. If security is enabled, classes registered with
<?php
use Smarty\Smarty;
class Bar {
$property = "hello world";
@ -44,12 +45,14 @@ otherwise. If security is enabled, classes registered with
<?php
use Smarty\Smarty;
namespace my\php\application {
class Bar {
$property = "hello world";
}
}
$smarty = new Smarty();
$smarty->registerClass("Foo", "\my\php\application\Bar");

View File

@ -25,7 +25,7 @@ plugin types.
<?php
use Smarty\Smarty;
$smarty = new Smarty();
$smarty->registerDefaultPluginHandler('my_plugin_handler');
@ -37,7 +37,7 @@ plugin types.
* @param string $name name of the undefined tag
* @param string $type tag type (e.g. Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK,
Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_MODIFIER, Smarty::PLUGIN_MODIFIERCOMPILER)
* @param Smarty_Internal_Template $template template object
* @param \Smarty\Template\ $template template object
* @param string &$callback returned function name
* @param string &$script optional returned script filepath if function is external
* @param bool &$cacheable true by default, set to false if plugin is not cachable (Smarty >= 3.1.8)

View File

@ -38,8 +38,7 @@ filters](#advanced.features.outputfilters) for more information on how
to set up an output filter function.
See also [`unregisterFilter()`](#api.unregister.filter),
[`loadFilter()`](#api.load.filter),
[`$autoload_filters`](#variable.autoload.filters), [template pre
[`loadFilter()`](#api.load.filter), [template pre
filters](#advanced.features.prefilters) [template post
filters](#advanced.features.postfilters) [template output
filters](#advanced.features.outputfilters) section.

View File

@ -32,9 +32,9 @@ cache\_attrs
This method registers functions or methods defined in your script as
plugin. It uses the following parameters:
- `cacheable` and `cache_attrs` can be omitted in most cases. See
- `cacheable` can be omitted in most cases. See
[controlling cacheability of plugins output](#caching.cacheable) on
how to use them properly.
how to use this properly.
<!-- -->

View File

@ -37,7 +37,7 @@ information on how to setup a function for fetching templates.
<?php
$smarty->registerResource('mysql', new Smarty_Resource_Mysql());
$smarty->registerResource('mysql', new My_Resource_Mysql());
?>

View File

@ -1,32 +0,0 @@
setCacheDir()
set the directory where the rendered template\'s output is stored
Description
===========
Smarty
setCacheDir
string
cache\_dir
<?php
// set directory where rendered template's output is stored
$smarty->setCacheDir('./cache');
// chaining of method calls
$smarty->setTemplateDir('./templates')
->setCompileDir('./templates_c')
->setCacheDir('./cache');
?>
See also [`getCacheDir()`](#api.get.cache.dir) and
[`$cache_dir`](#variable.cache.dir).

View File

@ -1,32 +0,0 @@
setCompileDir()
set the directory where compiled templates are stored
Description
===========
Smarty
setCompileDir
string
compile\_dir
<?php
// set directory where compiled templates are stored
$smarty->setCompileDir('./templates_c');
// chaining of method calls
$smarty->setTemplateDir('./templates')
->setCompileDir('./templates_c')
->setCacheDir('./cache');
?>
See also [`getCompileDir()`](#api.get.compile.dir) and
[`$compile_dir`](#variable.compile.dir).

View File

@ -1,47 +0,0 @@
setConfigDir()
set the directories where config files are stored
Description
===========
Smarty
setConfigDir
string\|array
config\_dir
<?php
// set a single directory where the config files are stored
$smarty->setConfigDir('./config');
// view the config dir chain
var_dump($smarty->getConfigDir());
// set multiple directoríes where config files are stored
$smarty->setConfigDir(array(
'one' => './config',
'two' => './config_2',
'three' => './config_3',
));
// view the config dir chain
var_dump($smarty->getConfigDir());
// chaining of method calls
$smarty->setTemplateDir('./templates')
->setConfigDir('./config')
->setCompileDir('./templates_c')
->setCacheDir('./cache');
?>
See also [`getConfigDir()`](#api.get.config.dir),
[`addConfigDir()`](#api.add.config.dir) and
[`$config_dir`](#variable.config.dir).

View File

@ -1,46 +0,0 @@
setTemplateDir()
set the directories where templates are stored
Description
===========
Smarty
setTemplateDir
string\|array
template\_dir
<?php
// set a single directory where the templates are stored
$smarty->setTemplateDir('./cache');
// view the template dir chain
var_dump($smarty->getTemplateDir());
// set multiple directoríes where templates are stored
$smarty->setTemplateDir(array(
'one' => './templates',
'two' => './templates_2',
'three' => './templates_3',
));
// view the template dir chain
var_dump($smarty->getTemplateDir());
// chaining of method calls
$smarty->setTemplateDir('./templates')
->setCompileDir('./templates_c')
->setCacheDir('./cache');
?>
See also [`getTemplateDir()`](#api.get.template.dir),
[`addTemplateDir()`](#api.add.template.dir) and
[`$template_dir`](#variable.template.dir).

View File

@ -1,59 +0,0 @@
templateExists()
checks whether the specified template exists
Description
===========
bool
templateExists
string
template
It can accept either a path to the template on the filesystem or a
resource string specifying the template.
This example uses `$_GET['page']` to
[`{include}`](#language.function.include) a content template. If the
template does not exist then an error page is displayed instead. First
the `page_container.tpl`
<html>
<head><title>{$title}</title></head>
<body>
{include file='page_top.tpl'}
{* include middle content page *}
{include file=$content_template}
{include file='page_footer.tpl'}
</body>
And the php script
<?php
// set the filename eg index.inc.tpl
$mid_template = $_GET['page'].'.inc.tpl';
if( !$smarty->templateExists($mid_template) ){
$mid_template = 'page_not_found.tpl';
}
$smarty->assign('content_template', $mid_template);
$smarty->display('page_container.tpl');
?>
See also [`display()`](#api.display), [`fetch()`](#api.fetch),
[`{include}`](#language.function.include) and
[`{insert}`](#language.function.insert)

View File

@ -14,7 +14,7 @@ installation can be accessed. It does output a corresponding protocol.
<?php
require_once('Smarty.class.php');
use Smarty\Smarty;
$smarty = new Smarty();
$smarty->testInstall();
?>