Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

is it a bug on windows system?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
hyungwoo
Smarty n00b


Joined: 29 Aug 2003
Posts: 1

PostPosted: Fri Aug 29, 2003 6:39 am    Post subject: is it a bug on windows system? Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP