|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
littlezoper Smarty n00b
Joined: 28 Aug 2003 Posts: 1 Location: Oklahoma City, OK, USA
|
Posted: Thu Aug 28, 2003 6:40 pm Post subject: Template compilation script |
|
|
I wrote a PHP script to automatically compile all of my templates so that I won't have to make templates_c writable by the web server process. Here's the script for the curious:
<?
require_once ("Smarty.class.php");
$smarty = new Smarty();
if ($dir = @opendir($smarty->template_dir)) {
echo "Processing templates/\n";
while (($file = readdir($dir)) !== false) {
if (substr($file, strlen($file) - 3) == "tpl")
{
echo "Compiling templates/$file \r";
@$smarty->fetch("$file");
}
}
echo "Done. \n";
closedir($dir);
}
?>
When I run this (php -f compile_templates.php), it will randomly create a file with a name like 3f4e4a187eabf and the set the perms on templates_c to rw-r--r--. The file it creates says this:
<?php /* Smarty version 2.5.0, created on 2003-08-28 13:29:44
compiled from */ ?>
Any clue why it does that and how to stop it? Thanks!
jason |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|