|
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 |
hyungwoo Smarty n00b
Joined: 29 Aug 2003 Posts: 1
|
Posted: Fri Aug 29, 2003 6:39 am Post subject: is it a bug on windows system? |
|
|
Hello! I'm really novice in smarty. I installed it on my window systems yesterday, but it didn't work properly. so, I was looking for what's wrong.
And, I found it on Smarty.class.php.
But, maybe I'm wrong. so I wanna listen to your opinions.
My problem is : index.php is blank page and it's size is 0. And there is no errors on browser. so I looked into the directories, and there are tempary files with not size 0. But, the size of index.tpl.php is 0.
My action to solve it is : to edit the function _write_file in Smarty.class.php
before editing(origin):
// write to tmp file, then rename it to avoid
// file locking race condition
$_tmp_file = $_dirname . '/' . uniqid('');
if (!($fd = @fopen($_tmp_file, 'w'))) {
$this->trigger_error("problem writing temporary file '$_tmp_file'");
return false;
}
fwrite($fd, $contents);
fclose($fd);
// Win32 can't rename over top another file
if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && file_exists($filename)) {
@unlink($filename);
}
@rename($_tmp_file, $filename);
chmod($filename, $this->_file_perms);
after editing:
$_tmp_file = $_dirname . '\\' . uniqid('');
if (!($fd = @fopen($_tmp_file, 'w'))) {
$this->trigger_error("problem writing temporary file '$_tmp_file'");
return false;
}
fwrite($fd, $contents);
fclose($fd);
// Win32 can't rename over top another file
if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
copy ($_tmp_file, $filename );
chmod($filename, $this->_file_perms);
@unlink($_tmp_file);
} else{
@rename($_tmp_file, $filename);
chmod($filename, $this->_file_perms);
} |
|
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
|