Replace Smarty with PHP templates
In many performance guides, Smarty is considered to be removed to speed up things. But oftentimes it's not Smarty causing performance problems, but rather big modifier chains not being cached. To point this out, we need to profile our template which is quite difficult when Smarty compiles in into something unreadable. So we need a quick and easy way to replace the Smarty template engine with pure PHP code. Since Smarty can't do more than PHP, let's replace Smarty with simple PHP templates. So I'm providing here a small guide to replace Smarty with simple PHP based templates. These can be also cached by APC without any compiler. First thing: Smarty configuration files e.g. core.conf foo = bar [core] logo = public/img/logo.png link = http://www.simple-groupware.de notice = Photo from xy bg_grey = #F5F5F5 Now let's convert it to PHP: core_conf.php <?php $config = array( "logo" => "public/img/logo.png", "bg_grey" => ...