|
|
|
* Here are 3 functions you can use to store parsed template into shared memory with Turck MMCache
(http://www.turcksoft.com/en/e_mmc.htm)
| <?php
// read a template file
function ets_source_read_handler($template)
{
$content = FALSE;
if ($handle = @fopen($template, 'rb')) {
$size = @filesize($template);
$content = @fread($handle, $size);
fclose($handle);
}
return $content;
}
// retrieve a parsed template from shared memory
function ets_cache_read_handler($template)
{
$content = FALSE;
$t_template = mmcache_get("T_$template");
if ($t_template > @filemtime($template)) {
$content = mmcache_get("C_$template");
if (is_null($content)) {
$content = FALSE;
}
}
return $content;
}
// store a parsed template into shared memory
function ets_cache_write_handler($template, $content)
{
mmcache_put("T_$template", time());
mmcache_put("C_$template", $content);
}
?> | |
http://ets.sourceforge.net
|
|
| PHP template processing Categories : PHP, Templates, HTML and PHP | | | GoTemplate Categories : PHP, Complete Programs, Templates | | | Parsing Simple Template Files and Data Categories : PHP, PHP Classes, Templates, Regexps | | | Alternating list with TemplateTamer Categories : PHP, Templates | | | Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | Expose - PHP template engine, supports server and client-sided caching,a plugin system, multiple languages, template script language is based on PHP itself. Categories : PHP, PHP Classes, Templates, Complete Programs | | | Simple Template Class/Example Categories : PHP, Templates, PHP Classes | | | Very minimal templating engine Categories : PHP, PHP Classes, Templates | | | Website Engine Categories : PHP, HTML and PHP, Templates | | | Retrieve text from table and email to your e-
address in pipe delimited format. Categories : PHP, MySQL | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | PHP Script to find url links in a page Categories : PHP, URLs, Regexps, Arrays | | | Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate. Categories : Authentication, PHP | | | very simple ftp class Categories : PHP, PHP Classes, FTP | | | PHP Paypal IPN Integration Class v1.0.0 Categories : PHP, PHP Classes, Payment Gateways | |
|
|
|