[PHPTAL] problem with changing tmp dir for compiled templates
Mynthon
mynthon1 at gmail.com
Mon May 14 15:17:42 CEST 2007
Hi!
I would like to change tmp dir for templates.
path to my phptal dir is:
/usr/local/www/www4.stat.pl/!lab/php-tal/
so in my index.php
(/usr/local/www/www4.stat.pl/!lab/php-tal/tmp/index.php) im using
something like this:
<?php
define('PHPTAL_PHP_CODE_DESTINATION',
'/usr/local/www/www4.stat.pl/!lab/php-tal/tmp/');
require_once 'PHPTAL.php';
.
.
$template = new PHPTAL('tmpl.html');
echo $template->execute();
?>
and i get only blank page. When i remove define everything works ok.
/tmp/ dir exists and it is writable. I debug it with this code in PHPTAL.php:
//{{{PHPTAL_PHP_CODE_DESTINATION
if (!defined('PHPTAL_PHP_CODE_DESTINATION')){
if (PHPTAL_OS_WIN){
if (file_exists('c:\\WINNT\\Temp\\')){
define('PHPTAL_PHP_CODE_DESTINATION', 'c:\\WINNT\\Temp\\');
}
else {
define('PHPTAL_PHP_CODE_DESTINATION', 'c:\\WINDOWS\\Temp\\');
}
}
else {
define('PHPTAL_PHP_CODE_DESTINATION', '/tmp/');
}
}
//____ LOOK HERE __ DIR EXISTS AND I CAN CREATE/WRITE FILES
$fl = 'tmp'.time().'.txt';
$f = fopen(PHPTAL_PHP_CODE_DESTINATION.$fl, "w");
fwrite($f, 'a'.time());
fclose($f);
include(PHPTAL_PHP_CODE_DESTINATION.$fl);
//}}}
Any ideas?
--
mynthon
http://www.mynthon.net
More information about the PHPTAL
mailing list