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

Upgrade to smarty 3 get the 'unable to write file' error

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
jaketseng
Smarty Rookie


Joined: 11 Dec 2010
Posts: 6

PostPosted: Sat Dec 11, 2010 1:23 pm    Post subject: Upgrade to smarty 3 get the 'unable to write file' error Reply with quote

when I upgraded my apps from smarty 2 to smarty 3, and i had received the error "unable to write file /tmp/wrtzXPSNo". i had find out where the problem is:
1. i use a custom stream wrappers for the smarty's compile_dir.
2. and the Smarty use the tempnam() when write_file, but tempnam() can not support custom stream wrappers registered(http://www.php.net/manual/en/function.tempnam.php#97086).
3. when the smarty 2, the write_file would check it if there is a problem in writing the file and reset the $_tmp_file in the hole path way. and that would be success write the file. ( internals/core.write_file.php line 30 )
4. but in smarty 3, the reset of the $_tmp_file codes was disappeared, so we got the error.

can you check it out ? and fix the problem?

PS: that is a PHP frameworks using the smarty as default , SpeedPHP. http://speedphp.com
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Dec 11, 2010 1:56 pm    Post subject: Reply with quote

This has now been fixed in the SVN trunk version.
Back to top
View user's profile Send private message
jaketseng
Smarty Rookie


Joined: 11 Dec 2010
Posts: 6

PostPosted: Sun Dec 12, 2010 12:37 pm    Post subject: Reply with quote

i had check out the version 3854, and find out there is a problem yet .

file "smarty_internal_write_file.php" line 34, the code:

$_tmp_file = $_dirname . DS . uniqid('wrt');

must be:

$_tmp_file = $_dirpath . DS . uniqid('wrt');

Surprised
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Dec 12, 2010 12:47 pm    Post subject: Reply with quote

Ups, this is fixed in the SVN now.
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 -> Bugs 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